Sarbacane_Mailify - Version 1.0.0.8

Version Notes

We improved performance on synchronization.
It should be more efficient and nearly instant on most websites.

Download this release

Release Info

Developer Sarbacane Software
Extension Sarbacane_Mailify
Version 1.0.0.8
Comparing to
See all releases


Code changes from version 1.0.0.7 to 1.0.0.8

Files changed (24) hide show
  1. app/code/community/Sarbacane/Mailify/Block/Adminhtml/Mailify.php +1 -2
  2. app/code/community/Sarbacane/Mailify/Helper/Data.php +188 -121
  3. app/code/community/Sarbacane/Mailify/Model/Observer.php +155 -0
  4. app/code/community/Sarbacane/Mailify/controllers/Adminhtml/MailifyController.php +118 -94
  5. app/code/community/Sarbacane/Mailify/controllers/IndexController.php +519 -366
  6. app/code/community/Sarbacane/Mailify/etc/config.xml +139 -125
  7. app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-install-1.0.0.0.php +0 -52
  8. app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.0-1.0.0.1.php +0 -25
  9. app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.1-1.0.0.2.php +0 -25
  10. app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.2-1.0.0.3.php +0 -25
  11. app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.3-1.0.0.4.php +0 -87
  12. app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.7-1.0.0.8.php +113 -0
  13. app/design/adminhtml/default/default/layout/mailify.xml +6 -6
  14. app/design/adminhtml/default/default/template/mailify/mailify.phtml +261 -245
  15. app/etc/modules/Sarbacane_Mailify.xml +1 -1
  16. app/locale/de_DE/Sarbacane_Mailify.csv +60 -0
  17. app/locale/en_US/Sarbacane_Mailify.csv +7 -5
  18. app/locale/es_ES/Sarbacane_Mailify.csv +7 -5
  19. package.xml +7 -7
  20. skin/adminhtml/default/default/css/Sarbacane_Mailify/mailify.css +0 -107
  21. skin/adminhtml/default/default/images/{sd.png → mailify.png} +0 -0
  22. skin/adminhtml/default/default/js/Sarbacane_Mailify/mailify.js +0 -95
  23. skin/adminhtml/default/default/mailify.css +105 -0
  24. skin/adminhtml/default/default/mailify.js +74 -0
app/code/community/Sarbacane/Mailify/Block/Adminhtml/Mailify.php CHANGED
@@ -18,8 +18,7 @@
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
21
-
22
  class Sarbacane_Mailify_Block_Adminhtml_Mailify extends Mage_Adminhtml_Block_Template
23
  {
24
 
25
- }
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
 
21
  class Sarbacane_Mailify_Block_Adminhtml_Mailify extends Mage_Adminhtml_Block_Template
22
  {
23
 
24
+ }
app/code/community/Sarbacane/Mailify/Helper/Data.php CHANGED
@@ -13,139 +13,206 @@
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Sarbacane
16
- * @package Sarbacane_Sarbacanedesktop
17
  * @author Sarbacane Software <contact@sarbacane.com>
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
21
-
22
  class Sarbacane_Mailify_Helper_Data extends Mage_Core_Helper_Abstract
23
  {
24
 
25
- public function getStoresArray()
26
- {
27
- $stores = Mage::app()->getStores();
28
- $stores_array = array();
29
- foreach ($stores as $store) {
30
- $stores_array[] = array('store_id' => $store->store_id, 'store_name' => $store->name);
31
- }
32
- return $stores_array;
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
- public function getStoreidFromList($list)
36
- {
37
- if (substr($list, -1) == 'N' || substr($list, -1) == 'C') {
38
- return substr($list, 0, -1);
39
- } else {
40
- return substr($list, 0, -2);
41
- }
42
- }
 
 
 
 
 
 
 
43
 
44
- public function getListTypeFromList($list)
45
- {
46
- if (substr($list, -1) == 'N' || substr($list, -1) == 'C') {
47
- return substr($list, -1);
48
- } else {
49
- return substr($list, -2, 1);
50
- }
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
- public function getListTypeArray()
54
- {
55
- return array('N', 'C');
56
- }
 
 
 
 
 
 
 
57
 
58
- public function getListConfiguration($return = 'string')
59
- {
60
- $sd_list = $this->getConfiguration('sd_list');
61
- if ($return == 'string') {
62
- return $sd_list;
63
- } else {
64
- if (strlen($sd_list) != 0) {
65
- return explode(',', $sd_list);
66
- }
67
- return array();
68
- }
69
- }
70
 
71
- public function resetList($list_id = '')
72
- {
73
- $id_shop = $this->getStoreidFromList($list_id);
74
- $list_type = $this->getListTypeFromList($list_id);
75
-
76
- $resource = Mage::getSingleton('core/resource');
77
- $db_write = $resource->getConnection('core_write');
78
- $sarbacanedesktop = $resource->getTableName('sarbacanedesktop_users');
79
- $rq_sql = '
80
- DELETE FROM `' . $sarbacanedesktop . '`
81
- WHERE `sd_type` = "sd_id"
82
- AND `list_id` = ' . $db_write->quote($id_shop.$list_type);
83
- $db_write->query($rq_sql);
84
- }
85
-
86
- public function getToken()
87
- {
88
- $str = $this->getConfiguration('sd_token');
89
- $str = $str . substr(Mage::helper('core')->encrypt('SecurityTokenForModule'), 0, 11) . $str;
90
- $str = md5($str);
91
- return $str;
92
- }
93
 
94
- public function getConfiguration($return = 'nb_configured')
95
- {
96
- $resource = Mage::getSingleton('core/resource');
97
- $db_read = $resource->getConnection('core_read');
98
- $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
99
- $rq_sql = '
100
- SELECT *
101
- FROM `' . $sarbacanedesktop_users . '`
102
- WHERE `sd_type` = \'sd_token\'
103
- OR `sd_type` = \'sd_list\'';
104
- $rq = $db_read->query($rq_sql);
105
- $sd_token = '';
106
- $sd_list = '';
107
- while ($r = $rq->fetch()) {
108
- if ($r['sd_type'] == 'sd_token') {
109
- $sd_token = $r['sd_value'];
110
- }
111
- else if ($r['sd_type'] == 'sd_list') {
112
- $sd_list = $r['sd_value'];
113
- }
114
- }
115
- if ($return == 'sd_token' || $return == 'sd_list') {
116
- if ($return == 'sd_token') {
117
- return $sd_token;
118
- }
119
- else if ($return == 'sd_list') {
120
- return $sd_list;
121
- }
122
- } else {
123
- if ($return == 'all') {
124
- return array(
125
- 'sd_token' => $sd_token,
126
- 'sd_list' => $sd_list
127
- );
128
- } else {
129
- $nb_configured = 0;
130
- if ($sd_token != '') {
131
- $nb_configured++;
132
- }
133
- if ($sd_list != '') {
134
- $nb_configured++;
135
- }
136
- return $nb_configured;
137
- }
138
- }
139
- }
140
 
141
-
142
- public function deleteSdid($sd_id){
143
- $resource = Mage::getSingleton('core/resource');
144
- $db_write = $resource->getConnection('core_write');
145
- $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
146
-
147
- $rq_sql = 'DELETE FROM '.$sarbacanedesktop_users.' WHERE sd_value ="'.$sd_id.' AND sd_type="sd_id"';
148
- $db_write->query($rq_sql);
149
- }
150
 
151
- }
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Sarbacane
16
+ * @package Sarbacane_Mailify
17
  * @author Sarbacane Software <contact@sarbacane.com>
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
 
21
  class Sarbacane_Mailify_Helper_Data extends Mage_Core_Helper_Abstract
22
  {
23
 
24
+ public function getShopsArray()
25
+ {
26
+ $shops = Mage::app()->getStores();
27
+ $shops_array = array();
28
+ foreach ($shops as $shop) {
29
+ $shops_array[] = array(
30
+ 'store_id' => $shop->store_id,
31
+ 'name' => $shop->name
32
+ );
33
+ }
34
+ $shops_array[] = array(
35
+ 'store_id' => '0',
36
+ 'name' => $this->__('Other')
37
+ );
38
+ return $shops_array;
39
+ }
40
+
41
+ public function getIdShopFromList($list)
42
+ {
43
+ if (substr($list, -1) == 'N' || substr($list, -1) == 'C') {
44
+ return substr($list, 0, -1);
45
+ } else {
46
+ return substr($list, 0, -2);
47
+ }
48
+ }
49
+
50
+ public function getListTypeFromList($list)
51
+ {
52
+ if (substr($list, -1) == 'N' || substr($list, -1) == 'C') {
53
+ return substr($list, -1);
54
+ } else {
55
+ return substr($list, -2, 1);
56
+ }
57
+ }
58
+
59
+ public function getListTypeArray()
60
+ {
61
+ return array('N', 'C');
62
+ }
63
+
64
+ public function getListConfiguration($return = 'string')
65
+ {
66
+ $sd_list = $this->getConfiguration('sd_list');
67
+ if ($return == 'string') {
68
+ return $sd_list;
69
+ } else {
70
+ if (strlen($sd_list) != 0) {
71
+ return explode(',', $sd_list);
72
+ }
73
+ return array();
74
+ }
75
+ }
76
 
77
+ public function getToken()
78
+ {
79
+ $str = $this->getConfiguration('sd_token');
80
+ $str = explode('-', $str);
81
+ $token = '';
82
+ foreach ($str as $key => $s) {
83
+ if ($key == 0) {
84
+ $token = $s . substr(Mage::helper('core')->encrypt('SecurityTokenForModule'), 0, 11) . $s;
85
+ $token = md5($token);
86
+ }else {
87
+ $token .= $s;
88
+ }
89
+ }
90
+ return $token;
91
+ }
92
 
93
+ public function getConfiguration($return = 'nb_configured')
94
+ {
95
+ $sd_configuration_loaded = false;
96
+ if (isset($this->sd_configuration)) {
97
+ if (isset($this->sd_configuration['sd_token']) && isset($this->sd_configuration['sd_list'])
98
+ && isset($this->sd_configuration['sd_is_user']) && isset($this->sd_configuration['sd_last_update'])
99
+ && isset($this->sd_configuration['sd_nb_failed'])) {
100
+ $sd_configuration_loaded = true;
101
+ }
102
+ }
103
+ if ( ! $sd_configuration_loaded) {
104
+ $resource = Mage::getSingleton('core/resource');
105
+ $db_read = $resource->getConnection('core_read');
106
+ $sd_data = $resource->getTableName('sd_data');
107
+ $sd_configuration = array(
108
+ 'sd_token' => '',
109
+ 'sd_list' => '',
110
+ 'sd_is_user' => '',
111
+ 'sd_last_update' => '',
112
+ 'sd_nb_failed' => 0
113
+ );
114
+ $rq_sql = '
115
+ SELECT *
116
+ FROM `' . $sd_data . '`
117
+ WHERE `sd_type` IN (\'sd_token\', \'sd_list\', \'sd_is_user\', \'sd_last_update\', \'sd_nb_failed\')';
118
+ $rq = $db_read->query($rq_sql);
119
+ while ($r = $rq->fetch()) {
120
+ $sd_configuration[$r['sd_type']] = $r['sd_value'];
121
+ }
122
+ $sd_configuration['sd_nb_failed'] = (int)$sd_configuration['sd_nb_failed'];
123
+ $this->sd_configuration = $sd_configuration;
124
+ }
125
+ if ($return == 'sd_token' || $return == 'sd_list' || $return == 'sd_is_user' || $return == 'sd_last_update' || $return == 'sd_nb_failed') {
126
+ return $this->sd_configuration[$return];
127
+ } else {
128
+ if ($return == 'all') {
129
+ return $this->sd_configuration;
130
+ } else {
131
+ $nb_configured = 0;
132
+ if ($this->sd_configuration['sd_token'] != '') {
133
+ $nb_configured = 3;
134
+ } else {
135
+ if ($this->sd_configuration['sd_list'] != '') {
136
+ $nb_configured++;
137
+ }
138
+ if ($this->sd_configuration['sd_is_user'] != '') {
139
+ $nb_configured++;
140
+ }
141
+ }
142
+ return $nb_configured;
143
+ }
144
+ }
145
+ }
146
 
147
+ public function updateConfiguration($name, $value) {
148
+ $resource = Mage::getSingleton('core/resource');
149
+ $db_write = $resource->getConnection('core_write');
150
+ $sd_data = $resource->getTableName('sd_data');
151
+ $rq_sql = '
152
+ UPDATE `' . $sd_data . '`
153
+ SET `sd_value` = ' . $db_write->quote($value) . '
154
+ WHERE `sd_type` = ' . $db_write->quote($name);
155
+ $db_write->query($rq_sql);
156
+ unset($this->sd_configuration);
157
+ }
158
 
159
+ public function deleteSdid($sd_id)
160
+ {
161
+ $resource = Mage::getSingleton('core/resource');
162
+ $db_write = $resource->getConnection('core_write');
163
+ $sd_users = $resource->getTableName('sd_users');
164
+ $rq_sql = '
165
+ DELETE
166
+ FROM `' . $sd_users . '`
167
+ WHERE `sd_id` = ' . $db_write->quote($sd_id);
168
+ $db_write->query($rq_sql);
169
+ }
 
170
 
171
+ public function checkNeedUserInsertSdUpdates($store_id, $list_type)
172
+ {
173
+ $sd_list_array = $this->getListConfiguration('array');
174
+ $sd_list_string = implode(',', $sd_list_array);
175
+ if (strpos($sd_list_string, $list_type) === false) {
176
+ return false;
177
+ }
178
+ if ($list_type == 'N') {
179
+ $in_array = in_array($store_id . 'N0', $sd_list_array);
180
+ } else {
181
+ $in_array = in_array($store_id . 'C0', $sd_list_array) || in_array($store_id . 'C1', $sd_list_array);
182
+ }
183
+ if ($in_array) {
184
+ $sd_synchronized_lists_array = $this->getSynchronizedListsArray();
185
+ if (in_array($store_id . $list_type, $sd_synchronized_lists_array)) {
186
+ return true;
187
+ }
188
+ }
189
+ return false;
190
+ }
 
 
191
 
192
+ public function getSynchronizedListsArray() {
193
+ if ( ! isset($this->sd_synchronized_lists_array)) {
194
+ $resource = Mage::getSingleton('core/resource');
195
+ $db_read = $resource->getConnection('core_read');
196
+ $sd_users = $resource->getTableName('sd_users');
197
+ $sd_synchronized_lists_array = array();
198
+ $rq_sql = '
199
+ SELECT `list_id`
200
+ FROM `' . $sd_users . '`
201
+ GROUP BY `list_id`';
202
+ $rq = $db_read->query($rq_sql);
203
+ while ($r = $rq->fetch()) {
204
+ $sd_synchronized_lists_array[] = $r['list_id'];
205
+ }
206
+ $this->sd_synchronized_lists_array = $sd_synchronized_lists_array;
207
+ }
208
+ return $this->sd_synchronized_lists_array;
209
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
+ public function checkFailed() {
212
+ if ($this->getConfiguration('sd_nb_failed') < 1000000) {
213
+ return false;
214
+ }
215
+ return true;
216
+ }
 
 
 
217
 
218
+ }
app/code/community/Sarbacane/Mailify/Model/Observer.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Mailify
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ class Sarbacane_Mailify_Model_Observer
22
+ {
23
+
24
+ public function customerSave(Varien_Event_Observer $observer)
25
+ {
26
+ try {
27
+ if (Mage::app()->getRequest()->getActionName() != 'saveOrder') {
28
+ $old_data = $observer->getCustomer()->getOrigData();
29
+ $new_data = $observer->getCustomer()->getData();
30
+ if (isset($old_data['email']) && isset($new_data['email']) && isset($old_data['store_id']) && isset($new_data['store_id']) && isset($old_data['website_id']) && isset($new_data['website_id'])) {
31
+ $old_website_id = $old_data['website_id'];
32
+ $new_website_id = $new_data['website_id'];
33
+ if ($old_website_id != 0 || $new_website_id != 0) {
34
+ $old_email = $old_data['email'];
35
+ $new_email = $new_data['email'];
36
+ $old_store_id = $old_data['store_id'];
37
+ $new_store_id = $new_data['store_id'];
38
+ if ($old_email != $new_email || $old_store_id != $new_store_id) {
39
+ $now = gmdate('Y-m-d H:i:s');
40
+ $this->userInsertSdUpdatesIfNecessary($old_email, $old_store_id, 'C', 'U', $now);
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ catch(Exception $e) {}
47
+ }
48
+
49
+ public function customerDelete(Varien_Event_Observer $observer)
50
+ {
51
+ try {
52
+ $data = $observer->getCustomer()->getData();
53
+ if (isset($data['email']) && isset($data['entity_id']) && isset($data['store_id']) && isset($data['website_id'])) {
54
+ $website_id = $data['website_id'];
55
+ if ($website_id != 0) {
56
+ $email = $data['email'];
57
+ $store_id = $data['store_id'];
58
+ $now = gmdate('Y-m-d H:i:s');
59
+ $this->userInsertSdUpdatesIfNecessary($email, $store_id, 'C', 'U', $now);
60
+ }
61
+ }
62
+ }
63
+ catch(Exception $e) {}
64
+ }
65
+
66
+ public function newsletterSubscriberSave(Varien_Event_Observer $observer)
67
+ {
68
+ try {
69
+ $action_name = Mage::app()->getRequest()->getActionName();
70
+ if ($action_name != 'saveOrder') {
71
+ $data = $observer->getSubscriber()->getData();
72
+ if (isset($data['subscriber_email']) && isset($data['store_id']) && isset($data['subscriber_status'])) {
73
+ $new_email = $data['subscriber_email'];
74
+ $new_store_id = $data['store_id'];
75
+ $new_status = $data['subscriber_status'];
76
+ if ($new_status == '1' || $new_status == '3') {
77
+ $now = gmdate('Y-m-d H:i:s');
78
+ $mass_unsubscribe_subscribers = false;
79
+ if ($action_name == 'massUnsubscribe') {
80
+ if (Mage::app()->getRequest()->getParam('subscriber')) {
81
+ $mass_unsubscribe_subscribers = true;
82
+ }
83
+ }
84
+ if ($mass_unsubscribe_subscribers) {
85
+ $this->userInsertSdUpdatesIfNecessary($new_email, $new_store_id, 'N', 'U', $now);
86
+ } else {
87
+ if (isset($data['subscriber_id'])) {
88
+ $resource = Mage::getSingleton('core/resource');
89
+ $db_read = $resource->getConnection('core_read');
90
+ $newsletter_subscriber = $resource->getTableName('newsletter_subscriber');
91
+ $rq_sql = '
92
+ SELECT `subscriber_email`, `store_id`, `subscriber_status`
93
+ FROM `' . $newsletter_subscriber . '`
94
+ WHERE `subscriber_id` = ' . (int)$data['subscriber_id'];
95
+ $rq = $db_read->query($rq_sql);
96
+ while ($r = $rq->fetch()) {
97
+ $old_email = $r['subscriber_email'];
98
+ $old_store_id = $r['store_id'];
99
+ $old_status = $r['subscriber_status'];
100
+ if ($old_email != $new_email || $old_store_id != $new_store_id) {
101
+ if ($old_status == '1') {
102
+ $this->userInsertSdUpdatesIfNecessary($old_email, $old_store_id, 'N', 'U', $now);
103
+ }
104
+ } else {
105
+ if ($old_status == '1' && $new_status == '3') {
106
+ $this->userInsertSdUpdatesIfNecessary($new_email, $new_store_id, 'N', 'U', $now);
107
+ }
108
+ }
109
+ }
110
+ }
111
+ if ($new_status == '1') {
112
+ $this->userInsertSdUpdatesIfNecessary($new_email, $new_store_id, 'N', 'S', $now);
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ catch(Exception $e) {}
120
+ }
121
+
122
+ public function newsletterSubscriberDelete(Varien_Event_Observer $observer)
123
+ {
124
+ try {
125
+ $data = $observer->getSubscriber()->getData();
126
+ if (isset($data['subscriber_email']) && isset($data['store_id']) && isset($data['subscriber_status'])) {
127
+ $subscriber_email = $data['subscriber_email'];
128
+ $store_id = $data['store_id'];
129
+ $subscriber_status = $data['subscriber_status'];
130
+ if ($subscriber_status == '1') {
131
+ $now = gmdate('Y-m-d H:i:s');
132
+ $this->userInsertSdUpdatesIfNecessary($subscriber_email, $store_id, 'N', 'U', $now);
133
+ }
134
+ }
135
+ }
136
+ catch(Exception $e) {}
137
+ }
138
+
139
+ private function userInsertSdUpdatesIfNecessary($email, $store_id, $list_type, $action, $now)
140
+ {
141
+ if (Mage::helper('mailify')->checkNeedUserInsertSdUpdates($store_id, $list_type)) {
142
+ $resource = Mage::getSingleton('core/resource');
143
+ $db_write = $resource->getConnection('core_write');
144
+ $sd_updates = $resource->getTableName('sd_updates');
145
+ $rq_sql = '
146
+ INSERT INTO `' . $sd_updates . '` VALUES
147
+ (' . $db_write->quote($email) . ', ' . (int)$store_id . ', ' . $db_write->quote($list_type) . ', ' . $db_write->quote($action) . ', ' . $db_write->quote($now) . ')
148
+ ON DUPLICATE KEY UPDATE
149
+ `action` = VALUES(`action`),
150
+ `update_date` = VALUES(`update_date`)';
151
+ $db_write->query($rq_sql);
152
+ }
153
+ }
154
+
155
+ }
app/code/community/Sarbacane/Mailify/controllers/Adminhtml/MailifyController.php CHANGED
@@ -18,103 +18,127 @@
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
21
-
22
  class Sarbacane_Mailify_Adminhtml_MailifyController extends Mage_Adminhtml_Controller_Action
23
  {
24
 
25
- public function indexAction(){
26
- if (Mage::app()->getRequest()->getParam('submit_configuration') || Mage::app()->getRequest()->getParam('submit_parameter_key')) {
27
- if (Mage::app()->getRequest()->getParam('submit_configuration')) {
28
- $this->saveListConfiguration();
29
- if (Mage::helper('mailify')->getConfiguration('sd_token') == '') {
30
- $this->saveTokenParameterConfiguration();
31
- }
32
- $this->_getSession()->addSuccess($this->__('Your settings have been saved'));
33
- }
34
- else if (Mage::app()->getRequest()->getParam('submit_parameter_key')) {
35
- $this->saveTokenParameterConfiguration();
36
- $this->_getSession()->addSuccess($this->__('Your settings have been saved'));
37
- }
38
- }
39
-
40
- $this->loadLayout();
41
- $block = $this->getLayout()->getBlock('mailify');
42
- $block->setSdFormKey($this->getSdFormKey());
43
- $block->setKeyForSynchronisation($this->getKeyForSynchronisation());
44
- $block->setListConfiguration(Mage::helper('mailify')->getListConfiguration('array'));
45
- $block->setGeneralConfiguration(Mage::helper('mailify')->getConfiguration('nb_configured'));
46
- $block->setStoresArray(Mage::helper('mailify')->getStoresArray());
47
- if(Mage::app()->getRequest()->getParam("sd_is_user")){
48
- Mage::getSingleton("core/session")->setData("sd_is_user",Mage::app()->getRequest()->getParam("sd_is_user"));
49
- }
50
- $this->_title($this->__('Mailify'));
51
- $this->_setActiveMenu('newsletter');
52
- $this->renderLayout();
53
- }
54
-
55
- private function saveListConfiguration()
56
- {
57
- $resource = Mage::getSingleton('core/resource');
58
- $db_write = $resource->getConnection('core_write');
59
- $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
60
- $shops = '';
61
- if (Mage::app()->getRequest()->getParam('store_id')) {
62
- $stores_id = Mage::app()->getRequest()->getParam('store_id');
63
- if (is_array($stores_id)) {
64
- foreach ($stores_id as $store_id) {
65
- $shops .= $store_id . ',';
66
- }
67
- $shops = substr($shops, 0, strlen($shops)-1);
68
- }
69
- }
70
- $old_sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
71
- $rq_sql = '
72
- UPDATE `' . $sarbacanedesktop_users . '`
73
- SET `sd_value` = ' . $db_write->quote($shops) . '
74
- WHERE `sd_type` = \'sd_list\'';
75
- $db_write->query($rq_sql);
76
- $sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
77
- foreach ($sd_list_array as $sd_list)
78
- {
79
- if (!in_array($sd_list, $old_sd_list_array))
80
- {
81
- Mage::helper('mailify')->resetList($sd_list);
82
- }
83
- }
84
- }
85
- private function createTokenParameterConfiguration(){
86
- $resource = Mage::getSingleton('core/resource');
87
- $db_write = $resource->getConnection('core_write');
88
- $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
89
- $rq_sql = 'TRUNCATE `' . $sarbacanedesktop_users . '`';
90
- $db_write->query($rq_sql);
91
- $token_parameter = rand(100000, 999999) . Mage::getModel('core/date')->timestamp(time());
92
- $rq_sql = 'INSERT INTO `' . $sarbacanedesktop_users . '` (`sd_value`,`sd_type`) VALUES (' . $db_write->quote($token_parameter) . ',\'sd_token\')';
93
- $db_write->query($rq_sql);
94
- return $token_parameter;
95
- }
96
- private function saveTokenParameterConfiguration()
97
- {
98
- $resource = Mage::getSingleton('core/resource');
99
- $db_write = $resource->getConnection('core_write');
100
- $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
101
- $token_parameter = rand(100000, 999999) . Mage::getModel('core/date')->timestamp(time());
102
- $rq_sql = '
103
- UPDATE `' . $sarbacanedesktop_users . '`
104
- SET `sd_value` = ' . $db_write->quote($token_parameter) . '
105
- WHERE `sd_type` = \'sd_token\'';
106
- $db_write->query($rq_sql);
107
- return $token_parameter;
108
- }
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- private function getKeyForSynchronisation()
111
- {
112
- return str_rot13('sarbacanedesktop?stk=' . Mage::helper('mailify')->getToken());
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
- private function getSdFormKey()
116
- {
117
- return substr(Mage::helper('core')->encrypt('SarbacaneDesktopForm'), 0, 15);
118
- }
119
 
120
- }
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
 
21
  class Sarbacane_Mailify_Adminhtml_MailifyController extends Mage_Adminhtml_Controller_Action
22
  {
23
 
24
+ protected function _isAllowed()
25
+ {
26
+ return Mage::getSingleton('admin/session')->isAllowed('newsletter/mailify');
27
+ }
28
+
29
+ public function indexAction()
30
+ {
31
+ $general_configuration = Mage::helper('mailify')->getConfiguration('nb_configured');
32
+ $displayed_step = 1;
33
+ if ($general_configuration == 1) {
34
+ $displayed_step = 2;
35
+ } else if ($general_configuration == 2 || $general_configuration == 3) {
36
+ $displayed_step = 3;
37
+ }
38
+ if (Mage::app()->getRequest()->getParam('submit_is_user')) {
39
+ $this->saveSdIsUser();
40
+ $general_configuration = Mage::helper('mailify')->getConfiguration('nb_configured');
41
+ $displayed_step = 2;
42
+ } else if (Mage::app()->getRequest()->getParam('submit_configuration')) {
43
+ $this->saveListConfiguration();
44
+ if (Mage::helper('mailify')->getConfiguration('sd_token') == '') {
45
+ $this->saveTokenParameterConfiguration();
46
+ }
47
+ $general_configuration = Mage::helper('mailify')->getConfiguration('nb_configured');
48
+ $displayed_step = 3;
49
+ } else if (Mage::app()->getRequest()->getParam('submit_parameter_key')) {
50
+ $this->saveTokenParameterConfiguration();
51
+ }
52
+ $this->loadLayout();
53
+ $block = $this->getLayout()->getBlock('mailify');
54
+ $block->setSdFormKey($this->getSdFormKey());
55
+ $block->setKeyForSynchronisation($this->getKeyForSynchronisation());
56
+ $block->setCheckFailed(Mage::helper('mailify')->checkFailed());
57
+ $block->setListConfiguration(Mage::helper('mailify')->getListConfiguration('array'));
58
+ $block->setGeneralConfiguration($general_configuration);
59
+ $block->setSdIsUser(Mage::helper('mailify')->getConfiguration('sd_is_user'));
60
+ $block->setDisplayedStep($displayed_step);
61
+ $block->setShopsArray(Mage::helper('mailify')->getShopsArray());
62
+ $this->_title($this->__('Mailify'));
63
+ $this->_setActiveMenu('newsletter');
64
+ $this->renderLayout();
65
+ }
66
+
67
+ private function saveSdIsUser()
68
+ {
69
+ if (Mage::app()->getRequest()->getParam('sd_is_user')) {
70
+ $sd_is_user = Mage::app()->getRequest()->getParam('sd_is_user');
71
+ Mage::helper('mailify')->updateConfiguration('sd_is_user', $sd_is_user);
72
+ }
73
+ }
74
+
75
+ private function saveTokenParameterConfiguration()
76
+ {
77
+ $resource = Mage::getSingleton('core/resource');
78
+ $db_write = $resource->getConnection('core_write');
79
+ $sd_updates = $resource->getTableName('sd_updates');
80
+ $sd_users = $resource->getTableName('sd_users');
81
+ Mage::helper('mailify')->updateConfiguration('sd_nb_failed', '');
82
+ $rq_sql = 'TRUNCATE `' . $sd_updates . '`';
83
+ $db_write->query($rq_sql);
84
+ $rq_sql = 'TRUNCATE `' . $sd_users . '`';
85
+ $db_write->query($rq_sql);
86
+ $token_parameter = rand(100000, 999999) . time() . '-';
87
+ $characters = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
88
+ $nb_characters = strlen($characters);
89
+ for ($i = 0; $i < 30; $i++) {
90
+ $token_parameter .= substr($characters, mt_rand(0, $nb_characters - 1), 1);
91
+ }
92
+ Mage::helper('mailify')->updateConfiguration('sd_token', $token_parameter);
93
+ }
94
+
95
+ private function getKeyForSynchronisation()
96
+ {
97
+ return str_rot13('sarbacanedesktop?stk=' . Mage::helper('mailify')->getToken());
98
+ }
99
+
100
+ private function saveListConfiguration()
101
+ {
102
+ $shops = '';
103
+ if (Mage::app()->getRequest()->getParam('store_id')) {
104
+ $stores_id = Mage::app()->getRequest()->getParam('store_id');
105
+ if (is_array($stores_id)) {
106
+ $sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
107
+ foreach ($sd_list_array as $sd_list) {
108
+ if ( ! in_array($sd_list, $stores_id)) {
109
+ $store_id = Mage::helper('mailify')->getIdShopFromList($sd_list);
110
+ $list_type = Mage::helper('mailify')->getListTypeFromList($sd_list);
111
+ $this->deleteListData($list_type, $store_id);
112
+ }
113
+ }
114
+ $shops = implode(',', $stores_id);
115
+ }
116
+ }
117
+ Mage::helper('mailify')->updateConfiguration('sd_list', $shops);
118
+ }
119
 
120
+ private function deleteListData($list_type, $store_id)
121
+ {
122
+ $resource = Mage::getSingleton('core/resource');
123
+ $db_write = $resource->getConnection('core_write');
124
+ $sd_updates = $resource->getTableName('sd_updates');
125
+ $sd_users = $resource->getTableName('sd_users');
126
+ $rq_sql = '
127
+ DELETE
128
+ FROM `' . $sd_updates . '`
129
+ WHERE `store_id` = ' . (int)$store_id . '
130
+ AND `list_type` = ' . $db_write->quote($list_type);
131
+ $db_write->query($rq_sql);
132
+ $rq_sql = '
133
+ DELETE
134
+ FROM `' . $sd_users . '`
135
+ WHERE `list_id` = ' . $db_write->quote($store_id . $list_type);
136
+ $db_write->query($rq_sql);
137
+ }
138
 
139
+ private function getSdFormKey()
140
+ {
141
+ return substr(Mage::helper('core')->encrypt('SarbacaneDesktopForm'), 0, 15);
142
+ }
143
 
144
+ }
app/code/community/Sarbacane/Mailify/controllers/IndexController.php CHANGED
@@ -1,366 +1,519 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Mailify
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
- class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Action {
22
- private function saveSdid($sdid, $list) {
23
- $resource = Mage::getSingleton ( 'core/resource' );
24
- $db_write = $resource->getConnection ( 'core_write' );
25
- $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
26
- $rq_sql = 'DELETE FROM `' . $sarbacanedesktop_users . '` WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sdid . '\' AND list_id=\'' . $list . '\'';
27
- $rq = $db_write->query ( $rq_sql );
28
- $rq_sql = '
29
- INSERT INTO `' . $sarbacanedesktop_users . '` (`sd_type`, `sd_value`, `list_id`, `last_call_date` ) VALUES
30
- (\'sd_id\', ' . $db_write->quote ( $sdid ) . ', \'' . $list . '\', \'' . date ( 'Y-m-d H:i:s' ) . '\')';
31
- $rq = $db_write->query ( $rq_sql );
32
- return;
33
- }
34
- public function indexAction() {
35
- if (Mage::app ()->getRequest ()->getParam ( 'stk' ) && Mage::app ()->getRequest ()->getParam ( 'sdid' )) {
36
- $sdid = Mage::app ()->getRequest ()->getParam ( 'sdid' );
37
- if (Mage::app ()->getRequest ()->getParam ( 'stk' ) == Mage::helper ( 'mailify' )->getToken () && $sdid != '') {
38
- $identifier = Mage::helper ( 'mailify' )->getConfiguration ( 'identifier' );
39
- $sd_id = "";
40
- $configuration = Mage::helper ( 'mailify' )->getConfiguration ( 'all' );
41
- if ($configuration ['sd_token'] != '' && $configuration ['sd_list'] != '') {
42
- $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
43
- if ($sd_list_array != '') {
44
- if (Mage::app ()->getRequest ()->getParam ( 'list' )) {
45
- $list = Mage::app ()->getRequest ()->getParam ( 'list' );
46
- $store_id = Mage::helper ( 'mailify' )->getStoreidFromList ( $list );
47
- $list_type = Mage::helper ( 'mailify' )->getListTypeFromList ( $list );
48
- $list_type_array = Mage::helper ( 'mailify' )->getListTypeArray ();
49
- if (in_array ( $list_type, $list_type_array )) {
50
- $id_and_list = $store_id . $list_type;
51
- if (($list_type == 'N' && in_array ( $id_and_list . '0', $sd_list_array )) || ($list_type == 'C' && (in_array ( $id_and_list . '0', $sd_list_array ) || in_array ( $id_and_list . '1', $sd_list_array )))) {
52
- $this->processNewUnsubcribersAndSubscribers ( $list_type, $store_id, $sdid );
53
- $sd_id = $this->saveSdid ( $sdid, $list );
54
- }else{
55
- header ( 'HTTP/1.1 404 Not found' );
56
- header ( "Content-type: application/json ; charset=utf-8" );
57
- die ( 'FAILED_ID' );
58
- }
59
- } else {
60
- header ( 'HTTP/1.1 404 Not found' );
61
- header ( "Content-type: application/json ; charset=utf-8" );
62
- die ( 'FAILED_ID' );
63
- }
64
- } else {
65
- if ('reset' == Mage::app ()->getRequest ()->getParam ( 'action' )) {
66
- Mage::helper ( 'mailify' )->deleteSdid ( $sd_id );
67
- } else {
68
- $this->getFormattedContentShops ( $sdid );
69
- }
70
- }
71
- }
72
- }
73
- } else {
74
- header ( "HTTP/1.1 403 Unauthorized" );
75
- header ( "Content-type: application/json; charset=utf-8" );
76
- die ( 'FAILED_SDTOKEN' );
77
- }
78
- } else {
79
- echo "Param&egrave;tre[s] manquant[s]";
80
- }
81
- }
82
- private function processNewUnsubcribersAndSubscribers($list_type, $store_id, $sd_id) {
83
- $resource = Mage::getSingleton ( 'core/resource' );
84
- $db_read = $resource->getConnection ( 'core_read' );
85
- $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
86
- $rq_sql = 'SELECT last_call_date FROM ' . $sarbacanedesktop_users . ' WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sd_id . '\' AND list_id=\'' . $store_id . $list_type . '\'';
87
- $last_call_date = $db_read->fetchOne ( $rq_sql );
88
- $line = 'email;lastname;firstname';
89
- if ($list_type == 'C') {
90
- if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
91
- $line .= ';date_first_order;date_last_order;amount_min_order;amount_max_order;amount_avg_order;nb_orders;amount_all_orders;most_profitable_category';
92
- }
93
- }
94
- $line .= ';action'."\r\n";
95
- echo $line;
96
- $this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
97
- $this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
98
- }
99
- private function getListTypeArray() {
100
- return array (
101
- 'N',
102
- 'C'
103
- );
104
- }
105
- private function checkIfListWithCustomerData($list_type, $store_id) {
106
- $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
107
- if (in_array ( $store_id . $list_type . '1', $sd_list_array )) {
108
- return true;
109
- }
110
- return false;
111
- }
112
- private function getFormattedContentShops($sd_id) {
113
- $stores = Mage::helper ( 'mailify' )->getStoresArray ();
114
- echo 'list_id;name;reset;is_updated;type;version' . "\n";
115
- $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
116
- $list_array = array ();
117
- foreach ( $sd_list_array as $list ) {
118
- $store_id = Mage::helper ( 'mailify' )->getStoreidFromList ( $list );
119
- $list_type = Mage::helper ( 'mailify' )->getListTypeFromList ( $list );
120
- array_push ( $list_array, array (
121
- 'store_id' => $store_id,
122
- 'list_type' => $list_type,
123
- 'list_id' => $list
124
- ) );
125
- }
126
- foreach ( $stores as $store ) {
127
- foreach ( $list_array as $list ) {
128
- if ($store ['store_id'] == $list ['store_id']) {
129
- $store_list = "" . $store ['store_id'] . $list ['list_type'] . ';' . $this->dQuote ( $store ['store_name'] ) . ';'; // TEST
130
- $store_list .= $this->listIsResetted ( $store ['store_id'] . $list ['list_type'], $sd_id ) . ';';
131
- $store_list .= $this->listIsUpdated ( $store ['store_id'], $list ['list_type'], $sd_id ) . ';';
132
- $store_list .= 'Magento;1.0.0.7' . "\r\n";
133
- echo $store_list;
134
- }
135
- }
136
- }
137
- }
138
- private function listIsResetted($list_id, $sd_id) {
139
- $resource = Mage::getSingleton ( 'core/resource' );
140
- $db_read = $resource->getConnection ( 'core_read' );
141
- $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
142
- $rq_sql = '
143
- SELECT count(*) AS `nb_in_table`
144
- FROM ' . $sarbacanedesktop_users . '
145
- WHERE `sd_type` = "sd_id"
146
- AND `sd_value` = ' . $db_read->quote ( $sd_id ) . ' AND list_id="' . $list_id . '"';
147
- $nb_in_table = $db_read->fetchOne ( $rq_sql );
148
- if ($nb_in_table == 0)
149
- return 'Y';
150
- return 'N';
151
- }
152
- private function listIsUpdated($store_id, $list_type, $sd_id) {
153
- $resource = Mage::getSingleton ( 'core/resource' );
154
- $db_read = $resource->getConnection ( 'core_read' );
155
- $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
156
- $rq_sql = 'SELECT last_call_date FROM ' . $sarbacanedesktop_users . ' WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sd_id . '\' AND list_id=\'' . $store_id . $list_type . '\'';
157
- $last_call_date = $db_read->fetchOne ( $rq_sql );
158
- $is_updated_list = 'N';
159
- if ($this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'is_updated', $last_call_date ) > 0) {
160
- $is_updated_list = 'Y';
161
- }
162
- if ($this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'is_updated', $last_call_date ) > 0) {
163
- $is_updated_list = 'Y';
164
- }
165
- return $is_updated_list;
166
- }
167
- private function dQuote($value) {
168
- $value = str_replace ( '"', '""', $value );
169
- if (strpos ( $value, ' ' ) || strpos ( $value, ';' )) {
170
- $value = '"' . $value . '"';
171
- }
172
- return $value;
173
- }
174
- private function processNewSubscribers($list_type, $store_id, $sd_id, $type_action = 'display', $last_call_date) { $resource = Mage::getSingleton ( 'core/resource' );
175
- $db_read = $resource->getConnection ( 'core_read' );
176
- $db_write = $resource->getConnection ( 'core_write' );
177
- $sd_updates = $resource->getTableName ( 'sd_updates' );
178
- $newsletter_subscriber = $resource->getTableName ( 'newsletter_subscriber' );
179
- $sales_flat_order = $resource->getTableName ( 'sales_flat_order' );
180
- $sales_flat_order_item = $resource->getTableName ( 'sales_flat_order_item' );
181
- $catalog_category_product = $resource->getTableName ( 'catalog_category_product' );
182
- $catalog_category_entity_varchar = $resource->getTableName ( 'catalog_category_entity_varchar' );
183
- $customer_entity = $resource->getTableName ( 'customer_entity' );
184
- $customer_entity_varchar = $resource->getTableName ( 'customer_entity_varchar' );
185
- $core_store = $resource->getTableName ( 'core_store' ); // core store
186
- $attr_firstname = Mage::getModel ( 'customer/customer' )->getAttribute ( 'firstname' )->getAttributeId ();
187
- $attr_lastname = Mage::getModel ( 'customer/customer' )->getAttribute ( 'lastname' )->getAttributeId ();
188
- if ($list_type == 'N') {
189
- if ($last_call_date != null && $last_call_date != '') {
190
- $rq_sql = 'SELECT sdu.`email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
191
- FROM `' . $sd_updates . '` AS `sdu`
192
- LEFT JOIN ' . $newsletter_subscriber . ' ns ON ns.subscriber_email = sdu.email
193
- LEFT JOIN ' . $customer_entity_varchar . ' AS `lastname` ON lastname.`entity_id` = ns.`customer_id` AND lastname.`attribute_id` = ' . ( int ) $attr_lastname . '
194
- LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
195
- WHERE ns.`subscriber_status` = 1 AND sdu.update_time > "' . $last_call_date . '" AND sdu.list_type="N" AND sdu.action="S"
196
- AND ns.`store_id` = ' . ( int ) $store_id;
197
- } else {
198
- $rq_sql = '
199
- SELECT ns.`subscriber_email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
200
- FROM `' . $newsletter_subscriber . '` AS `ns`
201
- LEFT JOIN ' . $customer_entity_varchar . ' AS `lastname` ON lastname.`entity_id` = ns.`customer_id` AND lastname.`attribute_id` = ' . ( int ) $attr_lastname . '
202
- LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
203
- WHERE ns.`subscriber_status` = 1
204
- AND ns.`store_id` = ' . ( int ) $store_id;
205
- }
206
- } else if ($list_type == 'C') {
207
- $add_customer_data = $this->checkIfListWithCustomerData ( $list_type, $store_id );
208
- if ($add_customer_data) {
209
- $rq_sql = "SELECT
210
- c.email,
211
- cevln.value AS lastname,
212
- cevfn.value AS firstname,
213
- MAX(sfo.base_grand_total) AS amount_max_order,
214
- MIN(sfo.base_grand_total) AS amount_min_order,
215
- AVG(sfo.base_grand_total) AS amount_avg_order,
216
- MIN(sfo.created_at) AS date_first_order,
217
- MAX(sfo.created_at) AS date_last_order,
218
- COUNT(sfo.entity_id) AS nb_orders,
219
- SUM(sfo.base_grand_total) AS amount_all_orders,
220
- (SELECT
221
- ccev.value AS category
222
- FROM
223
- $sales_flat_order AS sfo2
224
- LEFT JOIN
225
- $sales_flat_order_item AS sfoi ON sfo2.entity_id = sfoi.order_id
226
- LEFT JOIN
227
- $catalog_category_product AS ccp ON ccp.product_id = sfoi.product_id
228
- LEFT JOIN
229
- $catalog_category_entity_varchar AS ccev ON ccev.entity_id = ccp.category_id
230
- AND ccev.attribute_id = 41
231
- AND ccev.entity_type_id = 3
232
- WHERE sfo2.customer_id = c.entity_id AND sfo.store_id=$store_id
233
- GROUP BY category
234
- ORDER BY SUM(sfoi.row_total) DESC
235
- LIMIT 1) AS category
236
- FROM
237
- $customer_entity AS c
238
- LEFT JOIN
239
- $customer_entity_varchar AS cevfn ON cevfn.entity_id = c.entity_id
240
- AND cevfn.attribute_id = 5
241
- LEFT JOIN
242
- $customer_entity_varchar AS cevln ON cevln.entity_id = c.entity_id
243
- AND cevln.attribute_id = 7
244
- LEFT JOIN
245
- $sales_flat_order AS sfo ON sfo.customer_id = c.entity_id AND c.store_id = sfo.store_id
246
- WHERE c.store_id = " . $store_id;
247
- if ($last_call_date != null && $last_call_date != '') {
248
- $rq_sql .= " AND (c.created_at > '" . $last_call_date . "' OR c.updated_at > '" . $last_call_date . "' ";
249
- $rq_sql .= " OR sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
250
- }
251
- $rq_sql .= " GROUP BY c.entity_id ";
252
- $rq_sql .= " UNION (
253
-
254
- SELECT
255
- sfo.customer_email AS email, sfo.customer_lastname AS lastname,sfo.customer_firstname AS firstname,
256
- MAX(sfo.base_grand_total) AS amount_max_order,
257
- MIN(sfo.base_grand_total) AS amount_min_order,
258
- AVG(sfo.base_grand_total) AS amount_avg_order,
259
- MIN(sfo.created_at) AS date_first_order,
260
- MAX(sfo.created_at) AS date_last_order,
261
- COUNT(sfo.entity_id) AS nb_orders,
262
- SUM(sfo.base_grand_total) AS amount_all_orders,
263
- (SELECT
264
- ccev.value AS category
265
- FROM
266
- $sales_flat_order AS sfo2
267
- LEFT JOIN
268
- $sales_flat_order_item AS sfoi ON sfo2.entity_id = sfoi.order_id
269
- LEFT JOIN
270
- $catalog_category_product AS ccp ON ccp.product_id = sfoi.product_id
271
- LEFT JOIN
272
- $catalog_category_entity_varchar AS ccev ON ccev.entity_id = ccp.category_id
273
- AND ccev.attribute_id = 41
274
- AND ccev.entity_type_id = 3
275
- WHERE sfo2.customer_email = sfo.customer_email AND sfo2.customer_is_guest = 1 AND sfo2.store_id = sfo.store_id
276
- GROUP BY category
277
- ORDER BY SUM(sfoi.row_total) DESC
278
- LIMIT 1) AS most_profitable_category
279
- FROM
280
- $sales_flat_order AS sfo
281
- WHERE sfo.customer_is_guest = 1 AND sfo.store_id = " . $store_id;
282
- if ($last_call_date != null && $last_call_date != '') {
283
- $rq_sql .= " AND (sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
284
- }
285
- $rq_sql .= " GROUP BY sfo.customer_email)";
286
- } else {
287
- $rq_sql = " SELECT t.email, t.lastname, t.firstname ";
288
- $rq_sql .= " FROM ( SELECT c.email AS email,cevln.value AS lastname, cevfn.value AS firstname ";
289
- $rq_sql .= " FROM $customer_entity c LEFT JOIN $customer_entity_varchar cevln ON cevln.entity_id = c.entity_id AND cevln.attribute_id=7
290
- LEFT JOIN $customer_entity_varchar cevfn ON cevfn.entity_id = c.entity_id AND cevfn.attribute_id = 5";
291
- $rq_sql .= " WHERE c.store_id = " . $store_id;
292
- if ($last_call_date != null && $last_call_date != '') {
293
- $rq_sql .= " AND (c.created_at > '" . $last_call_date . "' OR c.updated_at > '" . $last_call_date . "')";
294
- }
295
- $rq_sql .= " GROUP BY c.email
296
- UNION
297
- SELECT sfo.customer_email AS email ,sfo.customer_lastname as lastname, sfo.customer_firstname as firstname";
298
- $rq_sql .= " FROM $sales_flat_order sfo ";
299
- $rq_sql .= " WHERE sfo.customer_id IS NULL AND sfo.store_id = " . $store_id;
300
- if ($last_call_date != null && $last_call_date != '') {
301
- $rq_sql .= " AND (sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
302
- }
303
- $rq_sql .= " GROUP BY email ";
304
-
305
- $rq_sql .= " ) as t ";
306
- $rq_sql .= " GROUP BY t.email;";
307
- }
308
- } else {
309
- return;
310
- }
311
- if ($type_action == 'is_updated') {
312
- $rq_sql .= ' LIMIT 0, 1 ';
313
- $rq = $db_read->fetchAll ( $rq_sql );
314
- return count ( $rq );
315
- } else {
316
- $rq = $db_read->query ( $rq_sql );
317
- while ( $r = $rq->fetch () ) {
318
- $line = $this->dQuote ( $r ['email'] ) . ';'; // TEST
319
- $line .= $this->dQuote ( $r ['lastname'] ) . ';' . $this->dQuote ( $r ['firstname'] );
320
- if ($list_type == 'C') {
321
- if ($add_customer_data) {
322
- $line .= ';' . $this->dQuote ( $r ['date_first_order'] ) . ';' . $this->dQuote ( $r ['date_last_order'] );
323
- $line .= ';' . ( float ) $r ['amount_min_order'] . ';' . ( float ) $r ['amount_max_order'] . ';' . ( float ) $r ['amount_avg_order'];
324
- $line .= ';' . $r ['nb_orders'] . ';' . ( float ) $r ['amount_all_orders'] . ';' . $r ['category'];
325
- }
326
- }
327
- $line .= ';S'."\r\n";
328
- echo $line;
329
- }
330
- }
331
- }
332
- private function processNewUnsubscribers($list_type, $store_id, $sd_id, $type_action = 'display', $last_call_date) {
333
- $resource = Mage::getSingleton ( 'core/resource' );
334
- $db_read = $resource->getConnection ( 'core_read' );
335
-
336
- $sd_updates = $resource->getTableName ( 'sd_updates' );
337
-
338
- switch ($list_type) {
339
- case 'N' :
340
- case 'C' :
341
- $rq_sql = 'SELECT email FROM ' . $sd_updates . ' WHERE list_type="' . $list_type . '" AND action = "U"';
342
- if ($last_call_date != null && $last_call_date != '') {
343
- $rq_sql .= ' AND update_time > "' . $last_call_date . '"';
344
- }
345
- break;
346
- default :
347
- return;
348
- }
349
- if ($type_action == 'is_updated') {
350
- $rq = $db_read->fetchAll ( $rq_sql );
351
- return count ( $rq );
352
- } else {
353
- $rq = $db_read->query ( $rq_sql );
354
- while ( $r = $rq->fetch () ) {
355
- $line = $this->dQuote ( $r ['email'] ) . ';;'; // TEST
356
- if ($list_type == 'C') {
357
- if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
358
- $line .= ';;;;;;;;';
359
- }
360
- }
361
- $line .= ';U' . "\r\n";
362
- echo $line;
363
- }
364
- }
365
- }
366
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Mailify
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Action
22
+ {
23
+
24
+ public function indexAction()
25
+ {
26
+ if (Mage::app()->getRequest()->getParam('stk') && Mage::app()->getRequest()->getParam('sdid')) {
27
+ $sdid = Mage::app()->getRequest()->getParam('sdid');
28
+ $stk = Mage::helper('mailify')->getToken();
29
+ if (Mage::app()->getRequest()->getParam('stk') == $stk && strlen($stk) > 30 && ! Mage::helper('mailify')->checkFailed()) {
30
+ if ($sdid != '' && Mage::helper('mailify')->getConfiguration('nb_configured') == 3) {
31
+ header('Content-type: text/plain; charset=utf-8');
32
+ $configuration = Mage::helper('mailify')->getConfiguration('all');
33
+ if ($configuration['sd_token'] != '' && $configuration['sd_list'] != '' && $configuration['sd_is_user'] != '') {
34
+ $sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
35
+ if (is_array($sd_list_array) && count($sd_list_array) > 0) {
36
+ if (Mage::app()->getRequest()->getParam('list')) {
37
+ $list = Mage::app()->getRequest()->getParam('list');
38
+ $store_id = Mage::helper('mailify')->getIdShopFromList($list);
39
+ $list_type = Mage::helper('mailify')->getListTypeFromList($list);
40
+ $list_type_array = Mage::helper('mailify')->getListTypeArray();
41
+ if (in_array($list_type, $list_type_array)) {
42
+ if (($list_type == 'N' && in_array($list . '0', $sd_list_array))
43
+ || ($list_type == 'C' && (in_array($list . '0', $sd_list_array) || in_array($list . '1', $sd_list_array)))) {
44
+ $now = gmdate('Y-m-d H:i:s');
45
+ $this->processNewUnsubcribersAndSubscribers($list_type, $store_id, $sdid);
46
+ $this->saveSdid($sdid, $list, $now);
47
+ $this->clearHistory($list_type, $store_id);
48
+ } else {
49
+ header('HTTP/1.1 404 Not found');
50
+ die('FAILED_ID');
51
+ }
52
+ } else {
53
+ header('HTTP/1.1 404 Not found');
54
+ die('FAILED_ID');
55
+ }
56
+ } else {
57
+ if (Mage::app()->getRequest()->getParam('action') == 'reset') {
58
+ Mage::helper('mailify')->deleteSdid($sdid);
59
+ } else {
60
+ $this->setDataToUpdate();
61
+ $this->getFormattedContentShops($sdid);
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ } else {
68
+ $this->updateFailed();
69
+ header("HTTP/1.1 403 Unauthorized");
70
+ die('FAILED_SDTOKEN');
71
+ }
72
+ die;
73
+ }
74
+ }
75
+
76
+ private function saveSdid($sd_id, $list, $now)
77
+ {
78
+ $resource = Mage::getSingleton('core/resource');
79
+ $db_write = $resource->getConnection('core_write');
80
+ $sd_users = $resource->getTableName('sd_users');
81
+ $rq_sql = '
82
+ INSERT INTO `' . $sd_users . '` VALUES
83
+ (' . $db_write->quote($sd_id) . ', ' . $db_write->quote($list) . ', ' . $db_write->quote($now) . ')
84
+ ON DUPLICATE KEY UPDATE
85
+ `last_call_date` = VALUES(`last_call_date`)';
86
+ $db_write->query($rq_sql);
87
+ }
88
+
89
+ private function updateFailed() {
90
+ if ( ! Mage::helper('mailify')->checkFailed()) {
91
+ Mage::helper('mailify')->updateConfiguration('sd_nb_failed', Mage::helper('mailify')->getConfiguration('sd_nb_failed') + 1);
92
+ }
93
+ }
94
+
95
+ private function setDataToUpdate()
96
+ {
97
+ $resource = Mage::getSingleton('core/resource');
98
+ $db_write = $resource->getConnection('core_write');
99
+ $sd_updates = $resource->getTableName('sd_updates');
100
+ $sales_flat_order = $resource->getTableName('sales_flat_order');
101
+ $customer_entity = $resource->getTableName('customer_entity');
102
+ $now = gmdate('Y-m-d H:i:s');
103
+ if (count(Mage::helper('mailify')->getSynchronizedListsArray() > 0)) {
104
+ $sd_last_update = Mage::helper('mailify')->getConfiguration('sd_last_update');
105
+ if ($sd_last_update != '') {
106
+ $sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
107
+ if (count($sd_list_array) > 0) {
108
+ $id_shops_customer_array = array();
109
+ foreach ($sd_list_array as $sd_list) {
110
+ $store_id = substr($sd_list, 0, -2);
111
+ if (strpos($sd_list, 'C') !== false) {
112
+ if (Mage::helper('mailify')->checkNeedUserInsertSdUpdates($store_id, 'C')) {
113
+ $id_shops_customer_array[] = (int)$store_id;
114
+ }
115
+ }
116
+ }
117
+ if (count($id_shops_customer_array) > 0) {
118
+ $id_shops_customer = implode(', ', $id_shops_customer_array);
119
+ for ($i = 0; $i < 2; $i++) {
120
+ if ($i == 0) {
121
+ $rq_sql_action = 'S';
122
+ $rq_sql_where = '`is_active` = 1';
123
+ } else {
124
+ $rq_sql_action = 'U';
125
+ $rq_sql_where = '`is_active` = 0';
126
+ }
127
+ $rq_sql = '
128
+ INSERT INTO `' . $sd_updates . '`
129
+ SELECT `email`, `store_id`, \'C\' AS `list_type`, \'' . $rq_sql_action . '\' AS `action`, ' . $db_write->quote($now) . ' AS `update_date`
130
+ FROM `' . $customer_entity . '`
131
+ WHERE `updated_at` >= ' . $db_write->quote($sd_last_update) . '
132
+ AND `updated_at` < ' . $db_write->quote($now) . '
133
+ AND `store_id` IN (' . $id_shops_customer . ')
134
+ AND `website_id` != 0
135
+ AND ' . $rq_sql_where . '
136
+ ON DUPLICATE KEY UPDATE
137
+ `action` = VALUES(`action`),
138
+ `update_date` = VALUES(`update_date`)';
139
+ $db_write->query($rq_sql);
140
+ }
141
+ $rq_sql = '
142
+ INSERT INTO `' . $sd_updates . '`
143
+ SELECT IFNULL(`c`.`email`, `sfo`.`customer_email`) AS `email`, `sfo`.`store_id`, \'C\' AS `list_type`, \'S\' AS `action`, ' . $db_write->quote($now) . ' AS `update_date`
144
+ FROM `' . $sales_flat_order . '` AS `sfo`
145
+ LEFT JOIN `' . $customer_entity . '` AS `c`
146
+ ON `c`.`entity_id` = `sfo`.`customer_id`
147
+ AND `c`.`store_id` = `sfo`.`store_id`
148
+ AND `c`.`website_id` != 0
149
+ WHERE `sfo`.`updated_at` >= ' . $db_write->quote($sd_last_update) . '
150
+ AND `sfo`.`updated_at` < ' . $db_write->quote($now) . '
151
+ AND `sfo`.`store_id` IN (' . $id_shops_customer . ')
152
+ ON DUPLICATE KEY UPDATE
153
+ `action` = VALUES(`action`),
154
+ `update_date` = VALUES(`update_date`)';
155
+ $db_write->query($rq_sql);
156
+ }
157
+ }
158
+ }
159
+ }
160
+ Mage::helper('mailify')->updateConfiguration('sd_last_update', $now);
161
+ }
162
+
163
+ private function processNewUnsubcribersAndSubscribers($list_type, $store_id, $sd_id)
164
+ {
165
+ $resource = Mage::getSingleton('core/resource');
166
+ $db_read = $resource->getConnection('core_read');
167
+ $sd_users = $resource->getTableName('sd_users');
168
+ $rq_sql = '
169
+ SELECT `last_call_date`
170
+ FROM `' . $sd_users . '`
171
+ WHERE `sd_id` = ' . $db_read->quote($sd_id) . '
172
+ AND `list_id` = ' . $db_read->quote($store_id . $list_type);
173
+ $last_call_date = $db_read->fetchOne($rq_sql);
174
+ if ($last_call_date == null || $last_call_date == '') {
175
+ $last_call_date = false;
176
+ }
177
+ $line = 'email;lastname;firstname';
178
+ if ($list_type == 'C') {
179
+ if ($this->checkIfListWithCustomerData('C', $store_id)) {
180
+ $line .= ';date_first_order;date_last_order;amount_min_order;amount_max_order;amount_avg_order;nb_orders;amount_all_orders';
181
+ }
182
+ }
183
+ $line .= ';action' . "\n";
184
+ echo $line;
185
+ $this->processNewUnsubscribers($list_type, $store_id, $last_call_date, 'display');
186
+ $this->processNewSubscribers($list_type, $store_id, $last_call_date, 'display');
187
+ }
188
+
189
+ private function checkIfListWithCustomerData($list_type, $store_id)
190
+ {
191
+ $sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
192
+ if (in_array($store_id . $list_type . '1', $sd_list_array)) {
193
+ return true;
194
+ }
195
+ return false;
196
+ }
197
+
198
+ private function getFormattedContentShops($sd_id)
199
+ {
200
+ $shops = Mage::helper('mailify')->getShopsArray();
201
+ echo 'list_id;name;reset;is_updated;type;version' . "\n";
202
+ $sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
203
+ foreach ($sd_list_array as $list) {
204
+ foreach ($shops as $shop) {
205
+ $store_id = Mage::helper('mailify')->getIdShopFromList($list);
206
+ $list_type = Mage::helper('mailify')->getListTypeFromList($list);
207
+ if ($shop['store_id'] == $store_id) {
208
+ $shop_list = $store_id . $list_type . ';' . $this->dQuote($shop['name']) . ';';
209
+ $shop_list .= $this->listStatus($store_id, $list_type, $sd_id) . ';';
210
+ $shop_list .= 'Magento;1.0.0.8' . "\n";//
211
+ echo $shop_list;
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ private function listStatus($store_id, $list_type, $sd_id)
218
+ {
219
+ $resource = Mage::getSingleton('core/resource');
220
+ $db_read = $resource->getConnection('core_read');
221
+ $sd_users = $resource->getTableName('sd_users');
222
+ $list_is_resetted = 'Y';
223
+ $list_is_updated = 'N';
224
+ $last_call_date = false;
225
+ if ( ! isset($this->sd_used_lists)) {
226
+ $rq_sql = '
227
+ SELECT `sd_id`, `list_id`, `last_call_date`
228
+ FROM `' . $sd_users . '`';
229
+ $this->sd_used_lists = $db_read->fetchAll($rq_sql);
230
+ }
231
+ if (is_array($this->sd_used_lists)) {
232
+ foreach ($this->sd_used_lists as $r) {
233
+ if ($r['sd_id'] == $sd_id && $r['list_id'] == $store_id . $list_type) {
234
+ $list_is_resetted = 'N';
235
+ $last_call_date = $r['last_call_date'];
236
+ if ($last_call_date == null || $last_call_date == '') {
237
+ $last_call_date = false;
238
+ }
239
+ break;
240
+ }
241
+ }
242
+ }
243
+ if ($this->processNewUnsubscribers($list_type, $store_id, $last_call_date, 'is_updated') > 0) {
244
+ $list_is_updated = 'Y';
245
+ } else if ($this->processNewSubscribers($list_type, $store_id, $last_call_date, 'is_updated') > 0) {
246
+ $list_is_updated = 'Y';
247
+ }
248
+ return $list_is_resetted . ';' . $list_is_updated;
249
+ }
250
+
251
+ private function dQuote($value)
252
+ {
253
+ $value = str_replace('"', '""', $value);
254
+ if (strpos($value, ' ') !== false || strpos($value, ';') !== false) {
255
+ $value = '"' . $value . '"';
256
+ }
257
+ return $value;
258
+ }
259
+
260
+ private function processNewSubscribers($list_type, $store_id, $last_call_date, $type_action = 'display')
261
+ {
262
+ $resource = Mage::getSingleton('core/resource');
263
+ $db_read = $resource->getConnection('core_read');
264
+ $sd_updates = $resource->getTableName('sd_updates');
265
+ $newsletter_subscriber = $resource->getTableName('newsletter_subscriber');
266
+ $sales_flat_order = $resource->getTableName('sales_flat_order');
267
+ $customer_entity = $resource->getTableName('customer_entity');
268
+ $customer_entity_varchar = $resource->getTableName('customer_entity_varchar');
269
+ $attr_firstname = Mage::getModel('customer/customer')->getAttribute('firstname')->getAttributeId();
270
+ $attr_lastname = Mage::getModel('customer/customer')->getAttribute('lastname')->getAttributeId();
271
+ if ($list_type == 'N') {
272
+ $rq_sql_select = '
273
+ SELECT `ns`.`subscriber_email` AS `email`,
274
+ IFNULL(`lastname`.`value`, SUBSTRING_INDEX(GROUP_CONCAT(`sfo`.`customer_lastname` ORDER BY `sfo`.`updated_at` DESC SEPARATOR \'||\'), \'||\', 1)) AS `lastname`,
275
+ IFNULL(`firstname`.`value`, SUBSTRING_INDEX(GROUP_CONCAT(`sfo`.`customer_firstname` ORDER BY `sfo`.`updated_at` DESC SEPARATOR \'||\'), \'||\', 1)) AS `firstname`';
276
+ $rq_sql_from = '
277
+ LEFT JOIN `' . $customer_entity . '` AS `c`
278
+ ON `c`.`email` = `ns`.`subscriber_email`
279
+ AND `c`.`store_id` = `ns`.`store_id`
280
+ AND `c`.`website_id` != 0
281
+ LEFT JOIN `' . $customer_entity_varchar . '` AS `lastname`
282
+ ON `lastname`.`entity_id` = `c`.`entity_id`
283
+ AND `lastname`.`attribute_id` = ' . (int)$attr_lastname . '
284
+ LEFT JOIN `' . $customer_entity_varchar . '` AS `firstname`
285
+ ON `firstname`.`entity_id` = `c`.`entity_id`
286
+ AND `firstname`.`attribute_id` = ' . (int)$attr_firstname . '
287
+ LEFT JOIN `' . $sales_flat_order . '` AS `sfo`
288
+ ON `sfo`.`customer_email` = `ns`.`subscriber_email`
289
+ AND `sfo`.`store_id` = `ns`.`store_id`';
290
+ $rq_sql_group_by = '
291
+ GROUP BY `ns`.`subscriber_email`';
292
+ if ( ! $last_call_date) {
293
+ $rq_sql =
294
+ $rq_sql_select . '
295
+ FROM `' . $newsletter_subscriber . '` AS `ns`
296
+ ' . $rq_sql_from . '
297
+ WHERE `ns`.`subscriber_status` = 1
298
+ AND `ns`.`store_id` = ' . (int)$store_id .
299
+ $rq_sql_group_by;
300
+ } else {
301
+ $rq_sql =
302
+ $rq_sql_select . '
303
+ FROM `' . $sd_updates . '` AS `s`
304
+ INNER JOIN `' . $newsletter_subscriber . '` AS `ns`
305
+ ON `ns`.`subscriber_email` = `s`.`email`
306
+ AND `ns`.`store_id` = `s`.`store_id`
307
+ AND `ns`.`subscriber_status` = 1
308
+ ' . $rq_sql_from . '
309
+ WHERE `s`.`update_date` >= ' . $db_read->quote($last_call_date) . '
310
+ AND `s`.`list_type` = \'N\'
311
+ AND `s`.`store_id` = ' . (int)$store_id .
312
+ $rq_sql_group_by;
313
+ }
314
+ } else if ($list_type == 'C') {
315
+ $add_customer_data = $this->checkIfListWithCustomerData('C', $store_id);
316
+ if ($add_customer_data) {
317
+ $rq_sql_select = '
318
+ SELECT `t`.`email`, `t`.`lastname`, `t`.`firstname`,
319
+ MIN(`t`.`date_first_order`) AS `date_first_order`, MAX(`t`.`date_last_order`) AS `date_last_order`,
320
+ MIN(`t`.`amount_min_order`) AS `amount_min_order`, MAX(`t`.`amount_max_order`) AS `amount_max_order`,
321
+ ROUND(SUM(`t`.`amount_all_orders`)/SUM(`t`.`nb_orders`), 6) AS `amount_avg_order`, SUM(`t`.`nb_orders`) AS `nb_orders`,
322
+ SUM(`t`.`amount_all_orders`) AS `amount_all_orders`
323
+ FROM
324
+ (';
325
+ $rq_sql_select_table_1 = '
326
+ SELECT `c`.`email`, `lastname`.`value` AS `lastname`, `firstname`.`value` AS `firstname`,
327
+ MIN(`sfo`.`created_at`) AS `date_first_order`, MAX(`sfo`.`created_at`) AS `date_last_order`,
328
+ MIN(`sfo`.`base_grand_total`) AS `amount_min_order`, MAX(`sfo`.`base_grand_total`) AS `amount_max_order`,
329
+ COUNT(`sfo`.`created_at`) AS `nb_orders`, SUM(`sfo`.`base_grand_total`) AS `amount_all_orders`';
330
+ $rq_sql_select_table_2 = '
331
+ SELECT `sfo`.`customer_email` AS `email`,
332
+ SUBSTRING_INDEX(GROUP_CONCAT(`sfo`.`customer_lastname` ORDER BY `sfo`.`updated_at` DESC SEPARATOR \'||\'), \'||\', 1) AS `lastname`,
333
+ SUBSTRING_INDEX(GROUP_CONCAT(`sfo`.`customer_firstname` ORDER BY `sfo`.`updated_at` DESC SEPARATOR \'||\'), \'||\', 1) AS `firstname`,
334
+ MIN(`sfo`.`created_at`) AS `date_first_order`, MAX(`sfo`.`created_at`) AS `date_last_order`,
335
+ MIN(`sfo`.`base_grand_total`) AS `amount_min_order`, MAX(`sfo`.`base_grand_total`) AS `amount_max_order`,
336
+ COUNT(`sfo`.`created_at`) AS `nb_orders`, SUM(`sfo`.`base_grand_total`) AS `amount_all_orders`';
337
+ $rq_sql_from = '
338
+ INNER JOIN `' . $customer_entity_varchar . '` AS `lastname`
339
+ ON `lastname`.`entity_id` = `c`.`entity_id`
340
+ AND `lastname`.`attribute_id` = 7
341
+ INNER JOIN `' . $customer_entity_varchar . '` AS `firstname`
342
+ ON `firstname`.`entity_id` = `c`.`entity_id`
343
+ AND `firstname`.`attribute_id` = 5
344
+ LEFT JOIN `' . $sales_flat_order . '` AS `sfo`
345
+ ON `sfo`.`customer_id` = `c`.`entity_id`
346
+ AND `sfo`.`store_id` = `c`.`store_id`';
347
+ $rq_sql_group_by = '
348
+ ) AS `t`
349
+ GROUP BY `t`.`email`';
350
+ } else {
351
+ $rq_sql_select = '
352
+ SELECT `t`.`email`, `t`.`lastname`, `t`.`firstname`
353
+ FROM
354
+ (';
355
+ $rq_sql_select_table_1 = '
356
+ SELECT `c`.`email`, `lastname`.`value` AS `lastname`, `firstname`.`value` AS `firstname`';
357
+ $rq_sql_select_table_2 = '
358
+ SELECT `sfo`.`customer_email` AS `email`,
359
+ SUBSTRING_INDEX(GROUP_CONCAT(`sfo`.`customer_lastname` ORDER BY `sfo`.`updated_at` DESC SEPARATOR \'||\'), \'||\', 1) AS `lastname`,
360
+ SUBSTRING_INDEX(GROUP_CONCAT(`sfo`.`customer_firstname` ORDER BY `sfo`.`updated_at` DESC SEPARATOR \'||\'), \'||\', 1) AS `firstname`';
361
+ $rq_sql_from = '
362
+ INNER JOIN `' . $customer_entity_varchar . '` AS `lastname`
363
+ ON `lastname`.`entity_id` = `c`.`entity_id`
364
+ AND `lastname`.`attribute_id` = 7
365
+ INNER JOIN `' . $customer_entity_varchar . '` AS `firstname`
366
+ ON `firstname`.`entity_id` = `c`.`entity_id`
367
+ AND `firstname`.`attribute_id` = 5';
368
+ $rq_sql_group_by = '
369
+ ) AS `t`
370
+ GROUP BY `t`.`email`';
371
+ }
372
+ if ( ! $last_call_date) {
373
+ $rq_sql =
374
+ $rq_sql_select . '
375
+ (
376
+ ' . $rq_sql_select_table_1 . '
377
+ FROM `' . $customer_entity . '` AS `c`
378
+ ' . $rq_sql_from . '
379
+ WHERE `c`.`store_id` = ' . (int)$store_id . '
380
+ AND `c`.`website_id` != 0
381
+ GROUP BY `c`.`email`
382
+ )
383
+ UNION ALL
384
+ (
385
+ ' . $rq_sql_select_table_2 . '
386
+ FROM `' . $sales_flat_order . '` AS `sfo`
387
+ LEFT JOIN `' . $customer_entity . '` AS `c`
388
+ ON `c`.`entity_id` = `sfo`.`customer_id`
389
+ AND `c`.`store_id` = `sfo`.`store_id`
390
+ AND `c`.`website_id` != 0
391
+ WHERE `c`.`entity_id` IS NULL
392
+ AND `sfo`.`store_id` = ' . (int)$store_id . '
393
+ GROUP BY `sfo`.`customer_email`
394
+ )' .
395
+ $rq_sql_group_by;
396
+ } else {
397
+ $rq_sql =
398
+ $rq_sql_select . '
399
+ (
400
+ ' . $rq_sql_select_table_1 . '
401
+ FROM `' . $sd_updates . '` AS `s`
402
+ INNER JOIN `' . $customer_entity . '` AS `c`
403
+ ON `c`.`email` = `s`.`email`
404
+ AND `c`.`store_id` = `s`.`store_id`
405
+ AND `c`.`website_id` != 0
406
+ ' . $rq_sql_from . '
407
+ WHERE `s`.`store_id` = ' . (int)$store_id . '
408
+ AND `s`.`list_type` = \'C\'
409
+ AND `s`.`update_date` >= ' . $db_read->quote($last_call_date) . '
410
+ GROUP BY `c`.`email`
411
+ )
412
+ UNION ALL
413
+ (
414
+ ' . $rq_sql_select_table_2 . '
415
+ FROM `' . $sd_updates . '` AS `s`
416
+ INNER JOIN `' . $sales_flat_order . '` AS `sfo`
417
+ ON `sfo`.`customer_email` = `s`.`email`
418
+ AND `sfo`.`store_id` = `s`.`store_id`
419
+ LEFT JOIN `' . $customer_entity . '` AS `c`
420
+ ON `c`.`entity_id` = `sfo`.`customer_id`
421
+ AND `c`.`store_id` = `s`.`store_id`
422
+ AND `c`.`website_id` != 0
423
+ WHERE `c`.`entity_id` IS NULL
424
+ AND `s`.`store_id` = ' . (int)$store_id . '
425
+ AND `s`.`list_type` = \'C\'
426
+ AND `s`.`update_date` >= ' . $db_read->quote($last_call_date) . '
427
+ GROUP BY `sfo`.`customer_email`
428
+ )' .
429
+ $rq_sql_group_by;
430
+ }
431
+ } else {
432
+ if ($type_action == 'is_updated') {
433
+ return 0;
434
+ } else {
435
+ return;
436
+ }
437
+ }
438
+ $rq = $db_read->query($rq_sql);
439
+ while ($r = $rq->fetch()) {
440
+ if ($type_action == 'is_updated') {
441
+ return 1;
442
+ }
443
+ $line = $this->dQuote($r['email']) . ';';
444
+ $line .= $this->dQuote($r['lastname']) . ';' . $this->dQuote($r['firstname']);
445
+ if ($list_type == 'C') {
446
+ if ($add_customer_data) {
447
+ $line .= ';' . $this->dQuote($r ['date_first_order']) . ';' . $this->dQuote($r['date_last_order']);
448
+ $line .= ';' . (float)$r['amount_min_order'] . ';' . (float)$r['amount_max_order'] . ';' . (float)$r['amount_avg_order'];
449
+ $line .= ';' . $r['nb_orders'] . ';' . (float)$r['amount_all_orders'];
450
+ }
451
+ }
452
+ $line .= ';S' . "\n";
453
+ echo $line;
454
+ }
455
+ }
456
+
457
+ private function processNewUnsubscribers($list_type, $store_id, $last_call_date, $type_action = 'display')
458
+ {
459
+ $resource = Mage::getSingleton('core/resource');
460
+ $db_read = $resource->getConnection('core_read');
461
+ $sd_updates = $resource->getTableName('sd_updates');
462
+ if ($last_call_date !== false && ($list_type == 'N' || $list_type == 'C')) {
463
+ $rq_sql = '
464
+ SELECT `email`
465
+ FROM `' . $sd_updates . '`
466
+ WHERE `list_type` = ' . $db_read->quote($list_type) . '
467
+ AND `store_id` = ' . (int)$store_id . '
468
+ AND `action` = \'U\'
469
+ AND `update_date` >= ' . $db_read->quote($last_call_date);
470
+ $rq = $db_read->query($rq_sql);
471
+ while ($r = $rq->fetch()) {
472
+ if ($type_action == 'is_updated') {
473
+ return 1;
474
+ }
475
+ $line = $this->dQuote($r['email']) . ';;';
476
+ if ($list_type == 'C') {
477
+ if ($this->checkIfListWithCustomerData('C', $store_id)) {
478
+ $line .= ';;;;;;;;';
479
+ }
480
+ }
481
+ $line .= ';U' . "\n";
482
+ echo $line;
483
+ }
484
+ }
485
+ else {
486
+ if ($type_action == 'is_updated') {
487
+ return 0;
488
+ }
489
+ }
490
+ }
491
+
492
+ private function clearHistory($list_type, $store_id)
493
+ {
494
+ $resource = Mage::getSingleton('core/resource');
495
+ $db_write = $resource->getConnection('core_write');
496
+ $sd_updates = $resource->getTableName('sd_updates');
497
+ $sd_users = $resource->getTableName('sd_users');
498
+ $rq_sql = '
499
+ DELETE
500
+ FROM `' . $sd_updates . '`
501
+ WHERE `store_id` = ' . (int)$store_id . '
502
+ AND `list_type` = ' . $db_write->quote($list_type) . '
503
+ AND `update_date` <= (
504
+ SELECT MIN(`last_call_date`)
505
+ FROM `' . $sd_users . '`
506
+ WHERE `list_id` = ' . $db_write->quote($store_id . $list_type) . '
507
+ )';
508
+ $db_write->query($rq_sql);
509
+ $rq_sql = '
510
+ DELETE
511
+ FROM `' . $sd_updates . '`
512
+ WHERE `update_date` <= (
513
+ SELECT MIN(`last_call_date`)
514
+ FROM `' . $sd_users . '`
515
+ )';
516
+ $db_write->query($rq_sql);
517
+ }
518
+
519
+ }
app/code/community/Sarbacane/Mailify/etc/config.xml CHANGED
@@ -21,128 +21,142 @@
21
  */
22
  -->
23
  <config>
24
- <modules>
25
- <Sarbacane_Mailify>
26
- <version>1.0.0.7</version>
27
- </Sarbacane_Mailify>
28
- </modules>
29
- <frontend>
30
- <routers>
31
- <sarbacanedesktop>
32
- <use>standard</use>
33
- <args>
34
- <module>Sarbacane_Mailify</module>
35
- <frontName>sarbacanedesktop</frontName>
36
- </args>
37
- </sarbacanedesktop>
38
- </routers>
39
- <!--
40
- <layout>
41
- <updates>
42
- <sarbacanedesktop>
43
- <file>sarbacanedesktop.xml</file>
44
- </sarbacanedesktop>
45
- </updates>
46
- </layout>
47
- -->
48
- </frontend>
49
- <admin>
50
- <routers>
51
- <adminhtml>
52
- <args>
53
- <modules>
54
- <mailify before="Mage_Adminhtml">Sarbacane_Mailify_Adminhtml</mailify>
55
- </modules>
56
- </args>
57
- </adminhtml>
58
- </routers>
59
- <!--
60
- <routers>
61
- <sarbacanedesktop>
62
- <use>admin</use>
63
- <args>
64
- <module>Sarbacane_Sarbacanedesktop</module>
65
- <frontName>sarbacanedesktop</frontName>
66
- </args>
67
- </sarbacanedesktop>
68
- </routers>
69
- -->
70
- </admin>
71
- <adminhtml>
72
- <menu>
73
- <newsletter>
74
- <children>
75
- <items module="mailify" translate="title">
76
- <title>Mailify</title>
77
- <sort_order>120</sort_order>
78
- <action>adminhtml/mailify</action>
79
- </items>
80
- </children>
81
- </newsletter>
82
- </menu>
83
- <acl>
84
- <resources>
85
- <admin>
86
- <children>
87
- <newsletter>
88
- <children>
89
- <mailify translate="title">
90
- <title>Mailify</title>
91
- <sort_order>120</sort_order>
92
- </mailify>
93
- </children>
94
- </newsletter>
95
- </children>
96
- </admin>
97
- </resources>
98
- </acl>
99
- <layout>
100
- <updates>
101
- <mailify>
102
- <file>mailify.xml</file>
103
- </mailify>
104
- </updates>
105
- </layout>
106
- <translate>
107
- <modules>
108
- <Sarbacane_Mailify>
109
- <files>
110
- <default>Sarbacane_Mailify.csv</default>
111
- </files>
112
- </Sarbacane_Mailify>
113
- </modules>
114
- </translate>
115
- </adminhtml>
116
- <global>
117
- <helpers>
118
- <mailify>
119
- <class>Sarbacane_Mailify_Helper</class>
120
- </mailify>
121
- </helpers>
122
- <blocks>
123
- <mailify>
124
- <class>Sarbacane_Mailify_Block</class>
125
- </mailify>
126
- </blocks>
127
- <resources>
128
- <mailify_setup>
129
- <setup>
130
- <module>Sarbacane_Mailify</module>
131
- </setup>
132
- <connection>
133
- <use>core_setup</use>
134
- </connection>
135
- </mailify_setup>
136
- <mailify_write>
137
- <connection>
138
- <use>core_write</use>
139
- </connection>
140
- </mailify_write>
141
- <mailify_read>
142
- <connection>
143
- <use>core_read</use>
144
- </connection>
145
- </mailify_read>
146
- </resources>
147
- </global>
148
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  */
22
  -->
23
  <config>
24
+ <modules>
25
+ <Sarbacane_Mailify>
26
+ <version>1.0.0.8</version>
27
+ </Sarbacane_Mailify>
28
+ </modules>
29
+ <frontend>
30
+ <routers>
31
+ <mailify>
32
+ <use>standard</use>
33
+ <args>
34
+ <module>Sarbacane_Mailify</module>
35
+ <frontName>sarbacanedesktop</frontName>
36
+ </args>
37
+ </mailify>
38
+ </routers>
39
+ </frontend>
40
+ <admin>
41
+ <routers>
42
+ <adminhtml>
43
+ <args>
44
+ <modules>
45
+ <mailify before="Mage_Adminhtml">Sarbacane_Mailify_Adminhtml</mailify>
46
+ </modules>
47
+ </args>
48
+ </adminhtml>
49
+ </routers>
50
+ </admin>
51
+ <adminhtml>
52
+ <menu>
53
+ <newsletter>
54
+ <children>
55
+ <mailify module="mailify" translate="title">
56
+ <title>Mailify</title>
57
+ <sort_order>120</sort_order>
58
+ <action>adminhtml/mailify</action>
59
+ </mailify>
60
+ </children>
61
+ </newsletter>
62
+ </menu>
63
+ <acl>
64
+ <resources>
65
+ <admin>
66
+ <children>
67
+ <newsletter>
68
+ <children>
69
+ <mailify translate="title">
70
+ <title>Mailify</title>
71
+ <sort_order>120</sort_order>
72
+ </mailify>
73
+ </children>
74
+ </newsletter>
75
+ </children>
76
+ </admin>
77
+ </resources>
78
+ </acl>
79
+ <layout>
80
+ <updates>
81
+ <mailify>
82
+ <file>mailify.xml</file>
83
+ </mailify>
84
+ </updates>
85
+ </layout>
86
+ <translate>
87
+ <modules>
88
+ <Sarbacane_Mailify>
89
+ <files>
90
+ <default>Sarbacane_Mailify.csv</default>
91
+ </files>
92
+ </Sarbacane_Mailify>
93
+ </modules>
94
+ </translate>
95
+ </adminhtml>
96
+ <global>
97
+ <events>
98
+ <customer_save_before>
99
+ <observers>
100
+ <mailify_customer_save>
101
+ <class>Sarbacane_Mailify_Model_Observer</class>
102
+ <method>customerSave</method>
103
+ </mailify_customer_save>
104
+ </observers>
105
+ </customer_save_before>
106
+ <customer_delete_before>
107
+ <observers>
108
+ <mailify_customer_delete>
109
+ <class>Sarbacane_Mailify_Model_Observer</class>
110
+ <method>customerDelete</method>
111
+ </mailify_customer_delete>
112
+ </observers>
113
+ </customer_delete_before>
114
+ <newsletter_subscriber_save_before>
115
+ <observers>
116
+ <mailify_newsletter_subscriber_save>
117
+ <class>Sarbacane_Mailify_Model_Observer</class>
118
+ <method>newsletterSubscriberSave</method>
119
+ </mailify_newsletter_subscriber_save>
120
+ </observers>
121
+ </newsletter_subscriber_save_before>
122
+ <newsletter_subscriber_delete_before>
123
+ <observers>
124
+ <mailify_newsletter_subscriber_delete>
125
+ <class>Sarbacane_Mailify_Model_Observer</class>
126
+ <method>newsletterSubscriberDelete</method>
127
+ </mailify_newsletter_subscriber_delete>
128
+ </observers>
129
+ </newsletter_subscriber_delete_before>
130
+ </events>
131
+ <helpers>
132
+ <mailify>
133
+ <class>Sarbacane_Mailify_Helper</class>
134
+ </mailify>
135
+ </helpers>
136
+ <blocks>
137
+ <mailify>
138
+ <class>Sarbacane_Mailify_Block</class>
139
+ </mailify>
140
+ </blocks>
141
+ <resources>
142
+ <mailify_setup>
143
+ <setup>
144
+ <module>Sarbacane_Mailify</module>
145
+ </setup>
146
+ <connection>
147
+ <use>core_setup</use>
148
+ </connection>
149
+ </mailify_setup>
150
+ <mailify_write>
151
+ <connection>
152
+ <use>core_write</use>
153
+ </connection>
154
+ </mailify_write>
155
+ <mailify_read>
156
+ <connection>
157
+ <use>core_read</use>
158
+ </connection>
159
+ </mailify_read>
160
+ </resources>
161
+ </global>
162
+ </config>
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-install-1.0.0.0.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Sarbacanedesktop
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
-
22
- $installer = $this;
23
- $installer->startSetup();
24
-
25
- $installer->run("
26
- DROP TABLE IF EXISTS `{$this->getTable('sarbacanedesktop')}`;
27
- DROP TABLE IF EXISTS `{$this->getTable('sarbacanedesktop_users')}`;
28
-
29
- CREATE TABLE `{$this->getTable('sarbacanedesktop')}` (
30
- `email` varchar(150) NOT NULL,
31
- `list_type` varchar(20) NOT NULL,
32
- `store_id` varchar(20) NOT NULL,
33
- `sd_id` varchar(20) NOT NULL,
34
- `lastname` varchar(150) NOT NULL,
35
- `firstname` varchar(150) NOT NULL,
36
- `orders_data` varchar(150) NOT NULL,
37
- PRIMARY KEY(`email`,`store_id`,`list_type`,`sd_id`)
38
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
39
-
40
- CREATE TABLE `{$this->getTable('sarbacanedesktop_users')}` (
41
- `sd_id` int(20) unsigned NOT NULL AUTO_INCREMENT,
42
- `sd_type` varchar(20) NOT NULL,
43
- `sd_value` varchar(200) NOT NULL,
44
- PRIMARY KEY(`sd_id`)
45
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
46
-
47
- INSERT INTO `{$this->getTable('sarbacanedesktop_users')}` (`sd_type`, `sd_value`) VALUES
48
- ('sd_token', ''),
49
- ('sd_list', '');
50
-
51
- ");
52
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.0-1.0.0.1.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Sarbacanedesktop
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
-
22
- $installer = $this;
23
- $installer->startSetup();
24
-
25
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.1-1.0.0.2.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Sarbacanedesktop
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
-
22
- $installer = $this;
23
- $installer->startSetup();
24
-
25
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.2-1.0.0.3.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Sarbacanedesktop
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
-
22
- $installer = $this;
23
- $installer->startSetup();
24
-
25
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.3-1.0.0.4.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Sarbacanedesktop
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
-
22
- $installer = $this;
23
- $installer->startSetup();
24
-
25
- $installer->run("DROP TABLE IF EXISTS `{$this->getTable('sarbacanedesktop')}`;");
26
- $installer->run("DROP TABLE IF EXISTS `{$this->getTable('sd_updates')}`;");
27
-
28
- $installer->run("ALTER TABLE `{$this->getTable('sarbacanedesktop_users')}` ADD COLUMN `list_id` VARCHAR(50) NULL DEFAULT NULL AFTER `sd_value`;");
29
- $installer->run("ALTER TABLE `{$this->getTable('sarbacanedesktop_users')}` ADD COLUMN `last_call_date` VARCHAR(50) NULL DEFAULT NULL AFTER `list_id`;");
30
-
31
- $installer->run("
32
- CREATE TABLE `{$this->getTable('sd_updates')}` (
33
- `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
34
- `email` VARCHAR(50) NOT NULL COLLATE 'utf8_bin',
35
- `update_time` DATETIME NOT NULL,
36
- `action` VARCHAR(5) NOT NULL COLLATE 'utf8_bin',
37
- `list_type` VARCHAR(10) NULL DEFAULT NULL COLLATE 'utf8_bin',
38
- PRIMARY KEY (`id`),
39
- INDEX `update_time_action` (`update_time`, `action`)
40
- )
41
- COMMENT='Contains useful data used by SD/MF plugin'
42
- COLLATE='utf8_bin'
43
- ENGINE=InnoDB
44
- ;");
45
-
46
- $installer->run("DROP TRIGGER IF EXISTS sd_newsletter_update;");
47
- $installer->run("DROP TRIGGER IF EXISTS sd_customer_delete;");
48
-
49
- $write = Mage::getSingleton('core/resource')->getConnection('core_write');
50
-
51
- $sql= "
52
- CREATE TRIGGER `sd_newsletter_update`
53
- AFTER UPDATE ON `{$this->getTable('newsletter_subscriber')}`
54
- FOR EACH ROW BEGIN
55
- DELETE FROM {$this->getTable('sd_updates')} WHERE email=NEW.subscriber_email AND list_type='N';
56
- IF NEW.subscriber_status = 1 THEN
57
- INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'S','N');
58
- ELSE
59
- INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'U','N');
60
- END IF;
61
- END;";
62
- $write->exec($sql);
63
-
64
- $sql= "
65
- CREATE TRIGGER `sd_newsletter_insert`
66
- AFTER INSERT ON `{$this->getTable('newsletter_subscriber')}`
67
- FOR EACH ROW BEGIN
68
- DELETE FROM {$this->getTable('sd_updates')} WHERE email=NEW.subscriber_email AND list_type='N';
69
- IF NEW.subscriber_status = 1 THEN
70
- INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'S','N');
71
- ELSE
72
- INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'U','N');
73
- END IF;
74
- END;";
75
- $write->exec($sql);
76
-
77
- $sql = "
78
- CREATE TRIGGER `sd_customer_delete`
79
- BEFORE DELETE ON `{$this->getTable('customer_entity')}`
80
- FOR EACH ROW BEGIN
81
- DELETE FROM {$this->getTable('sd_updates')} WHERE email=OLD.email AND list_type='C';
82
- INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (OLD.email,UTC_TIMESTAMP(),'U','C');
83
- END";
84
- $write->exec($sql);
85
-
86
-
87
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.7-1.0.0.8.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Mailify
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+
25
+ try{
26
+ $installer->run("DROP TRIGGER IF EXISTS sd_newsletter_update;");
27
+ }
28
+ catch(Exception $e) {}
29
+ try{
30
+ $installer->run("DROP TRIGGER IF EXISTS sd_newsletter_insert;");
31
+ }
32
+ catch(Exception $e) {}
33
+ try{
34
+ $installer->run("DROP TRIGGER IF EXISTS sd_customer_delete;");
35
+ }
36
+ catch(Exception $e) {}
37
+
38
+ $installer->run("
39
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('sarbacanedesktop_users')}` (
40
+ `sd_type` varchar(20) NOT NULL,
41
+ `sd_value` varchar(200) NOT NULL,
42
+ PRIMARY KEY(`sd_type`)
43
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
44
+ ");
45
+
46
+ $db_read = Mage::getSingleton('core/resource')->getConnection('core_read');
47
+ $sd_token = '';
48
+ $sd_list = '';
49
+ $sd_is_user = '';
50
+ $sd_nb_failed = '';
51
+ $sd_last_update = '';
52
+
53
+ $rq_sql = "
54
+ SELECT `sd_type`, `sd_value`
55
+ FROM `{$this->getTable('sarbacanedesktop_users')}`
56
+ WHERE `sd_type` IN ('sd_token', 'sd_list');";
57
+ $rq = $db_read->query($rq_sql);
58
+ while ($r = $rq->fetch()) {
59
+ if ($r['sd_type'] == 'sd_token') {
60
+ $sd_token = $r['sd_value'];
61
+ } else if ($r['sd_type'] == 'sd_list') {
62
+ $sd_list = $r['sd_value'];
63
+ }
64
+ }
65
+
66
+ if ($sd_token != '' || $sd_list != '') {
67
+ $sd_is_user = 'yes';
68
+ }
69
+
70
+ $installer->run("
71
+ DROP TABLE IF EXISTS `{$this->getTable('sarbacanedesktop')}`;
72
+
73
+ DROP TABLE IF EXISTS `{$this->getTable('sarbacanedesktop_users')}`;
74
+
75
+ DROP TABLE IF EXISTS `{$this->getTable('sd_updates')}`;
76
+
77
+ DROP TABLE IF EXISTS `{$this->getTable('sd_users')}`;
78
+
79
+ DROP TABLE IF EXISTS `{$this->getTable('sd_data')}`;
80
+
81
+ CREATE TABLE `{$this->getTable('sd_updates')}` (
82
+ `email` varchar(50) NOT NULL,
83
+ `store_id` int(11) unsigned NOT NULL,
84
+ `list_type` varchar(10) NOT NULL,
85
+ `action` varchar(5) NOT NULL,
86
+ `update_date` datetime NOT NULL,
87
+ PRIMARY KEY (`email`, `store_id`, `list_type`)
88
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
89
+
90
+ CREATE TABLE `{$this->getTable('sd_users')}` (
91
+ `sd_id` varchar(200) NOT NULL,
92
+ `list_id` varchar(50) NOT NULL,
93
+ `last_call_date` datetime NOT NULL,
94
+ PRIMARY KEY(`sd_id`, `list_id`)
95
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
96
+
97
+ CREATE TABLE `{$this->getTable('sd_data')}` (
98
+ `sd_type` varchar(20) NOT NULL,
99
+ `sd_value` varchar(200) NOT NULL,
100
+ PRIMARY KEY(`sd_type`)
101
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
102
+
103
+ INSERT INTO `{$this->getTable('sd_data')}`
104
+ (`sd_type`, `sd_value`)
105
+ VALUES
106
+ ('sd_token', {$db_read->quote($sd_token)}),
107
+ ('sd_list', {$db_read->quote($sd_list)}),
108
+ ('sd_is_user', {$db_read->quote($sd_is_user)}),
109
+ ('sd_nb_failed', {$db_read->quote($sd_nb_failed)}),
110
+ ('sd_last_update', {$db_read->quote($sd_last_update)});
111
+ ");
112
+
113
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/mailify.xml CHANGED
@@ -21,9 +21,9 @@
21
  */
22
  -->
23
  <layout>
24
- <adminhtml_mailify_index>
25
- <reference name="content">
26
- <block type="mailify/adminhtml_mailify" name="mailify" template="mailify/mailify.phtml"/>
27
- </reference>
28
- </adminhtml_mailify_index>
29
- </layout>
21
  */
22
  -->
23
  <layout>
24
+ <adminhtml_mailify_index>
25
+ <reference name="content">
26
+ <block type="mailify/adminhtml_mailify" name="mailify" template="mailify/mailify.phtml"/>
27
+ </reference>
28
+ </adminhtml_mailify_index>
29
+ </layout>
app/design/adminhtml/default/default/template/mailify/mailify.phtml CHANGED
@@ -18,249 +18,265 @@
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
21
- $key_for_synchronisation = $this->getKeyForSynchronisation ();
22
- $list_configuration = $this->getListConfiguration ();
23
- $general_configuration = $this->getGeneralConfiguration ();
24
- $stores_array = $this->getStoresArray ();
 
 
 
25
  ?>
26
- <link rel="stylesheet" type="text/css" href="<?=$this->getSkinUrl('css/Sarbacane_Mailify/mailify.css')?>" />
27
- <script type="text/javascript" src="<?=$this->getSkinUrl('js/Sarbacane_Mailify/mailify.js')?>"></script>
28
- <div id="sarbacanedesktop">
29
- <div class="sd_header">
30
- <div class="sd_logo_<?=$this->__('mailify') ?>"></div>
31
- </div>
32
- <p class="sd_title"><?=$this->__('It\'s easy to manage your newsletter and email campaigns')?></p>
33
- <div class="sd_title_separator_page"></div>
34
- <div class="sd_video_config_container">
35
- <div class="sd_video_container">
36
- <iframe width="565" height="315" src="<?=$this->__('https://www.youtube.com/embed/eLMy2tSSYgE')?>?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
37
- </div>
38
- <div class="sd_config_container">
39
- <p><?=$this->__('This Magento module enables you to synchronize clients and accounts that have subscribed to your newsletter from your shop online using Mailify\'s email marketing software.')?></p>
40
- <p>
41
- <input type="button" onclick="document.location = '#sd_step'" class="sd_config_button" value="<?=$this->__('Begin the set-up')?>" />
42
- </p>
43
- </div>
44
- </div>
45
- <div class="sd_separator"></div>
46
- <div class="sd_detail_description_container">
47
- <div>
48
- <div>
49
- <div>
50
- <div class="sd_picto1"></div>
51
- <p class="sd_long_subtitle"><?=$this->__('Synchronization of your shop data')?></p>
52
- </div>
53
- </div>
54
- <div>
55
- <div>
56
- <div class="sd_picto2"></div>
57
- <p class="sd_long_subtitle"><?=$this->__('Responsive visual editor')?></p>
58
- </div>
59
- </div>
60
- <div>
61
- <div>
62
- <div class="sd_picto3"></div>
63
- <p class="sd_short_subtitle"><?=$this->__('Detailed statistics')?></p>
64
- </div>
65
- </div>
66
- <div>
67
- <div>
68
- <div class="sd_picto4"></div>
69
- <p class="sd_short_subtitle"><?=$this->__('Optimal deliverability')?></p>
70
- </div>
71
- </div>
72
- </div>
73
- <div>
74
- <div>
75
- <div>
76
- <div class="sd_subtitle_separator"></div>
77
- <p><?=$this->__('Synchronize and manage all the email lists from your Magento store')?></p>
78
- </div>
79
- </div>
80
- <div>
81
- <div>
82
- <div class="sd_subtitle_separator"></div>
83
- <p><?=$this->__('NEW! Create awesome, responsive newsletters thanks to the EmailBuilder')?></p>
84
- </div>
85
- </div>
86
- <div>
87
- <div>
88
- <div class="sd_subtitle_separator"></div>
89
- <p><?=$this->__('Geolocation, openings, opening time, clicks, opt-outs...')?></p>
90
- </div>
91
- </div>
92
- <div>
93
- <div>
94
- <div class="sd_subtitle_separator"></div>
95
- <p><?=$this->__('Optimal deliverability thanks to our renowned professional routing platform')?></p>
96
- </div>
97
- </div>
98
- </div>
99
- </div>
100
- <div class="sd_separator"></div>
101
- <div class="sd_account_offer_container">
102
- <p class="sd_account"><?=$this->__('Create your account for free and start sending emails')?></p>
103
- <p class="sd_offer"><?=$this->__('No strings attached')?></p>
104
- <div class="sd_title_separator_account_offer"></div>
105
- </div>
106
- <div class="sd_info_container">
107
- <div class="sd_info_container_left">
108
- <div>
109
- <p class="sd_info_title"><?=$this->__('Why choose Mailify?')?></p>
110
- <div>
111
- <p><?=$this->__('Create your account for free and start sending emails')?></p>
112
- <p><?=$this->__('Trusted by over 20,000 users worldwide.')?></p>
113
- <p><?=$this->__('Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)')?></p>
114
- <p><?=$this->__('All you need to succeed: design, customize, send, and follow-up on your campaigns')?></p>
115
- <p><?=$this->__('A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...')?></p>
116
- </div>
117
- </div>
118
- </div>
119
- <div class="sd_info_container_right">
120
- <div>
121
- <p class="sd_info_title"><?=$this->__('Need help?')?></p>
122
- <div>
123
- <p><?=$this->__('Email:')?> <?=$this->__('support@mailify.com')?></p>
124
- <p><?=$this->__('Tel:')?> <?=$this->__('+33(0) 328 328 040')?></p>
125
- <p>
126
- <?=$this->__('Website:')?>
127
- <a href="<?=$this->__('http://www.mailify.com/?utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento')?>" target="_blank"><?=$this->__('http://www.mailify.com')?></a>
128
- </p>
129
- </div>
130
- </div>
131
- </div>
132
- </div>
133
- <div id="sd_step"></div>
134
- <!-- ETAPE 1 -->
135
- <div id="sd_step1" class="sd_step <?php if(Mage::getSingleton("core/session")->getData("sd_is_user") == null && $general_configuration<2){?>sd_show_step<?php }?>">
136
- <p class="sd_step_title"><?=$this->__('How to set up the module?')?></p>
137
- <div class="sd_step_line"></div>
138
- <p class="sd_step1_instruction"><?=$this->__('Do you already have a Mailify account?')?></p>
139
- <form autocomplete="off" action="<?= Mage::helper('adminhtml')->getUrl("*/*/*/"); ?>#sd_step" method="post">
140
- <p class="sd_step1_selection">
141
- <span> <input onclick="sdUserYesNoDisplayButton('yes')" type="radio" id="sd_user_click_yes" name="sd_is_user" value="yes" <?php if(Mage::getSingleton("core/session")->getData("sd_is_user") == "yes"){?>checked="checked"<?php }?>/> <label for="sd_user_click_yes"><?=$this->__('Yes')?></label>
142
- </span> <span> <input onclick="sdUserYesNoDisplayButton('no')" type="radio" id="sd_user_click_no" name="sd_is_user" value="no" /> <label for="sd_user_click_no" <?php if(Mage::getSingleton("core/session")->getData("sd_is_user") == "no"){?>checked="checked"<?php }?>><?=$this->__('No')?></label>
143
- </span>
144
- </p>
145
- <div class="sd_step_buttons">
146
- <div class="sd_step_buttons_right">
147
- <input type="hidden" name="submit_is_user" value="1" /> <input type="hidden" name="form_key" value="<?= $this->getFormKey()?>" /> <input type="submit" class="sd_button" value="<?=$this->__('Next')?>" />
148
- </div>
149
- </div>
150
- </form>
151
- </div>
152
-
153
- <!-- ETAPE 2 -->
154
- <div id="sd_step2" class="sd_step <?php if((Mage::getSingleton("core/session")->getData("sd_is_user") == "yes" || Mage::getSingleton("core/session")->getData("sd_is_user") == "no") && $general_configuration<2 ){?>sd_show_step<?php }?>">
155
- <div class="sd_step_line"></div>
156
- <p class="sd_step2_instruction"><?=$this->__('Select your shop and pick your settings')?></p>
157
- <form autocomplete="off" action="<?= Mage::helper('adminhtml')->getUrl("*/*/*/"); ?>#sd_step" method="post">
158
- <div class="sd_step2_selection">
159
- <?php foreach ($stores_array as $store){?>
160
-
161
- <div class="sd_step2_selection_list">
162
- <p class="sd_step2_selection_shop_title"><?=$store['store_name']?></p>
163
- <div class="sd_step2_selection_shop">
164
- <div class="sd_step2_selection_shop_input">
165
- <input type="checkbox" name="store_id[]" value="<?=$store['store_id']?>N0" <?php if(in_array($store['store_id']+"N0",$list_configuration)){?>checked="checked"<?php }?> />&nbsp;
166
- </div>
167
- <div class="sd_step2_selection_shop_text">
168
- <?=$this->__('Create a list in Mailify with newsletter opt-ins')?>
169
- </div>
170
- </div>
171
- <div class="sd_step2_selection_shop">
172
- <div class="sd_step2_selection_shop_input">
173
- <?php
174
- $storeValue = "";
175
- $storeChecked = false;
176
- $storeWithCustomersData=false;
177
- if(in_array($store['store_id']."C1", $list_configuration)){
178
- $storeValue = $store['store_id'].'C1';
179
- $storeWithCustomersData=true;
180
- $storeChecked = true;
181
- }else if(in_array($store['store_id']."C0", $list_configuration)){
182
- $storeValue = $store['store_id']."C0";
183
- $storeChecked = true;
184
- }
185
-
186
- ?>
187
- <input id="id_shop_<?=$store['store_id']?>C" type="checkbox" name="store_id[]" onclick="changeOptionOrdersDataDisplay('<?=$store['store_id']?>C', this.checked)" value="<?=$storeValue?>" <?php if($storeChecked){ ?>checked="checked"<?php }?>/>&nbsp;
188
- </div>
189
- <div class="sd_step2_selection_shop_text">
190
- <?=$this->__('Create a list in Mailify with your clients who have an account or who have placed an order online')?>
191
- </div>
192
- </div>
193
- <div class="sd_step2_selection_shop_option">
194
- <div class="sd_step2_selection_shop_input">
195
- <input id="customer_data_<?=$store['store_id']?>C" type="checkbox" onclick="changeOptionOrdersData('<?=$store['store_id']?>C', this.checked)" value="<?php if($storeWithCustomersData){ echo $store['store_id'].'C1';} ?>" <?php if($storeWithCustomersData){?>checked="checked"<?php }?> />&nbsp;
196
- </div>
197
- <div class="sd_step2_selection_shop_text">
198
- <?=$this->__('Add order data (date, amount, etc...)')?>
199
- </div>
200
- <div onclick="sdInfoDataOrdersClick('<?=$store['store_id']?>C')" onmouseover="sdInfoDataOrdersHover('<?=$store['store_id']?>C')" onmouseout="sdInfoDataOrdersOut('<?=$store['store_id']?>C')" class="sd_step2_info"></div>
201
- </div>
202
- </div>
203
- <div id="sd_tooltip_<?=$store['store_id']?>C" class="sd_tooltip">
204
- <div>
205
- <?=$this->__('As you enable data from orders, you can also gather extra info in your contact list, and target your recipients in Mailify.')?>
206
- <br /><?=$this->__('Below are pieces of information that will be added to your contact list:')?>
207
- <br /><?=$this->__('- Date of first order')?>
208
- <br /><?=$this->__('- Date of latest order')?>
209
- <br /><?=$this->__('- Total number of orders')?>
210
- <br /><?=$this->__('- Total amount of orders')?>
211
- <br /><?=$this->__('- Amount of the cheapest order')?>
212
- <br /><?=$this->__('- Amount of the most expensive order')?>
213
- <br /><?=$this->__('- Average amount of the orders placed')?>
214
- </div>
215
- </div>
216
- <?php }?>
217
- </div>
218
- <div class="sd_step_buttons">
219
- <div class="sd_step_buttons_left">
220
- <input type="button" onclick="sdDisplayStep(1)" value="<?=$this->__('Previous')?>" />
221
- </div>
222
- <div class="sd_step_buttons_right">
223
- <input type="hidden" name="submit_configuration" value="1" /> <input type="hidden" name="submit_is_user" value="<?=$this->getIsUser()?>" /> <input type="hidden" name="form_key" value="<?= $this->getFormKey()?>" /> <input type="submit" class="sd_button" value="<?=$this->__('Next')?>" />
224
- </div>
225
- </div>
226
- </form>
227
- </div>
228
- <!-- ETAPE 3 -->
229
- <div id="sd_step3" class="sd_step <?php if($general_configuration>=2){?>sd_show_step<?php }?>">
230
- <div class="sd_step_line"></div>
231
-
232
- <div class="sd_step3_instruction">
233
- <div id="3_step_block" <?php if(Mage::getSingleton("core/session")->getData("sd_is_user") == "yes" || Mage::getSingleton("core/session")->getData("sd_is_user") == null){?> class="HIDDEN" <?php }?>>
234
- <p>
235
- 1/ <a href="<?=$this->__('https://static.mailify.com/ws/soft-redirect.asp?key=as8Ku4rGIs&com=MagentoInfo&lng=EN')?>" target="_blank"><?=$this->__('Download and install Mailify')?></a>
236
- </p>
237
- <p>2/ <?=$this->__('Create your free account')?></p>
238
- <p>3/ <?=$this->__('Enable the Magento extension in our extensions menu, and then fill in the following fields:')?></p>
239
- </div>
240
- <div id="1_step_block" <?php if(Mage::getSingleton("core/session")->getData("sd_is_user") == "no"){?> class="HIDDEN" <?php }?>>
241
- <p><?=$this->__('Enable the Magento extension in our extensions menu, and then fill in the following fields:')?></p>
242
- </div>
243
- <form autocomplete="off" action="<?= Mage::helper('adminhtml')->getUrl("*/*/*/"); ?>#sd_step" method="post">
244
- <div class="sd_key_container">
245
- <p><?=$this->__('Url')?></p>
246
- <input value="<?=Mage::getBaseUrl() ?>" onclick="this.select()" type="text" readonly />
247
- </div>
248
- <div class="sd_key_container">
249
- <p><?=$this->__('Key')?></p>
250
- <input value="<?=$key_for_synchronisation?>" onclick="this.select()" type="text" readonly />
251
- </div>
252
- <p class="sd_key_button_container">
253
- <input type="hidden" name="submit_parameter_key" value="1" /> <input type="hidden" name="form_key" value="<?=$this->getFormKey()?>" /> <input type="submit" class="sd_key_button" value="<?=$this->__('Generate a new key')?>" />
254
- </p>
255
- </form>
256
- </div>
257
- <div class="sd_step_buttons">
258
- <div class="sd_step_buttons_left">
259
- <input type="button" onclick="sdDisplayStep(2)" value="<?=$this->__('Previous')?>" />
260
- </div>
261
- <div class="sd_step3_right">
262
- <?=$this->__('Read more')?>, <a href="<?=$this->__('https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN')?>" target="_blank"><?=$this->__('in the help section online')?></a>
263
- </div>
264
- </div>
265
- </div>
266
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  * @copyright 2015 Sarbacane Software
19
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
  */
21
+ $key_for_synchronisation = $this->getKeyForSynchronisation();
22
+ $check_failed = $this->getCheckFailed();
23
+ $list_configuration = $this->getListConfiguration();
24
+ $general_configuration = $this->getGeneralConfiguration();
25
+ $sd_is_user = $this->getSdIsUser();
26
+ $displayed_step = $this->getDisplayedStep();
27
+ $shops_array = $this->getShopsArray();
28
  ?>
29
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('mailify.css') ?>"/>
30
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('mailify.js') ?>"></script>
31
+ <div id="mailify">
32
+ <div class="sd_header">
33
+ <div class="sd_logo_<?php echo $this->__('mailify') ?>"></div>
34
+ </div>
35
+ <p class="sd_title"><?php echo $this->__('It\'s easy to manage your newsletter and email campaigns') ?></p>
36
+ <div class="sd_title_separator_page"></div>
37
+ <div class="sd_video_config_container">
38
+ <div class="sd_video_container">
39
+ <iframe width="565" height="315" src="<?php echo $this->__('https://www.youtube.com/embed/eLMy2tSSYgE') ?>?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
40
+ </div>
41
+ <div class="sd_config_container">
42
+ <p><?php echo $this->__('This Magento module enables you to synchronize clients and accounts that have subscribed to your newsletter from your shop online using Mailify\'s email marketing software.') ?></p>
43
+ <p>
44
+ <input type="button" onclick="sdDisplaySteps()" class="sd_config_button" value="<?php echo $this->__('Begin the set-up') ?>"/>
45
+ </p>
46
+ </div>
47
+ </div>
48
+ <div class="sd_separator"></div>
49
+ <div class="sd_detail_description_container">
50
+ <div>
51
+ <div>
52
+ <div>
53
+ <div class="sd_picto1"></div>
54
+ <p class="sd_long_subtitle"><?php echo $this->__('Synchronization of your shop data') ?></p>
55
+ </div>
56
+ </div>
57
+ <div>
58
+ <div>
59
+ <div class="sd_picto2"></div>
60
+ <p class="sd_long_subtitle"><?php echo $this->__('Responsive visual editor') ?></p>
61
+ </div>
62
+ </div>
63
+ <div>
64
+ <div>
65
+ <div class="sd_picto3"></div>
66
+ <p class="sd_short_subtitle"><?php echo $this->__('Detailed statistics') ?></p>
67
+ </div>
68
+ </div>
69
+ <div>
70
+ <div>
71
+ <div class="sd_picto4"></div>
72
+ <p class="sd_short_subtitle"><?php echo $this->__('Optimal deliverability') ?></p>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ <div>
77
+ <div>
78
+ <div>
79
+ <div class="sd_subtitle_separator"></div>
80
+ <p><?php echo $this->__('Synchronize and manage all the email lists from your Magento store') ?></p>
81
+ </div>
82
+ </div>
83
+ <div>
84
+ <div>
85
+ <div class="sd_subtitle_separator"></div>
86
+ <p><?php echo $this->__('NEW! Create awesome, responsive newsletters thanks to the EmailBuilder') ?></p>
87
+ </div>
88
+ </div>
89
+ <div>
90
+ <div>
91
+ <div class="sd_subtitle_separator"></div>
92
+ <p><?php echo $this->__('Geolocation, openings, opening time, clicks, opt-outs...') ?></p>
93
+ </div>
94
+ </div>
95
+ <div>
96
+ <div>
97
+ <div class="sd_subtitle_separator"></div>
98
+ <p><?php echo $this->__('Optimal deliverability thanks to our renowned professional routing platform') ?></p>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ <div class="sd_separator"></div>
104
+ <div class="sd_account_offer_container">
105
+ <p class="sd_account"><?php echo $this->__('Create your account for free and start sending emails') ?></p>
106
+ <p class="sd_offer"><?php echo $this->__('No strings attached') ?></p>
107
+ <div class="sd_title_separator_account_offer"></div>
108
+ </div>
109
+ <div class="sd_info_container">
110
+ <div class="sd_info_container_left">
111
+ <div>
112
+ <p class="sd_info_title"><?php echo $this->__('Why choose Mailify?') ?></p>
113
+ <div>
114
+ <p><?php echo $this->__('Create your account for free and start sending emails') ?></p>
115
+ <p><?php echo $this->__('Trusted by over 20,000 users worldwide') ?></p>
116
+ <p><?php echo $this->__('Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)') ?></p>
117
+ <p><?php echo $this->__('All you need to succeed: design, customize, send, and follow-up on your campaigns') ?></p>
118
+ <p><?php echo $this->__('A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...') ?></p>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <div class="sd_info_container_right">
123
+ <div>
124
+ <p class="sd_info_title"><?php echo $this->__('Need help?') ?></p>
125
+ <div>
126
+ <p><?php echo $this->__('Email:') ?> <?php echo $this->__('support@mailify.com') ?></p>
127
+ <p><?php echo $this->__('Tel:') ?> <?php echo $this->__('(646)-844-0983') ?></p>
128
+ <p>
129
+ <?php echo $this->__('Website:') ?>
130
+ <a href="<?php echo $this->__('http://www.mailify.com/lng=EN?utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento') ?>" target="_blank"><?php echo $this->__('http://www.mailify.com') ?></a>
131
+ </p>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ <div id="sd_step"></div>
137
+ <!-- STEP 1 -->
138
+ <div id="sd_step1" class="sd_step<?php if ($displayed_step == 1) { ?> sd_show_step<?php } ?>">
139
+ <p class="sd_step_title"><?php echo $this->__('How to set up the module?') ?></p>
140
+ <div class="sd_step_line"></div>
141
+ <p class="sd_step1_instruction"><?php echo $this->__('Do you already have a Mailify account?') ?></p>
142
+ <form autocomplete="off" action="<?php echo Mage::helper('adminhtml')->getUrl("*/*/*/") ?>#sd_step" method="POST">
143
+ <p class="sd_step1_selection">
144
+ <span>
145
+ <input onclick="sdUserYesNoDisplayButton('yes')" type="radio" id="sd_user_click_yes" name="sd_is_user" value="yes"<?php if ($sd_is_user == "yes") { ?> checked="checked"<?php } ?>/>
146
+ <label for="sd_user_click_yes"><?php echo $this->__('Yes') ?></label>
147
+ </span>
148
+ <span>
149
+ <input onclick="sdUserYesNoDisplayButton('no')" type="radio" id="sd_user_click_no" name="sd_is_user" value="no"<?php if ($sd_is_user == "no") { ?> checked="checked"<?php } ?>/>
150
+ <label for="sd_user_click_no"><?php echo $this->__('No') ?></label>
151
+ </span>
152
+ </p>
153
+ <div class="sd_step_buttons">
154
+ <div class="sd_step_buttons_right">
155
+ <input type="hidden" name="submit_is_user" value="1"/>
156
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey() ?>"/>
157
+ <input type="submit" class="sd_button" value="<?php echo $this->__('Next') ?>"/>
158
+ </div>
159
+ </div>
160
+ </form>
161
+ </div>
162
+ <!-- STEP 2 -->
163
+ <div id="sd_step2" class="sd_step<?php if ($displayed_step == 2) { ?> sd_show_step<?php } ?>">
164
+ <div class="sd_step_line"></div>
165
+ <p class="sd_step2_instruction"><?php echo $this->__('Select your shop and pick your settings') ?></p>
166
+ <form autocomplete="off" action="<?php echo Mage::helper('adminhtml')->getUrl("*/*/*/") ?>#sd_step" method="POST">
167
+ <div class="sd_step2_selection">
168
+ <?php foreach ($shops_array as $shop) { ?>
169
+ <div class="sd_step2_selection_list">
170
+ <p class="sd_step2_selection_shop_title"><?php echo $shop['name'] ?></p>
171
+ <div class="sd_step2_selection_shop">
172
+ <div class="sd_step2_selection_shop_input">
173
+ <?php
174
+ $store_value = $shop['store_id'] . 'N0';
175
+ $store_checked = $general_configuration < 3 || in_array($shop['store_id'] . 'N0', $list_configuration);
176
+ ?>
177
+ <input type="checkbox" name="store_id[]" value="<?php echo $store_value ?>"<?php if ($store_checked) { ?> checked="checked"<?php } ?>/>
178
+ </div>
179
+ <div class="sd_step2_selection_shop_text">
180
+ <?php echo $this->__('Create a list in Mailify with newsletter opt-ins') ?>
181
+ </div>
182
+ </div>
183
+ <div class="sd_step2_selection_shop">
184
+ <div class="sd_step2_selection_shop_input">
185
+ <?php
186
+ $store_value = '';
187
+ $store_checked = false;
188
+ $store_with_customer_data = false;
189
+ if (in_array($shop['store_id'] . 'C1', $list_configuration)) {
190
+ $store_value = $shop['store_id'] . 'C1';
191
+ $store_with_customer_data = true;
192
+ $store_checked = true;
193
+ } else if ($general_configuration < 3 || in_array($shop['store_id'] . 'C0', $list_configuration)) {
194
+ $store_value = $shop['store_id'] . 'C0';
195
+ $store_checked = true;
196
+ }
197
+ ?>
198
+ <input id="id_shop_<?php echo $shop['store_id'] ?>C" type="checkbox" name="store_id[]" onclick="changeOptionOrdersDataDisplay('<?php echo $shop['store_id'] ?>C', this.checked)" value="<?php echo $store_value ?>"<?php if ($store_checked) { ?> checked="checked"<?php } ?>/>
199
+ </div>
200
+ <div class="sd_step2_selection_shop_text">
201
+ <?php echo $this->__('Create a list in Mailify with your clients who have an account or who have placed an order online') ?>
202
+ </div>
203
+ </div>
204
+ <div class="sd_step2_selection_shop_option<?php if ($shop['store_id'] == '0') { ?> sd_hidden<?php } ?>">
205
+ <div class="sd_step2_selection_shop_input">
206
+ <input id="customer_data_<?php echo $shop['store_id'] ?>C" type="checkbox" onclick="changeOptionOrdersData('<?php echo $shop['store_id'] ?>C', this.checked)" <?php if ($store_with_customer_data) { ?>checked="checked"<?php } ?>/>
207
+ </div>
208
+ <div class="sd_step2_selection_shop_text">
209
+ <?php echo $this->__('Add order data (date, amount, etc...)') ?>
210
+ </div>
211
+ <div onclick="sdInfoDataOrdersClick('<?php echo $shop['store_id'] ?>C')" onmouseover="sdInfoDataOrdersHover('<?php echo $shop['store_id'] ?>C')" onmouseout="sdInfoDataOrdersOut('<?php echo $shop['store_id'] ?>C')" class="sd_step2_info"></div>
212
+ </div>
213
+ </div>
214
+ <div id="sd_tooltip_<?php echo $shop['store_id'] ?>C" class="sd_tooltip">
215
+ <div>
216
+ <?php echo $this->__('As you enable data from orders, you can also gather extra info in your contact list, and target your recipients in Mailify.') ?>
217
+ <br/><?php echo $this->__('Below are pieces of information that will be added to your contact list:') ?>
218
+ <br/><?php echo $this->__('- Date of first order') ?>
219
+ <br/><?php echo $this->__('- Date of latest order') ?>
220
+ <br/><?php echo $this->__('- Total number of orders') ?>
221
+ <br/><?php echo $this->__('- Total amount of orders') ?>
222
+ <br/><?php echo $this->__('- Amount of the cheapest order') ?>
223
+ <br/><?php echo $this->__('- Amount of the most expensive order') ?>
224
+ <br/><?php echo $this->__('- Average amount of the orders placed') ?>
225
+ </div>
226
+ </div>
227
+ <?php } ?>
228
+ </div>
229
+ <div class="sd_step_buttons">
230
+ <div class="sd_step_buttons_left">
231
+ <input type="button" onclick="sdDisplayStep(1)" value="<?php echo $this->__('Previous') ?>"/>
232
+ </div>
233
+ <div class="sd_step_buttons_right">
234
+ <input type="hidden" name="submit_configuration" value="1"/>
235
+ <input type="hidden" name="submit_is_user" value="<?php echo $this->getIsUser() ?>"/>
236
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey() ?>"/>
237
+ <input type="submit" class="sd_button" value="<?php echo $this->__('Next') ?>"/>
238
+ </div>
239
+ </div>
240
+ </form>
241
+ </div>
242
+ <!-- STEP 3 -->
243
+ <div id="sd_step3" class="sd_step<?php if ($displayed_step == 3) { ?> sd_show_step<?php } ?>">
244
+ <div class="sd_step_line"></div>
245
+ <div class="sd_step3_instruction">
246
+ <?php if ($sd_is_user == "yes") { ?>
247
+ <p>1/ <a href="<?php echo $this->__('https://static.mailify.com/ws/soft-redirect.asp?key=as8Ku4rGIs&com=MagentoInfo&lng=EN') ?>" target="_blank"><?php echo $this->__('Download and install Mailify') ?></a></p>
248
+ <p>2/ <?php echo $this->__('Create your free account') ?></p>
249
+ <p>3/ <?php echo $this->__('Enable the Magento extension in our extensions menu, and then fill in the following fields:') ?></p>
250
+ <?php } else if ($sd_is_user == "no") { ?>
251
+ <p><?php echo $this->__('Enable the Magento extension in our extensions menu, and then fill in the following fields:') ?></p>
252
+ <?php } ?>
253
+ <form autocomplete="off" action="<?php echo Mage::helper('adminhtml')->getUrl("*/*/*/") ?>#sd_step" method="POST">
254
+ <div class="sd_key_container">
255
+ <p><?php echo $this->__('Url') ?></p>
256
+ <input value="<?php echo Mage::getBaseUrl() ?>" onclick="this.select()" type="text" readonly/>
257
+ </div>
258
+ <div class="sd_key_container">
259
+ <p><?php echo $this->__('Key') ?></p>
260
+ <?php if ( ! $check_failed) { ?>
261
+ <input value="<?php echo $key_for_synchronisation ?>" onclick="this.select()" type="text" readonly/>
262
+ <?php } else { ?>
263
+ <span><?php echo $this->__('Please generate a new key') ?></span>
264
+ <?php } ?>
265
+ </div>
266
+ <p class="sd_key_button_container">
267
+ <input type="hidden" name="submit_parameter_key" value="1"/>
268
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey() ?>"/>
269
+ <input type="submit" class="sd_key_button" value="<?php echo $this->__('Generate a new key') ?>"/>
270
+ </p>
271
+ </form>
272
+ </div>
273
+ <div class="sd_step_buttons">
274
+ <div class="sd_step_buttons_left">
275
+ <input type="button" onclick="sdDisplayStep(2)" value="<?php echo $this->__('Previous') ?>"/>
276
+ </div>
277
+ <div class="sd_step3_right">
278
+ <?php echo $this->__('Read more') ?>, <a href="<?php echo $this->__('https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN') ?>" target="_blank"><?php echo $this->__('in the help section online') ?></a>
279
+ </div>
280
+ </div>
281
+ </div>
282
+ </div>
app/etc/modules/Sarbacane_Mailify.xml CHANGED
@@ -27,4 +27,4 @@
27
  <codePool>community</codePool>
28
  </Sarbacane_Mailify>
29
  </modules>
30
- </config>
27
  <codePool>community</codePool>
28
  </Sarbacane_Mailify>
29
  </modules>
30
+ </config>
app/locale/de_DE/Sarbacane_Mailify.csv ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Mailify","Mailify"
2
+ "Other","Sonstige"
3
+ "mailify","mailify"
4
+ "It's easy to manage your newsletter and email campaigns","Es ist einfach, Newsletter und E-Mail-Kampagnen zu bearbeiten."
5
+ "https://www.youtube.com/embed/eLMy2tSSYgE","https://www.youtube.com/embed/gUGRbfXOJIk"
6
+ "This Magento module enables you to synchronize clients and accounts that have subscribed to your newsletter from your shop online using Mailify's email marketing software.","Mit diesem Magento-Modul können Sie Kunden und Konten sowie Newsletter-Empfänger aus Ihrem Online-Shop mit der E-Mail-Marketing-Software von Mailify synchronisieren."
7
+ "Begin the set-up","Installation beginnen"
8
+ "Synchronization of your shop data","Synchronisation Ihrer Shop-Daten"
9
+ "Responsive visual editor","Responsiver Editor"
10
+ "Detailed statistics","Detaillierte Statistiken"
11
+ "Optimal deliverability","Optimale Zustellbarkeit"
12
+ "Synchronize and manage all the email lists from your Magento store","Synchronisieren und bearbeiten Sie alle Kontaktlisten aus Ihrem Magento-Konto"
13
+ "NEW! Create awesome, responsive newsletters thanks to the EmailBuilder","NEU! Erstellen Sie professionelle und responsive Newsletter mit dem EmailBuilder"
14
+ "Geolocation, openings, opening time, clicks, opt-outs...","Geolokalisierung, Öffnungen, Lesezeit, Klicks, Opt-Outs..."
15
+ "Optimal deliverability thanks to our renowned professional routing platform","Beste Zustellraten dank unserem professionellen Versandsystem"
16
+ "Create your account for free and start sending emails","Melden Sie sich kostenlos an und beginnen Sie Ihren Versand"
17
+ "No strings attached","Kein Risiko"
18
+ "Why choose Mailify?","Wieso Mailify?"
19
+ "Trusted by over 20,000 users worldwide","Über 85'000 Nutzer vertrauen Mailify"
20
+ "Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)","Von Bsoco Awards als beste E-Mail-Marketing-Software ausgezeichnet"
21
+ "All you need to succeed: design, customize, send, and follow-up on your campaigns","Alles, was Sie brauchen: Erstellen, personalisieren und verfolgen Sie Ihre Kampagnen"
22
+ "A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...","Unser Helpdesk und diverse Unterlagen helfen Ihnen: Videos, Tutorials, Handbücher, Tipps..."
23
+ "Need help?","Brauchen Sie Hilfe?"
24
+ "Email:","E-Mail:"
25
+ "support@mailify.com","kontakt@mailify.com"
26
+ "Tel:","Tel:"
27
+ "(646)-844-0983","+49 89 3398 2961"
28
+ "Website:","Webseite :"
29
+ "http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento","http://www.mailify.com/?lng=DE&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
30
+ "http://www.mailify.com","http://www.mailify.com"
31
+ "How to set up the module?","Wie wird das Modul aufgesetzt?"
32
+ "Do you already have a Mailify account?","Haben Sie bereits ein Mailify-Konto?"
33
+ "Yes","Ja"
34
+ "No","Nein"
35
+ "Next","Weiter"
36
+ "Select your shop and pick your settings","Wählen Sie Ihren Shop und Ihre Einstellungen"
37
+ "Create a list in Mailify with newsletter opt-ins","Erstellen Sie in Mailify eine Liste mit Newsletter-Anmeldungen"
38
+ "Create a list in Mailify with your clients who have an account or who have placed an order online","Erstellen Sie in Mailify eine Liste mit Kundenkonten oder Kunden mit vergangenen Bestellungen"
39
+ "Add order data (date, amount, etc...)","Fügen Sie Bestelldaten hinzu (Datum, Betrag, etc.)"
40
+ "As you enable data from orders, you can also gather extra info in your contact list, and target your recipients in Mailify.","Sie können auch andere Bestelldaten hinzufügen und so zielgerichtete Kampagnen mit Mailify versenden."
41
+ "Below are pieces of information that will be added to your contact list:","Unten sehen welche Informationen Ihren Kontaktlisten hinzugefügt werden:"
42
+ "- Date of first order","- Datum der ersten Bestellung"
43
+ "- Date of latest order","- Datum der letzten Bestellung"
44
+ "- Total number of orders","- Gesamtanzahl Bestellungen"
45
+ "- Total amount of orders","- Gesamtwert der Bestellungen"
46
+ "- Amount of the cheapest order","- Wert der günstigsten Bestellung"
47
+ "- Amount of the most expensive order","- Wert der höchsten Bestellung"
48
+ "- Average amount of the orders placed","- Durchschnittswert der Bestellungen"
49
+ "Previous","Zurück"
50
+ "Download and install Mailify","Laden und installieren Sie Mailify"
51
+ "https://static.mailify.com/ws/soft-redirect.asp?key=as8Ku4rGIs&com=MagentoInfo&lng=EN","https://static.mailify.com/ws/soft-redirect.asp?key=as8Ku4rGIs&com=MagentoInfo&lng=DE"
52
+ "Create your free account","Melden Sie sich kostenlos an"
53
+ "Enable the Magento extension in our extensions menu, and then fill in the following fields:","Aktivieren Sie die Magento-Erweiterung im Menü Erweiterungen und füllen Sie die folgenden Felder aus:"
54
+ "Url","URL"
55
+ "Key","Aktivierungsschlüssel"
56
+ "Please generate a new key","Danke neuen Aktivierungsschlüssel generieren"
57
+ "Generate a new key","Neuen Aktivierungsschlüssel generieren"
58
+ "Read more","Lesen Sie mehr"
59
+ "https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=DE"
60
+ "in the help section online","in der Online-Hilfe"
app/locale/en_US/Sarbacane_Mailify.csv CHANGED
@@ -1,3 +1,5 @@
 
 
1
  "mailify","mailify"
2
  "It's easy to manage your newsletter and email campaigns","It's easy to manage your newsletter and email campaigns"
3
  "https://www.youtube.com/embed/eLMy2tSSYgE","https://www.youtube.com/embed/gUGRbfXOJIk"
@@ -13,9 +15,8 @@
13
  "Optimal deliverability thanks to our renowned professional routing platform","Optimal deliverability thanks to our renowned professional routing platform"
14
  "Create your account for free and start sending emails","Create your account for free and start sending emails"
15
  "No strings attached","No strings attached"
16
- "Why choose Sarbacane?","Why choose Mailify?"
17
- "Create your account for free and start sending emails,"
18
- "Trusted by over 20,000 users worldwide.","Trusted by over 20,000 users worldwide."
19
  "Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)","Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)"
20
  "All you need to succeed: design, customize, send, and follow-up on your campaigns","All you need to succeed: design, customize, send, and follow-up on your campaigns"
21
  "A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...","A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips..."
@@ -23,8 +24,8 @@
23
  "Email:","Email:"
24
  "support@mailify.com","help@mailify.com"
25
  "Tel:","Tel:"
26
- "+33(0) 328 328 040","(646)-844-0983"
27
- "Website:","Website : "
28
  "http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento","http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
29
  "http://www.mailify.com","http://www.mailify.com"
30
  "How to set up the module?","How to set up the module?"
@@ -52,6 +53,7 @@
52
  "Enable the Magento extension in our extensions menu, and then fill in the following fields:","Enable the Magento extension in our extensions menu, and then fill in the following fields:"
53
  "Url","Url"
54
  "Key","Key"
 
55
  "Generate a new key","Generate a new key"
56
  "Read more","Read more"
57
  "https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN"
1
+ "Mailify","Mailify"
2
+ "Other","Other"
3
  "mailify","mailify"
4
  "It's easy to manage your newsletter and email campaigns","It's easy to manage your newsletter and email campaigns"
5
  "https://www.youtube.com/embed/eLMy2tSSYgE","https://www.youtube.com/embed/gUGRbfXOJIk"
15
  "Optimal deliverability thanks to our renowned professional routing platform","Optimal deliverability thanks to our renowned professional routing platform"
16
  "Create your account for free and start sending emails","Create your account for free and start sending emails"
17
  "No strings attached","No strings attached"
18
+ "Why choose Mailify?","Why choose Mailify?"
19
+ "Trusted by over 20,000 users worldwide","Trusted by over 20,000 users worldwide"
 
20
  "Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)","Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)"
21
  "All you need to succeed: design, customize, send, and follow-up on your campaigns","All you need to succeed: design, customize, send, and follow-up on your campaigns"
22
  "A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...","A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips..."
24
  "Email:","Email:"
25
  "support@mailify.com","help@mailify.com"
26
  "Tel:","Tel:"
27
+ "(646)-844-0983","(646)-844-0983"
28
+ "Website:","Website :"
29
  "http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento","http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
30
  "http://www.mailify.com","http://www.mailify.com"
31
  "How to set up the module?","How to set up the module?"
53
  "Enable the Magento extension in our extensions menu, and then fill in the following fields:","Enable the Magento extension in our extensions menu, and then fill in the following fields:"
54
  "Url","Url"
55
  "Key","Key"
56
+ "Please generate a new key","Please generate a new key"
57
  "Generate a new key","Generate a new key"
58
  "Read more","Read more"
59
  "https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN"
app/locale/es_ES/Sarbacane_Mailify.csv CHANGED
@@ -1,3 +1,5 @@
 
 
1
  "mailify","mailify"
2
  "It's easy to manage your newsletter and email campaigns","Gestiona tus newsletters y emailing con facilidad"
3
  "https://www.youtube.com/embed/eLMy2tSSYgE","https://www.youtube.com/embed/ADeyEs4FdGY"
@@ -14,8 +16,7 @@
14
  "Create your account for free and start sending emails","Creación de cuenta y primeros envíos gratuitos"
15
  "No strings attached","Oferta sin compromisos"
16
  "Why choose Mailify?","¿Por qué elegir Mailify?"
17
- "Create your account for free and start sending emails,"
18
- "Trusted by over 20,000 users worldwide.","Más de 20.000 usuarios en España y Francia están encantados por Mailify"
19
  "Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)","Elegidos como Mejor Solución de Emailing por los Premios Bsoco"
20
  "All you need to succeed: design, customize, send, and follow-up on your campaigns","Todo lo que necesitas para tener éxito: diseño, personalización, envío y seguimiento de tus campañas"
21
  "A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...","Soporte técnico y númerosos recursos para asistirte: videos, tutoriales, guías, consejos..."
@@ -23,9 +24,9 @@
23
  "Email:","Email:"
24
  "support@mailify.com","ayuda@mailify.com"
25
  "Tel:","Tel:"
26
- "+33(0) 328 328 040","+34 93 4763638"
27
- "Website:","Web : "
28
- "http://www.mailify.com/?utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento","http://es.mailify.com/?lng=ES&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
29
  "http://www.mailify.com","http://es.mailify.com"
30
  "How to set up the module?","¿Cómo configurar el módulo?"
31
  "Do you already have a Mailify account?","¿Ya eres usuario Mailify?"
@@ -52,6 +53,7 @@
52
  "Enable the Magento extension in our extensions menu, and then fill in the following fields:","Activa la extensión Magento desde el menú ''Extensiones'' en Mailify e introduce los siguientes datos:"
53
  "Url","Url"
54
  "Key","Clave"
 
55
  "Generate a new key","Generar una nueva clave"
56
  "Read more","Leer más en la"
57
  "https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=ES"
1
+ "Mailify","Mailify"
2
+ "Other","Otra"
3
  "mailify","mailify"
4
  "It's easy to manage your newsletter and email campaigns","Gestiona tus newsletters y emailing con facilidad"
5
  "https://www.youtube.com/embed/eLMy2tSSYgE","https://www.youtube.com/embed/ADeyEs4FdGY"
16
  "Create your account for free and start sending emails","Creación de cuenta y primeros envíos gratuitos"
17
  "No strings attached","Oferta sin compromisos"
18
  "Why choose Mailify?","¿Por qué elegir Mailify?"
19
+ "Trusted by over 20,000 users worldwide","Más de 20.000 usuarios en España y Francia están encantados por Mailify"
 
20
  "Awarded Best Emailing Solution by Bsoco Awards (an index that compares emailing solutions)","Elegidos como Mejor Solución de Emailing por los Premios Bsoco"
21
  "All you need to succeed: design, customize, send, and follow-up on your campaigns","Todo lo que necesitas para tener éxito: diseño, personalización, envío y seguimiento de tus campañas"
22
  "A tech heldpdesk and a variety of resources to help: videos, tutorials, manuals, tips...","Soporte técnico y númerosos recursos para asistirte: videos, tutoriales, guías, consejos..."
24
  "Email:","Email:"
25
  "support@mailify.com","ayuda@mailify.com"
26
  "Tel:","Tel:"
27
+ "(646)-844-0983","+34 93 4763638"
28
+ "Website:","Web :"
29
+ "http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento","http://es.mailify.com/?lng=ES&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
30
  "http://www.mailify.com","http://es.mailify.com"
31
  "How to set up the module?","¿Cómo configurar el módulo?"
32
  "Do you already have a Mailify account?","¿Ya eres usuario Mailify?"
53
  "Enable the Magento extension in our extensions menu, and then fill in the following fields:","Activa la extensión Magento desde el menú ''Extensiones'' en Mailify e introduce los siguientes datos:"
54
  "Url","Url"
55
  "Key","Clave"
56
+ "Please generate a new key","Gracias generar una nueva clave"
57
  "Generate a new key","Generar una nueva clave"
58
  "Read more","Leer más en la"
59
  "https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=ES"
package.xml CHANGED
@@ -1,12 +1,12 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sarbacane_Mailify</name>
4
- <version>1.0.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary> The extension synchronizes your e-shop Magento and the emailing solution software Mailify</summary>
10
  <description>&lt;i&gt;With Mailify, easily create and send stunning newsletters to inform your community and increase customer loyalty.&lt;/i&gt;&#xD;
11
  &lt;br /&gt;&lt;br /&gt;&#xD;
12
  &lt;h2&gt;Merchant Benefits&lt;/h2&gt;&#xD;
@@ -63,10 +63,10 @@
63
  &lt;a href="https://es.mailify.com/?utm_source=magento&amp;amp;utm_medium=plugin&amp;amp;utm_campaign=marketplace"&gt;es.mailify.com&lt;/a&gt;</description>
64
  <notes>We improved performance on synchronization.&#xD;
65
  It should be more efficient and nearly instant on most websites.</notes>
66
- <authors><author><name>Sarbacane Software</name><user>egavard</user><email>connectors@sarbacane.com</email></author></authors>
67
- <date>2015-12-04</date>
68
- <time>11:10:09</time>
69
- <contents><target name="magecommunity"><dir name="Sarbacane"><dir name="Mailify"><dir name="Block"><dir name="Adminhtml"><file name="Mailify.php" hash="f0ad71d64dc619421a67a3af24b23278"/></dir></dir><dir name="Helper"><file name="Data.php" hash="f4abc650d826b085fadb21c0af238021"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailifyController.php" hash="0ae0d6822e9c5169870c0980861935eb"/></dir><file name="IndexController.php" hash="748790436427ca843113841891be6579"/></dir><dir name="etc"><file name="config.xml" hash="5dc0ab6c7a34072cfbc89cab44250e9e"/></dir><dir name="sql"><dir name="mailify_setup"><file name="mysql4-install-1.0.0.0.php" hash="82834af7ce95c1bd9d3063ffdf3a11f5"/><file name="mysql4-upgrade-1.0.0.0-1.0.0.1.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.1-1.0.0.2.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.2-1.0.0.3.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.3-1.0.0.4.php" hash="2bd5ea1d79115c1a6ba919a708b1fb4b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="Sarbacane_Mailify"><file name="mailify.css" hash="6fcee54bdab10db72a361ec5a139cc7c"/></dir></dir><dir name="images"><file name="sd.png" hash="2038d3c503e8f59d14177a131bef7537"/></dir><dir name="js"><dir name="Sarbacane_Mailify"><file name="mailify.js" hash="d38d9ec858dfdce14e0156acc87c1c50"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailify.xml" hash="2ce0ac9b7cd4ec8adf80494c86aaae10"/></dir><dir name="template"><dir name="mailify"><file name="mailify.phtml" hash="2207e779b2aabba7bf662405250e6c90"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Sarbacane_Mailify.xml" hash="daf2fd2fbde04d804b1fdd7671273c82"/></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Sarbacane_Mailify.csv" hash="9b795397896dc1444b6cc072107abaed"/></dir><dir name="en_US"><file name="Sarbacane_Mailify.csv" hash="59f160ee7d95366e2f1202dad25061b5"/></dir></target></contents>
70
  <compatible/>
71
- <dependencies><required><php><min>5.0.0</min><max>5.6.15</max></php></required></dependencies>
72
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sarbacane_Mailify</name>
4
+ <version>1.0.0.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>The extension synchronizes your e-shop Magento and the emailing solution software Mailify</summary>
10
  <description>&lt;i&gt;With Mailify, easily create and send stunning newsletters to inform your community and increase customer loyalty.&lt;/i&gt;&#xD;
11
  &lt;br /&gt;&lt;br /&gt;&#xD;
12
  &lt;h2&gt;Merchant Benefits&lt;/h2&gt;&#xD;
63
  &lt;a href="https://es.mailify.com/?utm_source=magento&amp;amp;utm_medium=plugin&amp;amp;utm_campaign=marketplace"&gt;es.mailify.com&lt;/a&gt;</description>
64
  <notes>We improved performance on synchronization.&#xD;
65
  It should be more efficient and nearly instant on most websites.</notes>
66
+ <authors><author><name>Sarbacane Software</name><user>sarbacane</user><email>connectors@sarbacane.com</email></author></authors>
67
+ <date>2017-06-19</date>
68
+ <time>13:14:00</time>
69
+ <contents><target name="magecommunity"><dir name="Sarbacane"><dir name="Mailify"><dir name="Block"><dir name="Adminhtml"><file name="Mailify.php" hash="7499b4060c7f5fd5f45071a009140028"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0ea9d66bc8fea25b4ae9416979aec1a1"/></dir><dir name="Model"><file name="Observer.php" hash="b1bd3dd3691a1f0ba54753eb1557de80"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailifyController.php" hash="bfe36f93020a0a4b187aa6cf7d1a5f07"/></dir><file name="IndexController.php" hash="8b1cc64c8b8e31377a864395f86f721e"/></dir><dir name="etc"><file name="config.xml" hash="2155e0eb71236a27d3681a761b6950be"/></dir><dir name="sql"><dir name="mailify_setup"><file name="mysql4-upgrade-1.0.0.7-1.0.0.8.php" hash="7532046acb50f9c3a44017fa431241bf"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="mailify.css" hash="400ef58717993c05cac2b9d0f2d2b1dd"/><dir name="images"><file name="mailify.png" hash="2038d3c503e8f59d14177a131bef7537"/></dir><file name="mailify.js" hash="5a93eb4e4adf929a184e6db15eb6cd5f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailify.xml" hash="2af03cc6e166f75310dfa5652a2f8e5e"/></dir><dir name="template"><dir name="mailify"><file name="mailify.phtml" hash="dffe12ecd656d8e72c1790e1b682edaf"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sarbacane_Mailify.xml" hash="544c3cadb5b2f404e51c80975beea392"/></dir></target><target name="magelocale"><dir name="es_ES"><file name="Sarbacane_Mailify.csv" hash="fcb2b869f1d2edac99fd57150d400701"/></dir><dir name="en_US"><file name="Sarbacane_Mailify.csv" hash="b915fbd09772c5cbb765b514b3891180"/></dir><dir name="de_DE"><file name="Sarbacane_Mailify.csv" hash="addfb3ceb1f5e9572d35de240b45454a"/></dir></target></contents>
70
  <compatible/>
71
+ <dependencies><required><php><min>5.0.0</min><max>8.0.0</max></php></required></dependencies>
72
  </package>
skin/adminhtml/default/default/css/Sarbacane_Mailify/mailify.css DELETED
@@ -1,107 +0,0 @@
1
- /**
2
- * Magento
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Academic Free License (AFL 3.0)
7
- * that is bundled with this package in the file LICENSE.txt.
8
- * It is also available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/afl-3.0.php
10
- * If you did not receive a copy of the license and are unable to
11
- * obtain it through the world-wide-web, please send an email
12
- * to license@magentocommerce.com so we can send you a copy immediately.
13
- *
14
- * @category Sarbacane
15
- * @package Sarbacane_Sarbacanedesktop
16
- * @author Sarbacane Software <contact@sarbacane.com>
17
- * @copyright 2015 Sarbacane Software
18
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
-
21
- #sarbacanedesktop{width:900px;margin:auto;overflow:hidden;padding-bottom:170px;}
22
- #sarbacanedesktop *{font-size:13px;color:#4C5261;line-height:22px;}
23
- #sarbacanedesktop p, #sarbacanedesktop form p{margin:0 0 8.5px;padding:0;}
24
- #sarbacanedesktop a{color:#f06800;}
25
- #sarbacanedesktop .sd_header{padding-top:20px;padding-bottom:20px;}
26
- #sarbacanedesktop .sd_logo_sarbacane, #sarbacanedesktop .sd_logo_mailify, #sarbacanedesktop .sd_picto1, #sarbacanedesktop .sd_picto2, #sarbacanedesktop .sd_picto3, #sarbacanedesktop .sd_picto4, #sarbacanedesktop .sd_info_container_left > div > div > p, #sarbacanedesktop .sd_info_line,#sarbacanedesktop .sd_step_line, #sarbacanedesktop .sd_step2_info, #sarbacanedesktop .sd_info_container_right{background-repeat:no-repeat;background-image:url('../../images/sd.png');}
27
- #sarbacanedesktop .sd_logo_sarbacane{margin:auto;width:318px;height:45px;background-position:-150px -99px;}
28
- #sarbacanedesktop .sd_logo_mailify{margin:auto;width:192px;height:55px;background-position:-469px -98px;}
29
- #sarbacanedesktop .sd_separator{border-top:1px solid #ebedf2;padding-bottom:5px;margin-top:5px;}
30
- #sarbacanedesktop .sd_title{font-size:23px;text-align:center;}
31
- #sarbacanedesktop .sd_title_separator_page, #sarbacanedesktop .sd_title_separator_account_offer{border-top:2px solid #f06800;width:75px;margin:auto;}
32
- #sarbacanedesktop .sd_title_separator_account_offer{margin-top:15px;padding-bottom:20px;}
33
- #sarbacanedesktop .sd_title_separator_page{margin-top:25px;padding-bottom:35px;}
34
- #sarbacanedesktop .sd_picto1, #sarbacanedesktop .sd_picto2, #sarbacanedesktop .sd_picto3, #sarbacanedesktop .sd_picto4{width:72px;height:72px;margin-bottom:20px;}
35
- #sarbacanedesktop .sd_picto1{background-position: 0px 0px;}
36
- #sarbacanedesktop .sd_picto2{background-position: -73px 0px;}
37
- #sarbacanedesktop .sd_picto3{background-position: 0px -73px;}
38
- #sarbacanedesktop .sd_picto4{background-position: -73px -73px;}
39
- #sarbacanedesktop .sd_long_subtitle{font-size:16px;width:150px;}
40
- #sarbacanedesktop .sd_short_subtitle{font-size:16px;width:120px;}
41
- #sarbacanedesktop .sd_subtitle_separator{border-top:2px solid #f06800;width:75px;margin-top:15px;padding-bottom:20px;}
42
- #sarbacanedesktop .sd_video_config_container{overflow:hidden;padding-bottom:10px;}
43
- #sarbacanedesktop .sd_video_container{float:left;width:610px;}
44
- #sarbacanedesktop .sd_config_container{float:left;width:270px;}
45
- #sarbacanedesktop .sd_config_container p{font-weight:bold;font-size:15px;line-height:25px;}
46
- #sarbacanedesktop .sd_config_container .sd_config_button{display:block;padding:7px;width:100%;background:#78a13a;text-align:center;cursor:pointer;margin-top:20px;color:white;text-decoration:none;border:none;}
47
- #sarbacanedesktop .sd_detail_description_container{overflow:hidden;padding-bottom:55px;padding-top:25px;}
48
- #sarbacanedesktop .sd_detail_description_container > div{overflow:hidden;}
49
- #sarbacanedesktop .sd_detail_description_container > div > div{float:left;width:225px;}
50
- #sarbacanedesktop .sd_detail_description_container > div > div > div{padding:0px 15px;}
51
- #sarbacanedesktop p.sd_info_title{font-weight:bold;font-size:15px;padding-bottom:10px;}
52
- #sarbacanedesktop .sd_info_container{overflow:hidden;padding-top:30px;}
53
- #sarbacanedesktop .sd_info_container *{font-size:14px;}
54
- #sarbacanedesktop .sd_info_container_left{float:left;width:620px;}
55
- #sarbacanedesktop .sd_info_container_right{float:left;width:270px;background-position:-678px -101px;}
56
- #sarbacanedesktop .sd_info_container_left > div{padding:0px 30px;}
57
- #sarbacanedesktop .sd_info_container_right > div{padding-left:30px;}
58
- #sarbacanedesktop .sd_info_container_left > div > div > p{padding-left:35px;background-position:-680px -50px;}
59
- #sarbacanedesktop .sd_account_offer_container{padding-top:60px;}
60
- #sarbacanedesktop .sd_account{color:#5b8217;font-weight:bold;font-size:19px;text-align:center;}
61
- #sarbacanedesktop .sd_offer{text-transform:uppercase;font-weight:bold;text-align:center;color:#9c9898;font-size:14px;}
62
- #sarbacanedesktop #sd_step{height:100px;}
63
- #sarbacanedesktop .sd_step{background:#404040;padding-top:50px;display:none;}
64
- #sarbacanedesktop .sd_show_step{display:block;}
65
- #sarbacanedesktop .sd_step *{color:white;}
66
- #sarbacanedesktop .sd_step .sd_step_buttons a {color: #f06800;text-decoration:underline;}
67
- #sarbacanedesktop .sd_step_title{font-size:28px;text-align:center;}
68
- #sarbacanedesktop .sd_step_line{width:529px;height:32px;margin:auto;margin-top:55px;margin-bottom:30px;}
69
- #sarbacanedesktop #sd_step1 .sd_step_line{background-position:-147px 2px;}
70
- #sarbacanedesktop #sd_step2 .sd_step_line{background-position:-147px -30px;}
71
- #sarbacanedesktop #sd_step3 .sd_step_line{background-position:-147px -61px;}
72
- #sarbacanedesktop .sd_step_buttons{background:#363636;padding:15px;overflow:hidden;}
73
- #sarbacanedesktop .sd_step_buttons_left{float:left;width:340px;text-align:left;}
74
- #sarbacanedesktop .sd_step_buttons_right{float:right;width:340px;text-align:right;}
75
- #sarbacanedesktop .sd_step3_right{float:right;width:340px;text-align:right;padding-top:10px;}
76
- #sarbacanedesktop .sd_step_buttons input[type="button"], #sarbacanedesktop .sd_step_buttons input[type="submit"], #sarbacanedesktop input[type="submit"].sd_key_button,.sd_button{color:white;padding:10px 20px;border:none;cursor:pointer;}
77
- #sarbacanedesktop .sd_step_buttons .sd_step_buttons_left input[type="button"], #sarbacanedesktop input[type="submit"].sd_key_button{background:#808080;}
78
- #sarbacanedesktop .sd_step_buttons .sd_step_buttons_right input[type="submit"],.sd_button{background:#78a13a;}
79
- #sarbacanedesktop .sd_step1_instruction, #sarbacanedesktop .sd_step2_instruction{font-size:16px;text-align:center;}
80
- #sarbacanedesktop .sd_step1_selection{padding:10px 0px;text-align:center;}
81
- #sarbacanedesktop .sd_step1_selection span{padding:0 20px;}
82
- #sarbacanedesktop .sd_step1_selection label{font-size:16px;font-weight:normal;}
83
- #sarbacanedesktop .sd_step1_button{visibility:hidden;}
84
- #sarbacanedesktop .sd_step2_selection{padding-bottom:45px;}
85
- #sarbacanedesktop .sd_step2_selection_list{width:530px;margin:auto;}
86
- #sarbacanedesktop .sd_step2_selection_shop_title{font-size:16px;padding-top:20px;padding-bottom:5px;border-bottom:1px solid #636363;}
87
- #sarbacanedesktop .sd_step2_selection_shop{overflow:hidden;padding:3px 0px;}
88
- #sarbacanedesktop .sd_step2_selection_shop_option{overflow:hidden;padding-left:25px;}
89
- #sarbacanedesktop .sd_step2_selection_shop_option .sd_step2_selection_shop_text{float:left;width:auto;}
90
- #sarbacanedesktop .sd_step2_info{float:left;width:19px;height:19px;margin-left:10px;cursor:pointer;background-position:-682px 0;}
91
- #sarbacanedesktop .sd_step2_selection_shop_input{float:left;width:25px;}
92
- #sarbacanedesktop .sd_step2_selection_shop_text{float:left;width:475px;}
93
- #sarbacanedesktop .sd_step3_instruction{width:750px;margin:auto;}
94
- #sarbacanedesktop .sd_step3_instruction a{text-decoration:underline;}
95
- #sarbacanedesktop .sd_step3_instruction .sd_key_button_container{text-align:right;padding-top:30px;padding-bottom:50px;}
96
- #sarbacanedesktop .sd_step3_instruction p, #sarbacanedesktop .sd_step3_instruction a{font-size:16px;}
97
- #sarbacanedesktop .sd_key_container{padding-top:15px;}
98
- #sarbacanedesktop .sd_key_container input{cursor:auto;color:black;width:732px;line-height:35px;height:35px;background-color:#dff0d8;border:1px solid #5aab13;padding:0px 8px;border-radius:0px;box-sizing:content-box;box-shadow:none;}
99
- #sarbacanedesktop label{width:auto;padding:0;float:none;margin:0;display:inline;text-shadow:none;}
100
- #sarbacanedesktop input{vertical-align:baseline;margin:0;padding:0;}
101
- #sarbacanedesktop .sd_tooltip{position:relative;display:none;}
102
- #sarbacanedesktop .sd_tooltip_show{display:block;}
103
- #sarbacanedesktop .sd_tooltip *{font-size:11px;line-height:13px;}
104
- #sarbacanedesktop .sd_tooltip div{background:#858585;border:1px solid white;position:absolute;right:15px;width:360px;bottom:25px;padding:20px;}
105
- .HIDDEN{
106
- display:none;
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/adminhtml/default/default/images/{sd.png → mailify.png} RENAMED
File without changes
skin/adminhtml/default/default/js/Sarbacane_Mailify/mailify.js DELETED
@@ -1,95 +0,0 @@
1
- /**
2
- * Magento
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Academic Free License (AFL 3.0)
7
- * that is bundled with this package in the file LICENSE.txt.
8
- * It is also available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/afl-3.0.php
10
- * If you did not receive a copy of the license and are unable to
11
- * obtain it through the world-wide-web, please send an email
12
- * to license@magentocommerce.com so we can send you a copy immediately.
13
- *
14
- * @category Sarbacane
15
- * @package Sarbacane_Sarbacanedesktop
16
- * @author Sarbacane Software <contact@sarbacane.com>
17
- * @copyright 2015 Sarbacane Software
18
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
- */
20
-
21
- function changeOptionOrdersData(id_shop_c, value) {
22
- if(value == true) {
23
- document.getElementById('id_shop_' + id_shop_c).value=id_shop_c + '1';
24
- }
25
- else {
26
- document.getElementById('id_shop_' + id_shop_c).value=id_shop_c + '0';
27
- }
28
- }
29
-
30
- function changeOptionOrdersDataDisplay(id_shop_c, value) {
31
- if(value == true) {
32
- document.getElementById('customer_data_' + id_shop_c).disabled=false;
33
- document.getElementById('id_shop_' + id_shop_c).value=id_shop_c + '0';
34
-
35
- }
36
- else {
37
- document.getElementById('id_shop_' + id_shop_c).value='';
38
- document.getElementById('customer_data_' + id_shop_c).disabled=true;
39
- document.getElementById('customer_data_' + id_shop_c).checked=false;
40
- }
41
- }
42
-
43
- function sdUserYesNoDisplayButton(user_selection) {
44
- Element.removeClassName("sd_step1 .sd_button","sd_step1_button");
45
- }
46
-
47
- function sdDisplayStep(step) {
48
- var otherSteps = $$(".sd_step");
49
- if(otherSteps != null && otherSteps.length > 0 ){
50
- otherSteps.each(function(item,i){
51
- Element.removeClassName(item,"sd_show_step");
52
- });
53
- }
54
- Element.addClassName("sd_step"+step,"sd_show_step");
55
- window.location.href = '#sd_step';
56
- }
57
-
58
- function sdInfoDataOrdersHover(id_shop_c) {
59
- Element.addClassName('sd_tooltip_' + id_shop_c,"sd_tooltip_show");
60
- }
61
-
62
- function sdInfoDataOrdersOut(id_shop_c) {
63
- Element.removeClassName('sd_tooltip_' + id_shop_c,"sd_tooltip_show");
64
- // $('#sd_tooltip_' + id_shop_c).removeClass('sd_tooltip_show');
65
- }
66
-
67
- function sdInfoDataOrdersClick(id_shop_c) {
68
- Element.toggleClassName('sd_tooltip_' + id_shop_c,"sd_tooltip_show");
69
- // $('#sd_tooltip_' + id_shop_c).toggleClass('sd_tooltip_show');
70
- }
71
- var isAlreadyUser = false;
72
- function showStep2(){
73
- if($(sd_user_click_yes).checked){
74
- $(sd_step1).removeClassName("sd_show_step");
75
- $(sd_step2).addClassName("sd_show_step");
76
- $("3_step_block").hide();
77
- isAlreadyUser = true;
78
- }else{
79
- if($(sd_user_click_no).checked){
80
- $(sd_step1).removeClassName("sd_show_step");
81
- $(sd_step2).addClassName("sd_show_step");
82
- $("1_step_block").hide();
83
- }else{
84
- }
85
- }
86
- }
87
- function showStep3(){
88
- $(sd_step2).removeClassName("sd_show_step");
89
- $(sd_step3).addClassName("sd_show_step");
90
- if(isAlreadyUser){
91
- $("3_step_block").hide();
92
- }else{
93
- $("1_step_block").hide();
94
- }
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/adminhtml/default/default/mailify.css ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * @category Sarbacane
15
+ * @package Sarbacane_Mailify
16
+ * @author Sarbacane Software <contact@sarbacane.com>
17
+ * @copyright 2015 Sarbacane Software
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ #mailify{width:900px;margin:auto;overflow:hidden;padding-bottom:170px;}
22
+ #mailify *{font-size:13px;color:#4C5261;line-height:22px;}
23
+ #mailify p, #mailify form p{margin:0 0 8.5px;padding:0;}
24
+ #mailify a{color:#f06800;}
25
+ #mailify .sd_header{padding-top:20px;padding-bottom:20px;}
26
+ #mailify .sd_logo_sarbacane, #mailify .sd_logo_mailify, #mailify .sd_picto1, #mailify .sd_picto2, #mailify .sd_picto3, #mailify .sd_picto4, #mailify .sd_info_container_left > div > div > p, #mailify .sd_info_line,#mailify .sd_step_line, #mailify .sd_step2_info, #mailify .sd_info_container_right{background-repeat:no-repeat;background-image:url('images/mailify.png');}
27
+ #mailify .sd_logo_sarbacane{margin:auto;width:318px;height:45px;background-position:-150px -99px;}
28
+ #mailify .sd_logo_mailify{margin:auto;width:192px;height:55px;background-position:-469px -98px;}
29
+ #mailify .sd_separator{border-top:1px solid #ebedf2;padding-bottom:5px;margin-top:5px;}
30
+ #mailify .sd_title{font-size:23px;text-align:center;}
31
+ #mailify .sd_title_separator_page, #mailify .sd_title_separator_account_offer{border-top:2px solid #f06800;width:75px;margin:auto;}
32
+ #mailify .sd_title_separator_account_offer{margin-top:15px;padding-bottom:20px;}
33
+ #mailify .sd_title_separator_page{margin-top:25px;padding-bottom:35px;}
34
+ #mailify .sd_picto1, #mailify .sd_picto2, #mailify .sd_picto3, #mailify .sd_picto4{width:72px;height:72px;margin-bottom:20px;}
35
+ #mailify .sd_picto1{background-position: 0px 0px;}
36
+ #mailify .sd_picto2{background-position: -73px 0px;}
37
+ #mailify .sd_picto3{background-position: 0px -73px;}
38
+ #mailify .sd_picto4{background-position: -73px -73px;}
39
+ #mailify .sd_long_subtitle{font-size:16px;width:150px;}
40
+ #mailify .sd_short_subtitle{font-size:16px;width:120px;}
41
+ #mailify .sd_subtitle_separator{border-top:2px solid #f06800;width:75px;margin-top:15px;padding-bottom:20px;}
42
+ #mailify .sd_video_config_container{overflow:hidden;padding-bottom:10px;}
43
+ #mailify .sd_video_container{float:left;width:610px;}
44
+ #mailify .sd_config_container{float:left;width:270px;}
45
+ #mailify .sd_config_container p{font-weight:bold;font-size:15px;line-height:25px;}
46
+ #mailify .sd_config_container .sd_config_button{display:block;padding:7px;width:100%;background:#78a13a;text-align:center;cursor:pointer;margin-top:20px;color:white;text-decoration:none;border:none;}
47
+ #mailify .sd_detail_description_container{overflow:hidden;padding-bottom:55px;padding-top:25px;}
48
+ #mailify .sd_detail_description_container > div{overflow:hidden;}
49
+ #mailify .sd_detail_description_container > div > div{float:left;width:225px;}
50
+ #mailify .sd_detail_description_container > div > div > div{padding:0px 15px;}
51
+ #mailify p.sd_info_title{font-weight:bold;font-size:15px;padding-bottom:10px;}
52
+ #mailify .sd_info_container{overflow:hidden;padding-top:30px;}
53
+ #mailify .sd_info_container *{font-size:14px;}
54
+ #mailify .sd_info_container_left{float:left;width:620px;}
55
+ #mailify .sd_info_container_right{float:left;width:270px;background-position:-678px -101px;}
56
+ #mailify .sd_info_container_left > div{padding:0px 30px;}
57
+ #mailify .sd_info_container_right > div{padding-left:30px;}
58
+ #mailify .sd_info_container_left > div > div > p{padding-left:35px;background-position:-680px -50px;}
59
+ #mailify .sd_account_offer_container{padding-top:60px;}
60
+ #mailify .sd_account{color:#5b8217;font-weight:bold;font-size:19px;text-align:center;}
61
+ #mailify .sd_offer{text-transform:uppercase;font-weight:bold;text-align:center;color:#9c9898;font-size:14px;}
62
+ #mailify #sd_step{height:100px;}
63
+ #mailify .sd_step{background:#404040;padding-top:50px;display:none;}
64
+ #mailify .sd_show_step{display:block;}
65
+ #mailify .sd_step *{color:white;}
66
+ #mailify .sd_step .sd_step_buttons a {color: #f06800;text-decoration:underline;}
67
+ #mailify .sd_step_title{font-size:28px;text-align:center;}
68
+ #mailify .sd_step_line{width:529px;height:32px;margin:auto;margin-top:55px;margin-bottom:30px;}
69
+ #mailify #sd_step1 .sd_step_line{background-position:-147px 2px;}
70
+ #mailify #sd_step2 .sd_step_line{background-position:-147px -30px;}
71
+ #mailify #sd_step3 .sd_step_line{background-position:-147px -61px;}
72
+ #mailify .sd_step_buttons{background:#363636;padding:15px;overflow:hidden;}
73
+ #mailify .sd_step_buttons_left{float:left;width:340px;text-align:left;}
74
+ #mailify .sd_step_buttons_right{float:right;width:340px;text-align:right;}
75
+ #mailify .sd_step3_right{float:right;width:340px;text-align:right;padding-top:10px;}
76
+ #mailify .sd_step_buttons input[type="button"], #mailify .sd_step_buttons input[type="submit"], #mailify input[type="submit"].sd_key_button, #mailify .sd_button{color:white;padding:10px 20px;border:none;cursor:pointer;}
77
+ #mailify .sd_step_buttons .sd_step_buttons_left input[type="button"], #mailify input[type="submit"].sd_key_button{background:#808080;}
78
+ #mailify .sd_step_buttons .sd_step_buttons_right input[type="submit"], #mailify .sd_button{background:#78a13a;}
79
+ #mailify .sd_step1_instruction, #mailify .sd_step2_instruction{font-size:16px;text-align:center;}
80
+ #mailify .sd_step1_selection{padding:10px 0px;text-align:center;}
81
+ #mailify .sd_step1_selection span{padding:0 20px;}
82
+ #mailify .sd_step1_selection label{font-size:16px;font-weight:normal;}
83
+ #mailify .sd_step1_button{visibility:hidden;}
84
+ #mailify .sd_step2_selection{padding-bottom:45px;}
85
+ #mailify .sd_step2_selection_list{width:530px;margin:auto;}
86
+ #mailify .sd_step2_selection_shop_title{font-size:16px;padding-top:20px;padding-bottom:5px;border-bottom:1px solid #636363;}
87
+ #mailify .sd_step2_selection_shop{overflow:hidden;padding:3px 0px;}
88
+ #mailify .sd_step2_selection_shop_option{overflow:hidden;padding-left:25px;}
89
+ #mailify .sd_step2_selection_shop_option .sd_step2_selection_shop_text{float:left;width:auto;}
90
+ #mailify .sd_step2_info{float:left;width:19px;height:19px;margin-left:10px;cursor:pointer;background-position:-682px 0;}
91
+ #mailify .sd_step2_selection_shop_input{float:left;width:25px;}
92
+ #mailify .sd_step2_selection_shop_text{float:left;width:475px;}
93
+ #mailify .sd_step3_instruction{width:750px;margin:auto;}
94
+ #mailify .sd_step3_instruction a{text-decoration:underline;}
95
+ #mailify .sd_step3_instruction .sd_key_button_container{text-align:right;padding-top:30px;padding-bottom:50px;}
96
+ #mailify .sd_step3_instruction p, #mailify .sd_step3_instruction a{font-size:16px;}
97
+ #mailify .sd_key_container{padding-top:15px;}
98
+ #mailify .sd_key_container input{cursor:auto;color:black;width:732px;line-height:35px;height:35px;background-color:#dff0d8;border:1px solid #5aab13;padding:0px 8px;border-radius:0px;box-sizing:content-box;box-shadow:none;}
99
+ #mailify label{width:auto;padding:0;float:none;margin:0;display:inline;text-shadow:none;}
100
+ #mailify input{vertical-align:baseline;margin:0;padding:0;}
101
+ #mailify .sd_tooltip{position:relative;display:none;}
102
+ #mailify .sd_tooltip_show{display:block;}
103
+ #mailify .sd_tooltip *{font-size:11px;line-height:13px;}
104
+ #mailify .sd_tooltip div{background:#858585;border:1px solid white;position:absolute;right:15px;width:360px;bottom:25px;padding:20px;}
105
+ #mailify .sd_hidden{display:none;}
skin/adminhtml/default/default/mailify.js ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * @category Sarbacane
15
+ * @package Sarbacane_Mailify
16
+ * @author Sarbacane Software <contact@sarbacane.com>
17
+ * @copyright 2015 Sarbacane Software
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ function changeOptionOrdersData(id_shop_c, value) {
22
+ if (value == true) {
23
+ document.getElementById('id_shop_' + id_shop_c).value = id_shop_c + '1';
24
+ }
25
+ else {
26
+ document.getElementById('id_shop_' + id_shop_c).value = id_shop_c + '0';
27
+ }
28
+ }
29
+
30
+ function changeOptionOrdersDataDisplay(id_shop_c, value) {
31
+ if (value == true) {
32
+ document.getElementById('customer_data_' + id_shop_c).disabled = false;
33
+ document.getElementById('id_shop_' + id_shop_c).value=id_shop_c + '0';
34
+
35
+ }
36
+ else {
37
+ document.getElementById('id_shop_' + id_shop_c).value='';
38
+ document.getElementById('customer_data_' + id_shop_c).disabled = true;
39
+ document.getElementById('customer_data_' + id_shop_c).checked = false;
40
+ }
41
+ }
42
+
43
+ function sdUserYesNoDisplayButton(user_selection) {
44
+ Element.removeClassName('sd_step1 .sd_button', 'sd_step1_button');
45
+ }
46
+
47
+ function sdDisplaySteps() {
48
+ window.location.href = '#sd_step';
49
+ }
50
+
51
+ function sdDisplayStep(step) {
52
+ $$('.sd_step').each(function(item) {
53
+ Element.removeClassName(item, 'sd_show_step');
54
+ });
55
+ Element.addClassName('sd_step' + step, 'sd_show_step');
56
+ window.location.href = '#sd_step';
57
+ }
58
+
59
+ function sdInfoDataOrdersHover(id_shop_c) {
60
+ Element.addClassName('sd_tooltip_' + id_shop_c, 'sd_tooltip_show');
61
+ }
62
+
63
+ function sdInfoDataOrdersOut(id_shop_c) {
64
+ Element.removeClassName('sd_tooltip_' + id_shop_c, 'sd_tooltip_show');
65
+ }
66
+
67
+ function sdInfoDataOrdersClick(id_shop_c) {
68
+ Element.toggleClassName('sd_tooltip_' + id_shop_c, 'sd_tooltip_show');
69
+ }
70
+
71
+ function sdErrorTryReinstall() {
72
+ Element.addClassName('sd_error_try_reinstall', 'sd_hidden');
73
+ Element.removeClassName('sd_error_try_reinstall_inactive', 'sd_hidden');
74
+ }