Remarkety_Mgconnector - Version 1.4.9.0

Version Notes

No comments

Download this release

Release Info

Developer Remarkety
Extension Remarkety_Mgconnector
Version 1.4.9.0
Comparing to
See all releases


Code changes from version 1.4.8.8 to 1.4.9.0

Files changed (68) hide show
  1. CHANGELOG.txt +5 -0
  2. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration.php +24 -24
  3. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete.php +37 -35
  4. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete/Form.php +71 -61
  5. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration.php +45 -41
  6. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration/Form.php +71 -63
  7. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install.php +37 -35
  8. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install/Form.php +107 -89
  9. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade.php +37 -35
  10. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade/Form.php +84 -70
  11. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete.php +39 -37
  12. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete/Form.php +72 -62
  13. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create.php +33 -33
  14. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create/Form.php +169 -139
  15. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login.php +33 -33
  16. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login/Form.php +143 -129
  17. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade.php +39 -37
  18. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade/Form.php +73 -61
  19. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome.php +41 -39
  20. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Form.php +61 -55
  21. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Store.php +2 -1
  22. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue.php +24 -24
  23. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure.php +38 -38
  24. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure/Form.php +144 -125
  25. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid.php +132 -116
  26. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid/Column/Renderer/EventType.php +29 -28
  27. app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid/Column/Renderer/Status.php +25 -25
  28. app/code/community/Remarkety/Mgconnector/Block/Tracking/Base.php +6 -3
  29. app/code/community/Remarkety/Mgconnector/Block/Tracking/General.php +1 -1
  30. app/code/community/Remarkety/Mgconnector/Block/Tracking/Product.php +10 -4
  31. app/code/community/Remarkety/Mgconnector/Helper/Configuration.php +4 -2
  32. app/code/community/Remarkety/Mgconnector/Helper/Data.php +5 -3
  33. app/code/community/Remarkety/Mgconnector/Helper/Links.php +3 -1
  34. app/code/community/Remarkety/Mgconnector/Helper/Urls.php +5 -3
  35. app/code/community/Remarkety/Mgconnector/Model/Core/Api.php +119 -52
  36. app/code/community/Remarkety/Mgconnector/Model/Extension/RewardPoints/MagestoreRewardPoints.php +2 -1
  37. app/code/community/Remarkety/Mgconnector/Model/Install.php +505 -486
  38. app/code/community/Remarkety/Mgconnector/Model/Observer.php +1 -1
  39. app/code/community/Remarkety/Mgconnector/Model/Queue.php +16 -16
  40. app/code/community/Remarkety/Mgconnector/Model/Recovery.php +5 -2
  41. app/code/community/Remarkety/Mgconnector/Model/Request.php +8 -3
  42. app/code/community/Remarkety/Mgconnector/Model/Resource/Queue.php +18 -30
  43. app/code/community/Remarkety/Mgconnector/Model/Resource/Queue/Collection.php +18 -30
  44. app/code/community/Remarkety/Mgconnector/Model/Resource/Rule/Collection.php +8 -5
  45. app/code/community/Remarkety/Mgconnector/Model/Resource/Setup.php +13 -13
  46. app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/ConfigureController.php +67 -55
  47. app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/Extension/AbstractController.php +12 -0
  48. app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/InstallController.php +202 -186
  49. app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/MgconnectorController.php +17 -3
  50. app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/QueueController.php +159 -143
  51. app/code/community/Remarkety/Mgconnector/controllers/RecoveryController.php +0 -1
  52. app/code/community/Remarkety/Mgconnector/controllers/WebtrackingController.php +4 -2
  53. app/code/community/Remarkety/Mgconnector/etc/config.xml +1 -1
  54. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-install-1.0.0.13.php +28 -26
  55. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.13-1.0.0.14.php +28 -26
  56. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.14-1.0.0.15.php +13 -13
  57. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.14-1.1.0.0.php +13 -13
  58. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.0.5-1.1.0.6.php +1 -1
  59. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.8-1.1.2.9.php +23 -0
  60. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.8-1.3.0.0.php +5 -3
  61. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.9-1.1.3.0.php +22 -0
  62. app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.4.7.2-1.4.8.0.php +5 -3
  63. app/design/adminhtml/default/default/template/mgconnector/extension/rewardpoints.phtml +1 -1
  64. app/design/adminhtml/default/default/template/mgconnector/install/welcome/store.phtml +2 -2
  65. app/design/frontend/base/default/template/mgconnector/tracking/general.phtml +3 -2
  66. app/design/frontend/base/default/template/mgconnector/tracking/product_view.phtml +1 -1
  67. app/etc/modules/Remarkety_Mgconnector.xml +0 -0
  68. package.xml +5 -5
CHANGELOG.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  1.4.8.7
2
  -------
3
  - Bugfix - Support PHP version 5.3
1
+ 1.4.8.8
2
+ -------
3
+ - Bugfix - Install timeout increase
4
+ - Bugfix - Trigger event after cache cleared
5
+
6
  1.4.8.7
7
  -------
8
  - Bugfix - Support PHP version 5.3
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration extends Mage_Adminhtml_Block_Widget_Grid_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- $this->_blockGroup = 'mgconnector';
18
- $this->_controller = 'adminhtml_configuration';
19
- $this->_headerText = Mage::helper('mgconnector')->__('Remarkety Configuration');
20
- $this->_removeButton('add');
21
-
22
- parent::__construct();
23
- }
24
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration extends Mage_Adminhtml_Block_Widget_Grid_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ $this->_blockGroup = 'mgconnector';
18
+ $this->_controller = 'adminhtml_configuration';
19
+ $this->_headerText = Mage::helper('mgconnector')->__('Remarkety Configuration');
20
+ $this->_removeButton('add');
21
+
22
+ parent::__construct();
23
+ }
24
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete.php CHANGED
@@ -1,35 +1,37 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration complete block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Complete extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'complete_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_configuration';
22
- $this->_mode = 'complete';
23
-
24
- $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
- $this->_headerText = $this->__('Install Complete (version: %s)', $ver);
26
-
27
- $this->_removeButton('back');
28
- $this->_removeButton('reset');
29
- $this->_addButton('save', array(
30
- 'label' => Mage::helper('adminhtml')->__('Done'),
31
- 'onclick' => 'editForm.submit();',
32
- 'class' => 'save',
33
- ), 1);
34
- }
35
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration complete block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Complete extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'complete_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_configuration';
22
+ $this->_mode = 'complete';
23
+
24
+ $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
+ $this->_headerText = $this->__('Install Complete (version: %s)', $ver);
26
+
27
+ $this->_removeButton('back');
28
+ $this->_removeButton('reset');
29
+ $this->_addButton(
30
+ 'save', array(
31
+ 'label' => Mage::helper('adminhtml')->__('Done'),
32
+ 'onclick' => 'editForm.submit();',
33
+ 'class' => 'save',
34
+ ), 1
35
+ );
36
+ }
37
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete/Form.php CHANGED
@@ -1,62 +1,72 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration complete form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Complete_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/*/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Installation Complete')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'complete',
38
- ));
39
-
40
- $instruction = $fieldset->addField('instruction', 'note', array(
41
- 'text' => '',
42
- 'label' => false,
43
- 'after_element_html' => '<p style="font-weight:bold;">' . $this->__('Installation complete!') . '</p>'
44
- ));
45
- $instruction->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
46
-
47
- $response = unserialize(Mage::getStoreConfig('remarkety/mgconnector/last_response'),true);
48
- $fieldset->addField('response', 'note', array(
49
- 'label' => false,
50
- 'after_element_html' => !empty($response['info']) ? $response['info'] : $this->__('There is no response to display')
51
- ));
52
-
53
- $fieldset->addField('button', 'note', array(
54
- 'label' => false,
55
- 'name' => 'button',
56
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
57
- . $this->__('Done') . '</span></span></button>'
58
- ));
59
-
60
- return parent::_prepareForm();
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration complete form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Complete_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Installation Complete')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'complete',
41
+ )
42
+ );
43
+
44
+ $instruction = $fieldset->addField(
45
+ 'instruction', 'note', array(
46
+ 'text' => '',
47
+ 'label' => false,
48
+ 'after_element_html' => '<p style="font-weight:bold;">' . $this->__('Installation complete!') . '</p>'
49
+ )
50
+ );
51
+ $instruction->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
52
+
53
+ $response = unserialize(Mage::getStoreConfig('remarkety/mgconnector/last_response'), true);
54
+ $fieldset->addField(
55
+ 'response', 'note', array(
56
+ 'label' => false,
57
+ 'after_element_html' => !empty($response['info']) ? $response['info'] : $this->__('There is no response to display')
58
+ )
59
+ );
60
+
61
+ $fieldset->addField(
62
+ 'button', 'note', array(
63
+ 'label' => false,
64
+ 'name' => 'button',
65
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
66
+ . $this->__('Done') . '</span></span></button>'
67
+ )
68
+ );
69
+
70
+ return parent::_prepareForm();
71
+ }
72
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration.php CHANGED
@@ -1,41 +1,45 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration configuration block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Configuration extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'configuration_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_configuration';
22
- $this->_mode = 'configuration';
23
-
24
- $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
- $this->_headerText = $this->__('Remarkety configuration (version: %s)', $ver);
26
-
27
- $this->_removeButton('back');
28
- $this->_removeButton('reset');
29
- $this->_addButton('save', array(
30
- 'label' => Mage::helper('adminhtml')->__('Save'),
31
- 'onclick' => 'editForm.submit();',
32
- 'class' => 'save',
33
- ), 1);
34
-
35
- $this->_addButton('reinstall', array(
36
- 'label' => Mage::helper('adminhtml')->__('Reinstall'),
37
- 'onclick' => "return confirm('Are you sure?') ? window.location = '" . $this->getUrl('*/*/reinstall')."' : false;",
38
- 'class' => 'delete',
39
- ), 0);
40
- }
41
- }
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration configuration block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Configuration extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'configuration_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_configuration';
22
+ $this->_mode = 'configuration';
23
+
24
+ $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
+ $this->_headerText = $this->__('Remarkety configuration (version: %s)', $ver);
26
+
27
+ $this->_removeButton('back');
28
+ $this->_removeButton('reset');
29
+ $this->_addButton(
30
+ 'save', array(
31
+ 'label' => Mage::helper('adminhtml')->__('Save'),
32
+ 'onclick' => 'editForm.submit();',
33
+ 'class' => 'save',
34
+ ), 1
35
+ );
36
+
37
+ $this->_addButton(
38
+ 'reinstall', array(
39
+ 'label' => Mage::helper('adminhtml')->__('Reinstall'),
40
+ 'onclick' => "return confirm('Are you sure?') ? window.location = '" . $this->getUrl('*/*/reinstall')."' : false;",
41
+ 'class' => 'delete',
42
+ ), 0
43
+ );
44
+ }
45
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration/Form.php CHANGED
@@ -1,64 +1,72 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration configuration form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Configuration_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/*/configuration'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Remarkety configuration')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'configuration',
38
- ));
39
-
40
- $fieldset->addField('intervals', 'text', array(
41
- 'label' => $this->__('Intervals:'),
42
- 'name' => 'data[intervals]',
43
- 'required' => false,
44
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
45
- 'Here you have to type amount of minutes separated by commas.For example "1,3,10" -
46
- it means that second attempt will be after 1 minute, third after 3 minutes,
47
- and fourth after 10 minutes.If last attempt will not be successful,
48
- status will be changed to "failed" and it will not be processed anymore.'
49
- ) . '</small>',
50
- 'value' => Mage::getStoreConfig('remarkety/mgconnector/intervals'),
51
- 'style' => 'float:left',
52
- ));
53
-
54
- $button = $fieldset->addField('button', 'note', array(
55
- 'label' => false,
56
- 'name' => 'button',
57
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
58
- . $this->__('Save') . '</span></span></button>',
59
- ));
60
- $button->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
61
-
62
- return parent::_prepareForm();
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration configuration form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Configuration_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/configuration'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Remarkety configuration')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'configuration',
41
+ )
42
+ );
43
+
44
+ $fieldset->addField(
45
+ 'intervals', 'text', array(
46
+ 'label' => $this->__('Intervals:'),
47
+ 'name' => 'data[intervals]',
48
+ 'required' => false,
49
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
50
+ 'Here you have to type amount of minutes separated by commas.For example "1,3,10" -
51
+ it means that second attempt will be after 1 minute, third after 3 minutes,
52
+ and fourth after 10 minutes.If last attempt will not be successful,
53
+ status will be changed to "failed" and it will not be processed anymore.'
54
+ ) . '</small>',
55
+ 'value' => Mage::getStoreConfig('remarkety/mgconnector/intervals'),
56
+ 'style' => 'float:left',
57
+ )
58
+ );
59
+
60
+ $button = $fieldset->addField(
61
+ 'button', 'note', array(
62
+ 'label' => false,
63
+ 'name' => 'button',
64
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
65
+ . $this->__('Save') . '</span></span></button>',
66
+ )
67
+ );
68
+ $button->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
69
+
70
+ return parent::_prepareForm();
71
+ }
72
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install.php CHANGED
@@ -1,35 +1,37 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration install block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Install extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'install_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_configuration';
22
- $this->_mode = 'install';
23
-
24
- $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
- $this->_headerText = $this->__('Install Remarkety extension (version: %s)', $ver);
26
-
27
- $this->_removeButton('back');
28
- $this->_removeButton('reset');
29
- $this->_addButton('save', array(
30
- 'label' => Mage::helper('adminhtml')->__('Complete Installation'),
31
- 'onclick' => 'editForm.submit();',
32
- 'class' => 'save',
33
- ), 1);
34
- }
35
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration install block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Install extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'install_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_configuration';
22
+ $this->_mode = 'install';
23
+
24
+ $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
+ $this->_headerText = $this->__('Install Remarkety extension (version: %s)', $ver);
26
+
27
+ $this->_removeButton('back');
28
+ $this->_removeButton('reset');
29
+ $this->_addButton(
30
+ 'save', array(
31
+ 'label' => Mage::helper('adminhtml')->__('Complete Installation'),
32
+ 'onclick' => 'editForm.submit();',
33
+ 'class' => 'save',
34
+ ), 1
35
+ );
36
+ }
37
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install/Form.php CHANGED
@@ -1,90 +1,108 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration install form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Install_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/*/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Install Remarkety extension')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'install',
38
- ));
39
-
40
- $instruction = $fieldset->addField('instruction', 'note', array(
41
- 'text' => '',
42
- 'label' => false,
43
- 'after_element_html' =>
44
- '<p style="font-weight:bold;">' . $this->__('Thank you for installing the Remarkety Magento plugin.
45
- You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
46
- . '<br><br>'
47
- . $this->__('The plugin will automatically create a Magento WebService API user so that
48
- Remarkety can synchronize with your store.') . '</p>',
49
- ));
50
- $instruction->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
51
-
52
- $fieldset->addField('email', 'text', array(
53
- 'label' => $this->__('Email address for the Remarkety account:'),
54
- 'name' => 'data[email]',
55
- 'required' => true,
56
- 'class' => 'validate-email',
57
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
58
- 'If you’ve already registered to Remarkety, please use the email you used to open your account.
59
- If you haven’t, an email will be sent to this address with the login information. You will then be able
60
- to choose your password.'
61
- ) . '</small>',
62
- 'style' => 'float:left',
63
- ));
64
-
65
- $fieldset->addField('store_id', 'select', array(
66
- 'name' => 'data[store_id]',
67
- 'label' => $this->__('Sync Remarkety with this view:'),
68
- 'required' => true,
69
- 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
70
- ));
71
-
72
- $fieldset->addField('terms', 'checkbox', array(
73
- 'label' => false,
74
- 'name' => 'data[terms]',
75
- 'checked' => false,
76
- 'value' => '1',
77
- 'class' => 'required-entry',
78
- 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
79
- ));
80
-
81
- $fieldset->addField('button', 'note', array(
82
- 'label' => false,
83
- 'name' => 'button',
84
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
85
- . $this->__('Complete Installation') . '</span></span></button>'
86
- ));
87
-
88
- return parent::_prepareForm();
89
- }
90
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration install form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Install_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Install Remarkety extension')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'install',
41
+ )
42
+ );
43
+
44
+ $instruction = $fieldset->addField(
45
+ 'instruction', 'note', array(
46
+ 'text' => '',
47
+ 'label' => false,
48
+ 'after_element_html' =>
49
+ '<p style="font-weight:bold;">' . $this->__(
50
+ 'Thank you for installing the Remarkety Magento plugin.
51
+ You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!'
52
+ )
53
+ . '<br><br>'
54
+ . $this->__(
55
+ 'The plugin will automatically create a Magento WebService API user so that
56
+ Remarkety can synchronize with your store.'
57
+ ) . '</p>',
58
+ )
59
+ );
60
+ $instruction->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
61
+
62
+ $fieldset->addField(
63
+ 'email', 'text', array(
64
+ 'label' => $this->__('Email address for the Remarkety account:'),
65
+ 'name' => 'data[email]',
66
+ 'required' => true,
67
+ 'class' => 'validate-email',
68
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
69
+ 'If you’ve already registered to Remarkety, please use the email you used to open your account.
70
+ If you haven’t, an email will be sent to this address with the login information. You will then be able
71
+ to choose your password.'
72
+ ) . '</small>',
73
+ 'style' => 'float:left',
74
+ )
75
+ );
76
+
77
+ $fieldset->addField(
78
+ 'store_id', 'select', array(
79
+ 'name' => 'data[store_id]',
80
+ 'label' => $this->__('Sync Remarkety with this view:'),
81
+ 'required' => true,
82
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
83
+ )
84
+ );
85
+
86
+ $fieldset->addField(
87
+ 'terms', 'checkbox', array(
88
+ 'label' => false,
89
+ 'name' => 'data[terms]',
90
+ 'checked' => false,
91
+ 'value' => '1',
92
+ 'class' => 'required-entry',
93
+ 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
94
+ )
95
+ );
96
+
97
+ $fieldset->addField(
98
+ 'button', 'note', array(
99
+ 'label' => false,
100
+ 'name' => 'button',
101
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
102
+ . $this->__('Complete Installation') . '</span></span></button>'
103
+ )
104
+ );
105
+
106
+ return parent::_prepareForm();
107
+ }
108
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade.php CHANGED
@@ -1,35 +1,37 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration upgrade block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Upgrade extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'upgrade_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_configuration';
22
- $this->_mode = 'upgrade';
23
-
24
- $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
- $this->_headerText = $this->__('Upgrade Remarkety extension (version: %s)', $ver);
26
-
27
- $this->_removeButton('back');
28
- $this->_removeButton('reset');
29
- $this->_addButton('save', array(
30
- 'label' => Mage::helper('adminhtml')->__('Complete Installation'),
31
- 'onclick' => 'editForm.submit();',
32
- 'class' => 'save',
33
- ), 1);
34
- }
35
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration upgrade block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Upgrade extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'upgrade_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_configuration';
22
+ $this->_mode = 'upgrade';
23
+
24
+ $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
25
+ $this->_headerText = $this->__('Upgrade Remarkety extension (version: %s)', $ver);
26
+
27
+ $this->_removeButton('back');
28
+ $this->_removeButton('reset');
29
+ $this->_addButton(
30
+ 'save', array(
31
+ 'label' => Mage::helper('adminhtml')->__('Complete Installation'),
32
+ 'onclick' => 'editForm.submit();',
33
+ 'class' => 'save',
34
+ ), 1
35
+ );
36
+ }
37
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade/Form.php CHANGED
@@ -1,71 +1,85 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration upgrade form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Upgrade_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/*/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Upgrade Remarkety extension')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'upgrade',
38
- ));
39
-
40
- $instruction = $fieldset->addField('instruction', 'note', array(
41
- 'text' => '',
42
- 'label' => false,
43
- 'after_element_html' =>
44
- '<p style="font-weight:bold;">' . $this->__('Thank you for installing the Remarkety Magento plugin.
45
- You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
46
- . '<br><br>'
47
- . $this->__('It seems that you have already installed Remarkety on this website before. This
48
- version of the plugin will create a new API key, and automatically inform
49
- Remarkety. If this is a mistake, please <a href="%s">click here</a>.</p>', $this->getUrl('*/*/installation', array('mode' => 'install')))
50
- ));
51
- $instruction->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
52
-
53
- $fieldset->addField('terms', 'checkbox', array(
54
- 'label' => false,
55
- 'name' => 'data[terms]',
56
- 'checked' => false,
57
- 'value' => '1',
58
- 'class' => 'required-entry',
59
- 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
60
- ));
61
-
62
- $fieldset->addField('button', 'note', array(
63
- 'label' => false,
64
- 'name' => 'button',
65
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
66
- . $this->__('Complete Installation') . '</span></span></button>'
67
- ));
68
-
69
- return parent::_prepareForm();
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration upgrade form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Configuration_Upgrade_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Upgrade Remarkety extension')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'upgrade',
41
+ )
42
+ );
43
+
44
+ $instruction = $fieldset->addField(
45
+ 'instruction', 'note', array(
46
+ 'text' => '',
47
+ 'label' => false,
48
+ 'after_element_html' =>
49
+ '<p style="font-weight:bold;">' . $this->__(
50
+ 'Thank you for installing the Remarkety Magento plugin.
51
+ You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!'
52
+ )
53
+ . '<br><br>'
54
+ . $this->__(
55
+ 'It seems that you have already installed Remarkety on this website before. This
56
+ version of the plugin will create a new API key, and automatically inform
57
+ Remarkety. If this is a mistake, please <a href="%s">click here</a>.</p>', $this->getUrl('*/*/installation', array('mode' => 'install'))
58
+ )
59
+ )
60
+ );
61
+ $instruction->getRenderer()->setTemplate('mgconnector/widget/form/renderer/fieldset/element.phtml');
62
+
63
+ $fieldset->addField(
64
+ 'terms', 'checkbox', array(
65
+ 'label' => false,
66
+ 'name' => 'data[terms]',
67
+ 'checked' => false,
68
+ 'value' => '1',
69
+ 'class' => 'required-entry',
70
+ 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
71
+ )
72
+ );
73
+
74
+ $fieldset->addField(
75
+ 'button', 'note', array(
76
+ 'label' => false,
77
+ 'name' => 'button',
78
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
79
+ . $this->__('Complete Installation') . '</span></span></button>'
80
+ )
81
+ );
82
+
83
+ return parent::_prepareForm();
84
+ }
85
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete.php CHANGED
@@ -1,37 +1,39 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration complete block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Complete extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'complete_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_install';
22
- $this->_mode = 'complete';
23
-
24
- $this->_headerText = $this->__(
25
- 'Install Complete (version: %s)',
26
- Mage::helper('mgconnector')->getInstalledVersion()
27
- );
28
-
29
- $this->_removeButton('back');
30
- $this->_removeButton('reset');
31
- $this->_addButton('save', array(
32
- 'label' => Mage::helper('adminhtml')->__('Done'),
33
- 'onclick' => 'editForm.submit();',
34
- 'class' => 'save',
35
- ), 1);
36
- }
37
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration complete block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Complete extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'complete_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_install';
22
+ $this->_mode = 'complete';
23
+
24
+ $this->_headerText = $this->__(
25
+ 'Install Complete (version: %s)',
26
+ Mage::helper('mgconnector')->getInstalledVersion()
27
+ );
28
+
29
+ $this->_removeButton('back');
30
+ $this->_removeButton('reset');
31
+ $this->_addButton(
32
+ 'save', array(
33
+ 'label' => Mage::helper('adminhtml')->__('Done'),
34
+ 'onclick' => 'editForm.submit();',
35
+ 'class' => 'save',
36
+ ), 1
37
+ );
38
+ }
39
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete/Form.php CHANGED
@@ -1,63 +1,73 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration complete form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Complete_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/*/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Installation Complete')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'complete',
38
- ));
39
-
40
- $instruction = $fieldset->addField('instruction', 'note', array(
41
- 'text' => '',
42
- 'label' => false,
43
- 'after_element_html' => '<p style="font-weight:bold;">' . $this->__('Installation complete!') . '</p>'
44
- ));
45
- $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
46
-
47
- $response = Mage::getSingleton('core/session')->getRemarketyLastResponseMessage();
48
- $response = !empty($response) ? unserialize($response) : array();
49
- $fieldset->addField('response', 'note', array(
50
- 'label' => false,
51
- 'after_element_html' => !empty($response['info']) ? $response['info'] : $this->__('There is no response to display')
52
- ));
53
-
54
- $fieldset->addField('button', 'note', array(
55
- 'label' => false,
56
- 'name' => 'button',
57
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
58
- . $this->__('Done') . '</span></span></button>'
59
- ));
60
-
61
- return parent::_prepareForm();
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration complete form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Complete_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Installation Complete')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'complete',
41
+ )
42
+ );
43
+
44
+ $instruction = $fieldset->addField(
45
+ 'instruction', 'note', array(
46
+ 'text' => '',
47
+ 'label' => false,
48
+ 'after_element_html' => '<p style="font-weight:bold;">' . $this->__('Installation complete!') . '</p>'
49
+ )
50
+ );
51
+ $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
52
+
53
+ $response = Mage::getSingleton('core/session')->getRemarketyLastResponseMessage();
54
+ $response = !empty($response) ? unserialize($response) : array();
55
+ $fieldset->addField(
56
+ 'response', 'note', array(
57
+ 'label' => false,
58
+ 'after_element_html' => !empty($response['info']) ? $response['info'] : $this->__('There is no response to display')
59
+ )
60
+ );
61
+
62
+ $fieldset->addField(
63
+ 'button', 'note', array(
64
+ 'label' => false,
65
+ 'name' => 'button',
66
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
67
+ . $this->__('Done') . '</span></span></button>'
68
+ )
69
+ );
70
+
71
+ return parent::_prepareForm();
72
+ }
73
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml install install block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Create extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'install_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_install_install';
22
- $this->_mode = 'create';
23
-
24
- $this->_headerText = $this->__(
25
- 'Install Remarkety extension (version: %s)',
26
- Mage::helper('mgconnector')->getInstalledVersion()
27
- );
28
-
29
- $this->_removeButton('back');
30
- $this->_removeButton('reset');
31
- $this->_removeButton('save');
32
- }
33
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml install install block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Create extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'install_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_install_install';
22
+ $this->_mode = 'create';
23
+
24
+ $this->_headerText = $this->__(
25
+ 'Install Remarkety extension (version: %s)',
26
+ Mage::helper('mgconnector')->getInstalledVersion()
27
+ );
28
+
29
+ $this->_removeButton('back');
30
+ $this->_removeButton('reset');
31
+ $this->_removeButton('save');
32
+ }
33
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create/Form.php CHANGED
@@ -1,140 +1,170 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml install install form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Create_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/install/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $multipleStores = Remarkety_Mgconnector_Model_Install::isMultipleStores();
29
- $accountWithLoginUrl = $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN));
30
-
31
- $fieldset = $form->addFieldset(
32
- 'general',
33
- array(
34
- 'legend' => $this->__('Install Remarkety extension')
35
  )
36
- );
37
-
38
- $fieldset->addField('mode', 'hidden', array(
39
- 'name' => 'data[mode]',
40
- 'value' => 'install_create',
41
- ));
42
-
43
- $headingHtml =
44
- '<p><b>' . $this->__('Thank you for installing the Remarkety Magento plugin.
45
- You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
46
- . '</b><br><br>'
47
- . $this->__('The plugin will automatically create a Magento WebService API user so that
48
- Remarkety can synchronize with your store.') . '</p><hr/>'
49
- . '<h2>'.$this->__('Create a new Remarkety account') . '</h2>'
50
- . '<p>'.
51
- sprintf($this->__(
52
- 'Already registered to Remarkety? <a href="%s">Click here</a>'
53
- ), $accountWithLoginUrl)
54
- . '</p>';
55
-
56
- $instruction = $fieldset->addField('instruction', 'note', array(
57
- 'text' => '',
58
- 'label' => false,
59
- 'after_element_html' => $headingHtml,
60
-
61
- ));
62
- $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
63
-
64
- $html = '<small style="float:left;width:100%;">' . sprintf($this->__(
65
- 'Already registered to Remarkety? <a href="%s">Click here</a>'
66
- ), $accountWithLoginUrl) . '</small>';
67
-
68
- $fieldset->addField('email', 'text', array(
69
- 'label' => $this->__('Email address for the Remarkety account:'),
70
- 'name' => 'data[email]',
71
- 'required' => true,
72
- 'class' => 'validate-email',
73
- //'after_element_html' => $html,
74
- 'style' => 'float:left',
75
- ));
76
-
77
- $fieldset->addField('first_name', 'text', array(
78
- 'label' => $this->__('First Name:'),
79
- 'name' => 'data[first_name]',
80
- 'required' => true,
81
- 'class' => 'required-entry'
82
- ));
83
-
84
- $fieldset->addField('last_name', 'text', array(
85
- 'label' => $this->__('Last Name:'),
86
- 'name' => 'data[last_name]',
87
- 'required' => true,
88
- 'class' => 'required-entry'
89
- ));
90
-
91
- $fieldset->addField('phone', 'text', array(
92
- 'label' => $this->__('Phone:'),
93
- 'name' => 'data[phone]',
94
- 'required' => true,
95
- 'class' => 'required-entry'
96
- ));
97
-
98
- $fieldset->addField('password', 'password', array(
99
- 'label' => $this->__('Password:'),
100
- 'name' => 'data[password]',
101
- 'required' => true,
102
- 'class' => 'required-entry'
103
- ));
104
-
105
-
106
- $fieldset->addField('store_id', $multipleStores ? 'multiselect' : 'select', array(
107
- 'name' => 'data[store_id]',
108
- 'label' => $this->__('Sync Remarkety with this view:'),
109
- 'required' => true,
110
- 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
111
- ));
112
-
113
- $fieldset->addField('terms', 'checkbox', array(
114
- 'label' => false,
115
- 'name' => 'data[terms]',
116
- 'checked' => false,
117
- 'value' => '1',
118
- 'class' => 'required-entry',
119
- 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
120
- ));
121
-
122
- $fieldset->addField('create', 'note', array(
123
- 'label' => false,
124
- 'name' => 'button',
125
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
126
- . $this->__('Create New Account And Connect') . '</span></span></button>',
127
- ));
128
-
129
- // $fieldset->addField('login', 'note', array(
130
- // 'label' => false,
131
- // 'name' => 'button',
132
- // 'after_element_html' => '<button type="button" class="save"
133
- // onclick="window.location = \'' . $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN)) . '\'"
134
- // ><span><span>'
135
- // . $this->__('I Already Have An Account') . '</span></span></button>',
136
- // ));
137
-
138
- return parent::_prepareForm();
139
- }
140
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml install install form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Create_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/install/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $multipleStores = Remarkety_Mgconnector_Model_Install::isMultipleStores();
31
+ $accountWithLoginUrl = $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN));
32
+
33
+ $fieldset = $form->addFieldset(
34
+ 'general',
35
+ array(
36
+ 'legend' => $this->__('Install Remarkety extension')
37
+ )
38
+ );
39
+
40
+ $fieldset->addField(
41
+ 'mode', 'hidden', array(
42
+ 'name' => 'data[mode]',
43
+ 'value' => 'install_create',
44
+ )
45
+ );
46
+
47
+ $headingHtml =
48
+ '<p><b>' . $this->__(
49
+ 'Thank you for installing the Remarkety Magento plugin.
50
+ You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!'
51
+ )
52
+ . '</b><br><br>'
53
+ . $this->__(
54
+ 'The plugin will automatically create a Magento WebService API user so that
55
+ Remarkety can synchronize with your store.'
56
+ ) . '</p><hr/>'
57
+ . '<h2>'.$this->__('Create a new Remarkety account') . '</h2>'
58
+ . '<p>'.
59
+ sprintf(
60
+ $this->__(
61
+ 'Already registered to Remarkety? <a href="%s">Click here</a>'
62
+ ), $accountWithLoginUrl
63
+ )
64
+ . '</p>';
65
+
66
+ $instruction = $fieldset->addField(
67
+ 'instruction', 'note', array(
68
+ 'text' => '',
69
+ 'label' => false,
70
+ 'after_element_html' => $headingHtml,
71
+
72
+ )
73
+ );
74
+ $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
75
+
76
+ $html = '<small style="float:left;width:100%;">' . sprintf(
77
+ $this->__(
78
+ 'Already registered to Remarkety? <a href="%s">Click here</a>'
79
+ ), $accountWithLoginUrl
80
+ ) . '</small>';
81
+
82
+ $fieldset->addField(
83
+ 'email', 'text', array(
84
+ 'label' => $this->__('Email address for the Remarkety account:'),
85
+ 'name' => 'data[email]',
86
+ 'required' => true,
87
+ 'class' => 'validate-email',
88
+ //'after_element_html' => $html,
89
+ 'style' => 'float:left',
90
+ )
91
+ );
92
+
93
+ $fieldset->addField(
94
+ 'first_name', 'text', array(
95
+ 'label' => $this->__('First Name:'),
96
+ 'name' => 'data[first_name]',
97
+ 'required' => true,
98
+ 'class' => 'required-entry'
99
+ )
100
+ );
101
+
102
+ $fieldset->addField(
103
+ 'last_name', 'text', array(
104
+ 'label' => $this->__('Last Name:'),
105
+ 'name' => 'data[last_name]',
106
+ 'required' => true,
107
+ 'class' => 'required-entry'
108
+ )
109
+ );
110
+
111
+ $fieldset->addField(
112
+ 'phone', 'text', array(
113
+ 'label' => $this->__('Phone:'),
114
+ 'name' => 'data[phone]',
115
+ 'required' => true,
116
+ 'class' => 'required-entry'
117
+ )
118
+ );
119
+
120
+ $fieldset->addField(
121
+ 'password', 'password', array(
122
+ 'label' => $this->__('Password:'),
123
+ 'name' => 'data[password]',
124
+ 'required' => true,
125
+ 'class' => 'required-entry'
126
+ )
127
+ );
128
+
129
+
130
+ $fieldset->addField(
131
+ 'store_id', $multipleStores ? 'multiselect' : 'select', array(
132
+ 'name' => 'data[store_id]',
133
+ 'label' => $this->__('Sync Remarkety with this view:'),
134
+ 'required' => true,
135
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
136
+ )
137
+ );
138
+
139
+ $fieldset->addField(
140
+ 'terms', 'checkbox', array(
141
+ 'label' => false,
142
+ 'name' => 'data[terms]',
143
+ 'checked' => false,
144
+ 'value' => '1',
145
+ 'class' => 'required-entry',
146
+ 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
147
+ )
148
+ );
149
+
150
+ $fieldset->addField(
151
+ 'create', 'note', array(
152
+ 'label' => false,
153
+ 'name' => 'button',
154
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
155
+ . $this->__('Create New Account And Connect') . '</span></span></button>',
156
+ )
157
+ );
158
+
159
+ // $fieldset->addField('login', 'note', array(
160
+ // 'label' => false,
161
+ // 'name' => 'button',
162
+ // 'after_element_html' => '<button type="button" class="save"
163
+ // onclick="window.location = \'' . $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN)) . '\'"
164
+ // ><span><span>'
165
+ // . $this->__('I Already Have An Account') . '</span></span></button>',
166
+ // ));
167
+
168
+ return parent::_prepareForm();
169
+ }
170
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml install install block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Login extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'install_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_install_install';
22
- $this->_mode = 'login';
23
-
24
- $this->_headerText = $this->__(
25
- 'Install Remarkety extension (version: %s)',
26
- Mage::helper('mgconnector')->getInstalledVersion()
27
- );
28
-
29
- $this->_removeButton('back');
30
- $this->_removeButton('reset');
31
- $this->_removeButton('save');
32
- }
33
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml install install block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Login extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'install_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_install_install';
22
+ $this->_mode = 'login';
23
+
24
+ $this->_headerText = $this->__(
25
+ 'Install Remarkety extension (version: %s)',
26
+ Mage::helper('mgconnector')->getInstalledVersion()
27
+ );
28
+
29
+ $this->_removeButton('back');
30
+ $this->_removeButton('reset');
31
+ $this->_removeButton('save');
32
+ }
33
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login/Form.php CHANGED
@@ -1,130 +1,144 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml install install form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Login_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/install/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Install Remarkety extension')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'install_login',
38
- ));
39
- $noAccountUrl = $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE));
40
-
41
- /*$headingHtml =
42
- '<p><b>' . $this->__('Thank you for installing the Remarkety Magento plugin.
43
- You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
44
- . '</b><br><br>'
45
- . $this->__('The plugin will automatically create a Magento WebService API user so that
46
- Remarkety can synchronize with your store.') . '</p><hr/>'
47
- . '<h2>'.$this->__('Login to Remarkety') . '</h2>'
48
- . '<p>'.
49
- sprintf($this->__(
50
- 'Don\'t have a Remarkety account yet? <a href="%s">Click here</a>'
51
- ), $noAccountUrl)
52
- . '</p>';
53
-
54
- /$instruction = $fieldset->addField('instruction', 'note', array(
55
- 'text' => '',
56
- 'label' => false,
57
- 'after_element_html' => $headingHtml,
58
- // '<p style="font-weight:bold;">' . $this->__('Thank you for installing the Remarkety Magento plugin.
59
- // You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
60
- // . '<br><br>'
61
- // . $this->__('The plugin will automatically create a Magento WebService API user so that
62
- // Remarkety can synchronize with your store.') . '</p>',
63
- ));
64
- $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');*/
65
-
66
- $noAccountUrl = $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE));
67
-
68
- $html = '<small style="float:left;width:100%;">' . sprintf($this->__(
69
- 'Don\'t have a Remarkety account yet? <a href="%s">Click here</a>'
70
- ), $noAccountUrl) . '</small>';
71
-
72
- $fieldset->addField('email', 'text', array(
73
- 'label' => $this->__('Email address for the Remarkety account:'),
74
- 'name' => 'data[email]',
75
- 'required' => true,
76
- 'class' => 'validate-email',
77
- /*
78
- 'after_element_html' => $html,
79
- '<small style="float:left;width:100%;">' . $this->__(
80
- 'If you’ve already registered to Remarkety, please use the email you used to open your account.
81
- If you haven’t, please click on the button "Create New Account And Install" below.'
82
- ) . '</small>',
83
- */
84
- 'style' => 'float:left',
85
- ));
86
-
87
- $fieldset->addField('password', 'password', array(
88
- 'label' => $this->__('Password:'),
89
- 'name' => 'data[password]',
90
- 'required' => true,
91
- 'class' => 'required-entry'
92
- ));
93
-
94
- $fieldset->addField('store_id', 'select', array(
95
- 'name' => 'data[store_id]',
96
- 'label' => $this->__('Connect this view:'),
97
- 'required' => true,
98
- 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
99
- //'value' => $this->getRequest()->getParam('store'),
100
- ));
101
-
102
- // $fieldset->addField('terms', 'checkbox', array(
103
- // 'label' => false,
104
- // 'name' => 'data[terms]',
105
- // 'checked' => false,
106
- // 'value' => '1',
107
- // 'class' => 'required-entry',
108
- // 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
109
- // ));
110
-
111
- $fieldset->addField('login', 'note', array(
112
- 'label' => false,
113
- 'name' => 'button',
114
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span>'
115
- . $this->__('Login And Connect') . '
116
- </span></button>',
117
- ));
118
-
119
- // $fieldset->addField('create', 'note', array(
120
- // 'label' => false,
121
- // 'name' => 'button',
122
- // 'after_element_html' => '<button type="button" class="save"
123
- // onclick="window.location = \'' . $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE)) . '\'"
124
- // ><span><span>'
125
- // . $this->__('Create New Account And Install') . '</span></span></button>',
126
- // ));
127
-
128
- return parent::_prepareForm();
129
- }
130
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml install install form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Install_Login_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/install/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Install Remarkety extension')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'install_login',
41
+ )
42
+ );
43
+ $noAccountUrl = $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE));
44
+
45
+ /*$headingHtml =
46
+ '<p><b>' . $this->__('Thank you for installing the Remarkety Magento plugin.
47
+ You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
48
+ . '</b><br><br>'
49
+ . $this->__('The plugin will automatically create a Magento WebService API user so that
50
+ Remarkety can synchronize with your store.') . '</p><hr/>'
51
+ . '<h2>'.$this->__('Login to Remarkety') . '</h2>'
52
+ . '<p>'.
53
+ sprintf($this->__(
54
+ 'Don\'t have a Remarkety account yet? <a href="%s">Click here</a>'
55
+ ), $noAccountUrl)
56
+ . '</p>';
57
+
58
+ /$instruction = $fieldset->addField('instruction', 'note', array(
59
+ 'text' => '',
60
+ 'label' => false,
61
+ 'after_element_html' => $headingHtml,
62
+ // '<p style="font-weight:bold;">' . $this->__('Thank you for installing the Remarkety Magento plugin.
63
+ // You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
64
+ // . '<br><br>'
65
+ // . $this->__('The plugin will automatically create a Magento WebService API user so that
66
+ // Remarkety can synchronize with your store.') . '</p>',
67
+ ));
68
+ $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');*/
69
+
70
+ $noAccountUrl = $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE));
71
+
72
+ $html = '<small style="float:left;width:100%;">' . sprintf(
73
+ $this->__(
74
+ 'Don\'t have a Remarkety account yet? <a href="%s">Click here</a>'
75
+ ), $noAccountUrl
76
+ ) . '</small>';
77
+
78
+ $fieldset->addField(
79
+ 'email', 'text', array(
80
+ 'label' => $this->__('Email address for the Remarkety account:'),
81
+ 'name' => 'data[email]',
82
+ 'required' => true,
83
+ 'class' => 'validate-email',
84
+ /*
85
+ 'after_element_html' => $html,
86
+ '<small style="float:left;width:100%;">' . $this->__(
87
+ 'If you’ve already registered to Remarkety, please use the email you used to open your account.
88
+ If you haven’t, please click on the button "Create New Account And Install" below.'
89
+ ) . '</small>',
90
+ */
91
+ 'style' => 'float:left',
92
+ )
93
+ );
94
+
95
+ $fieldset->addField(
96
+ 'password', 'password', array(
97
+ 'label' => $this->__('Password:'),
98
+ 'name' => 'data[password]',
99
+ 'required' => true,
100
+ 'class' => 'required-entry'
101
+ )
102
+ );
103
+
104
+ $fieldset->addField(
105
+ 'store_id', 'select', array(
106
+ 'name' => 'data[store_id]',
107
+ 'label' => $this->__('Connect this view:'),
108
+ 'required' => true,
109
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
110
+ //'value' => $this->getRequest()->getParam('store'),
111
+ )
112
+ );
113
+
114
+ // $fieldset->addField('terms', 'checkbox', array(
115
+ // 'label' => false,
116
+ // 'name' => 'data[terms]',
117
+ // 'checked' => false,
118
+ // 'value' => '1',
119
+ // 'class' => 'required-entry',
120
+ // 'after_element_html' => $this->__('I agree to Remarkety’s <a href="%s">terms of use</a>.', '#'),
121
+ // ));
122
+
123
+ $fieldset->addField(
124
+ 'login', 'note', array(
125
+ 'label' => false,
126
+ 'name' => 'button',
127
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span>'
128
+ . $this->__('Login And Connect') . '
129
+ </span></button>',
130
+ )
131
+ );
132
+
133
+ // $fieldset->addField('create', 'note', array(
134
+ // 'label' => false,
135
+ // 'name' => 'button',
136
+ // 'after_element_html' => '<button type="button" class="save"
137
+ // onclick="window.location = \'' . $this->getUrl('*/install/install', array('mode' => Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE)) . '\'"
138
+ // ><span><span>'
139
+ // . $this->__('Create New Account And Install') . '</span></span></button>',
140
+ // ));
141
+
142
+ return parent::_prepareForm();
143
+ }
144
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade.php CHANGED
@@ -1,37 +1,39 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration upgrade block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Upgrade extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'upgrade_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_install';
22
- $this->_mode = 'upgrade';
23
-
24
- $this->_headerText = $this->__(
25
- 'Upgrade Remarkety extension (version: %s)',
26
- Mage::helper('mgconnector')->getInstalledVersion()
27
- );
28
-
29
- $this->_removeButton('back');
30
- $this->_removeButton('reset');
31
- $this->_addButton('save', array(
32
- 'label' => Mage::helper('adminhtml')->__('Complete Installation'),
33
- 'onclick' => 'editForm.submit();',
34
- 'class' => 'save',
35
- ), 1);
36
- }
37
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration upgrade block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Upgrade extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'upgrade_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_install';
22
+ $this->_mode = 'upgrade';
23
+
24
+ $this->_headerText = $this->__(
25
+ 'Upgrade Remarkety extension (version: %s)',
26
+ Mage::helper('mgconnector')->getInstalledVersion()
27
+ );
28
+
29
+ $this->_removeButton('back');
30
+ $this->_removeButton('reset');
31
+ $this->_addButton(
32
+ 'save', array(
33
+ 'label' => Mage::helper('adminhtml')->__('Complete Installation'),
34
+ 'onclick' => 'editForm.submit();',
35
+ 'class' => 'save',
36
+ ), 1
37
+ );
38
+ }
39
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade/Form.php CHANGED
@@ -1,62 +1,74 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configuration upgrade form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Upgrade_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/install/complete'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Upgrade Remarkety extension')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'upgrade',
38
- ));
39
-
40
- $instruction = $fieldset->addField('instruction', 'note', array(
41
- 'text' => '',
42
- 'label' => false,
43
- 'after_element_html' =>
44
- '<p style="font-weight:bold;">' . $this->__('Thank you for installing the Remarkety Magento plugin.
45
- You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!')
46
- . '<br><br>'
47
- . $this->__('It seems that you have already installed Remarkety on this website before. This
48
- version of the plugin will create a new API key, and automatically inform
49
- Remarkety. If this is a mistake, please <a href="%s">click here</a>.</p>', $this->getUrl('*/install/install', array('mode' => 'install_create')))
50
- ));
51
- $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
52
-
53
- $fieldset->addField('button', 'note', array(
54
- 'label' => false,
55
- 'name' => 'button',
56
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
57
- . $this->__('Complete Installation') . '</span></span></button>'
58
- ));
59
-
60
- return parent::_prepareForm();
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configuration upgrade form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Upgrade_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/install/complete'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Upgrade Remarkety extension')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'upgrade',
41
+ )
42
+ );
43
+
44
+ $instruction = $fieldset->addField(
45
+ 'instruction', 'note', array(
46
+ 'text' => '',
47
+ 'label' => false,
48
+ 'after_element_html' =>
49
+ '<p style="font-weight:bold;">' . $this->__(
50
+ 'Thank you for installing the Remarkety Magento plugin.
51
+ You are one click away from finishing setting up Remarkety on your store and sending effective, targeted emails!'
52
+ )
53
+ . '<br><br>'
54
+ . $this->__(
55
+ 'It seems that you have already installed Remarkety on this website before. This
56
+ version of the plugin will create a new API key, and automatically inform
57
+ Remarkety. If this is a mistake, please <a href="%s">click here</a>.</p>', $this->getUrl('*/install/install', array('mode' => 'install_create'))
58
+ )
59
+ )
60
+ );
61
+ $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
62
+
63
+ $fieldset->addField(
64
+ 'button', 'note', array(
65
+ 'label' => false,
66
+ 'name' => 'button',
67
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
68
+ . $this->__('Complete Installation') . '</span></span></button>'
69
+ )
70
+ );
71
+
72
+ return parent::_prepareForm();
73
+ }
74
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome.php CHANGED
@@ -1,39 +1,41 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml welcome complete block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Welcome extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'welcome_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_install';
22
- $this->_mode = 'welcome';
23
-
24
- $this->_headerText = $this->__(
25
- 'Remarkety (version: %s)',
26
- Mage::helper('mgconnector')->getInstalledVersion()
27
- );
28
-
29
- $this->_removeButton('back');
30
- $this->_removeButton('reset');
31
- $this->_removeButton('save');
32
-
33
- $this->_addButton('reinstall', array(
34
- 'label' => Mage::helper('adminhtml')->__('Reinstall'),
35
- 'onclick' => "return confirm('Are you sure?') ? window.location = '" . $this->getUrl('*/install/reinstall')."' : false;",
36
- 'class' => 'delete',
37
- ), 0);
38
- }
39
- }
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml welcome complete block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Welcome extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'welcome_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_install';
22
+ $this->_mode = 'welcome';
23
+
24
+ $this->_headerText = $this->__(
25
+ 'Remarkety (version: %s)',
26
+ Mage::helper('mgconnector')->getInstalledVersion()
27
+ );
28
+
29
+ $this->_removeButton('back');
30
+ $this->_removeButton('reset');
31
+ $this->_removeButton('save');
32
+
33
+ $this->_addButton(
34
+ 'reinstall', array(
35
+ 'label' => Mage::helper('adminhtml')->__('Reinstall'),
36
+ 'onclick' => "return confirm('Are you sure?') ? window.location = '" . $this->getUrl('*/install/reinstall')."' : false;",
37
+ 'class' => 'delete',
38
+ ), 0
39
+ );
40
+ }
41
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Form.php CHANGED
@@ -1,56 +1,62 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml welcome complete form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Install_Welcome_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/*/install'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Remarkety')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'complete',
38
- ));
39
-
40
- $instruction = $fieldset->addField('instruction', 'note', array(
41
- 'text' => '',
42
- 'label' => false,
43
- 'after_element_html' => '<p style="font-weight:bold;font-size:25px;">' . $this->__('Welcome to Remarkety - What\'s next?') . '</p>
44
- <ol style="list-style-type:decimal;margin-left:20px;font-weight:bold;font-size:12px;">
45
- <li>Sign in to your account <a href="https://app.remarkety.com/?utm_source=plugin&utm_medium=link&utm_campaign=magento-plugin" target="_blank">here</a></li>
46
- <li>Create campaigns, send emails and monitor results.</li>
47
- <li>Increase sales and customer\'s Life Time Value</li>
48
- <li>Need help? We are here for you: <a href="mailto:support@remarkety.com">support@remarkety.com</a> <a href="tel:%28%2B1%20800%20570-7564">(+1 800 570-7564)</a></li>
49
- </ol>
50
- '
51
- ));
52
- $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
53
-
54
- return parent::_prepareForm();
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml welcome complete form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Install_Welcome_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/install'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Remarkety')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'complete',
41
+ )
42
+ );
43
+
44
+ $instruction = $fieldset->addField(
45
+ 'instruction', 'note', array(
46
+ 'text' => '',
47
+ 'label' => false,
48
+ 'after_element_html' => '<p style="font-weight:bold;font-size:25px;">' . $this->__('Welcome to Remarkety - What\'s next?') . '</p>
49
+ <ol style="list-style-type:decimal;margin-left:20px;font-weight:bold;font-size:12px;">
50
+ <li>Sign in to your account <a href="https://app.remarkety.com/?utm_source=plugin&utm_medium=link&utm_campaign=magento-plugin" target="_blank">here</a></li>
51
+ <li>Create campaigns, send emails and monitor results.</li>
52
+ <li>Increase sales and customer\'s Life Time Value</li>
53
+ <li>Need help? We are here for you: <a href="mailto:support@remarkety.com">support@remarkety.com</a> <a href="tel:%28%2B1%20800%20570-7564">(+1 800 570-7564)</a></li>
54
+ </ol>
55
+ '
56
+ )
57
+ );
58
+ $instruction->getRenderer()->setTemplate('mgconnector/element.phtml');
59
+
60
+ return parent::_prepareForm();
61
+ }
62
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Store.php CHANGED
@@ -48,7 +48,8 @@ class Remarkety_Mgconnector_Block_Adminhtml_Install_Welcome_Store extends Mage_A
48
  return $stores;
49
  }
50
 
51
- public function checkAPIKey(){
 
52
  try {
53
  $uModel = Mage::getModel('api/user');
54
  $apiKey = Mage::getStoreConfig('remarkety/mgconnector/api_key');
48
  return $stores;
49
  }
50
 
51
+ public function checkAPIKey()
52
+ {
53
  try {
54
  $uModel = Mage::getModel('api/user');
55
  $apiKey = Mage::getStoreConfig('remarkety/mgconnector/api_key');
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml queue block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Queue extends Mage_Adminhtml_Block_Widget_Grid_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_blockGroup = 'mgconnector';
20
- $this->_controller = 'adminhtml_queue';
21
- $this->_headerText = Mage::helper('mgconnector')->__('Queue Contents');
22
- $this->_removeButton('add');
23
- }
24
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml queue block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Queue extends Mage_Adminhtml_Block_Widget_Grid_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_blockGroup = 'mgconnector';
20
+ $this->_controller = 'adminhtml_queue';
21
+ $this->_headerText = Mage::helper('mgconnector')->__('Queue Contents');
22
+ $this->_removeButton('add');
23
+ }
24
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configure block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Queue_Configure extends Mage_Adminhtml_Block_Widget_Form_Container
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this->_objectId = 'configure_id';
20
- $this->_blockGroup = 'mgconnector';
21
- $this->_controller = 'adminhtml_queue';
22
- $this->_mode = 'configure';
23
-
24
- $this->_headerText = $this->__(
25
- 'Configuration'
26
- // Mage::helper('mgconnector')->getInstalledVersion()
27
- );
28
-
29
- $this->_removeButton('back');
30
- $this->_removeButton('reset');
31
-
32
- // $this->_addButton('save', array(
33
- // 'label' => Mage::helper('adminhtml')->__('Save'),
34
- // 'onclick' => 'editForm.submit();',
35
- // 'class' => 'save',
36
- // ), 0);
37
- }
38
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configure block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Queue_Configure extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this->_objectId = 'configure_id';
20
+ $this->_blockGroup = 'mgconnector';
21
+ $this->_controller = 'adminhtml_queue';
22
+ $this->_mode = 'configure';
23
+
24
+ $this->_headerText = $this->__(
25
+ 'Configuration'
26
+ // Mage::helper('mgconnector')->getInstalledVersion()
27
+ );
28
+
29
+ $this->_removeButton('back');
30
+ $this->_removeButton('reset');
31
+
32
+ // $this->_addButton('save', array(
33
+ // 'label' => Mage::helper('adminhtml')->__('Save'),
34
+ // 'onclick' => 'editForm.submit();',
35
+ // 'class' => 'save',
36
+ // ), 0);
37
+ }
38
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure/Form.php CHANGED
@@ -1,126 +1,145 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml configure form block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Queue_Configure_Form extends Mage_Adminhtml_Block_Widget_Form
11
- {
12
- /**
13
- * Prepare form
14
- *
15
- * @return Mage_Adminhtml_Block_Widget_Form
16
- */
17
- protected function _prepareForm()
18
- {
19
- $form = new Varien_Data_Form(array(
20
- 'id' => 'edit_form',
21
- 'action' => $this->getUrl('*/queue/save'),
22
- 'method' => 'post',
23
- ));
24
- $form->setFieldContainerIdPrefix('data');
25
- $form->setUseContainer(true);
26
- $this->setForm($form);
27
-
28
- $fieldset = $form->addFieldset(
29
- 'general',
30
- array(
31
- 'legend' => $this->__('Remarkety Configuration')
32
  )
33
- );
34
-
35
- $fieldset->addField('mode', 'hidden', array(
36
- 'name' => 'data[mode]',
37
- 'value' => 'configuration',
38
- ));
39
-
40
- if(!$this->checkAPIKey()) {
41
- $fieldset->addField('api_warning', 'note', array(
42
- 'text' => '<span style="color: red;">' . $this->__('Attention! Remarkety\'s API key is not the same as the Magento API key. Please set it below.') . '</span>'.
43
- ' <a target="_blank" href="https://support.remarkety.com/hc/en-us/articles/209184646-Synchronizing-the-API-key">More Info</a>.',
44
- ));
45
- }
46
-
47
- $fieldset->addField('api_key', 'text', array(
48
- 'label' => $this->__('API Key:'),
49
- 'name' => 'data[api_key]',
50
- 'required' => true,
51
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
52
- 'This API key will be used for Remarkety\'s sync and queue.'
53
- ) . '</small>',
54
- 'value' => Mage::getStoreConfig('remarkety/mgconnector/api_key'),
55
- 'style' => 'float:left',
56
- ));
57
-
58
- $fieldset->addField('intervals', 'text', array(
59
- 'label' => $this->__('Intervals:'),
60
- 'name' => 'data[intervals]',
61
- 'required' => false,
62
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
63
- 'This defines the queue retry interval.<br/>
64
- Type the amount of minutes between retries, separated by commas. For example "1,3,10" -
65
- the second attempt will be after 1 minute, third after 3 minutes,<br/>
66
- and fourth after 10 minutes. If the last attempt is unsuccessful,
67
- the status will be changed to "failed" and will not be retried anymore.'
68
- ) . '</small>',
69
- 'value' => Mage::getStoreConfig('remarkety/mgconnector/intervals'),
70
- 'style' => 'float:left',
71
- ));
72
-
73
- $fieldset->addField('bypasscache', 'checkbox', array(
74
- 'label' => $this->__('Bypass page cache for website tracking:'),
75
- 'name' => 'data[bypasscache]',
76
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
77
- 'Enable this checkbox if you use caching on your store pages.'
78
- ) . '</small>',
79
- 'value' => 1,
80
- 'checked' => \Remarkety_Mgconnector_Model_Webtracking::getBypassCache() ? 'checked' : '',
81
- 'style' => 'float:left',
82
- ));
83
-
84
- $fieldset->addField('markgroupparent', 'checkbox', array(
85
- 'label' => $this->__('Mark grouped product as parent of associated products'),
86
- 'name' => 'data[markgroupparent]',
87
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
88
- 'Enable this checkbox only if each simple product has only 1 parent grouped product'
89
- ) . '</small>',
90
- 'value' => 1,
91
- 'checked' => Mage::getStoreConfig('remarkety/mgconnector/mark_group_parent') ? 'checked' : '',
92
- 'style' => 'float:left',
93
- ));
94
-
95
- $fieldset->addField('simpleproductstandalone', 'checkbox', array(
96
- 'label' => $this->__('Get images and urls independently for simple products'),
97
- 'name' => 'data[simpleproductstandalone]',
98
- 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
99
- 'Enable this checkbox if simple products that are related to configurable products have their own images and urls'
100
- ) . '</small>',
101
- 'value' => 1,
102
- 'checked' => Mage::getStoreConfig('remarkety/mgconnector/configurable_standalone') ? 'checked' : '',
103
- 'style' => 'float:left',
104
- ));
105
-
106
- $button = $fieldset->addField('button', 'note', array(
107
- 'label' => false,
108
- 'name' => 'button',
109
- 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
110
- . $this->__('Save') . '</span></span></button>',
111
- ));
112
- $button->getRenderer()->setTemplate('mgconnector/element.phtml');
113
-
114
- return parent::_prepareForm();
115
- }
116
-
117
- private function checkAPIKey(){
118
- try {
119
- $uModel = Mage::getModel('api/user');
120
- $apiKey = Mage::getStoreConfig('remarkety/mgconnector/api_key');
121
- return $uModel->authenticate(\Remarkety_Mgconnector_Model_Install::WEB_SERVICE_USERNAME, $apiKey);
122
- } catch (Exception $ex){
123
- return false;
124
- }
125
- }
126
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml configure form block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Queue_Configure_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ /**
13
+ * Prepare form
14
+ *
15
+ * @return Mage_Adminhtml_Block_Widget_Form
16
+ */
17
+ protected function _prepareForm()
18
+ {
19
+ $form = new Varien_Data_Form(
20
+ array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/queue/save'),
23
+ 'method' => 'post',
 
 
 
 
 
 
 
 
24
  )
25
+ );
26
+ $form->setFieldContainerIdPrefix('data');
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+
30
+ $fieldset = $form->addFieldset(
31
+ 'general',
32
+ array(
33
+ 'legend' => $this->__('Remarkety Configuration')
34
+ )
35
+ );
36
+
37
+ $fieldset->addField(
38
+ 'mode', 'hidden', array(
39
+ 'name' => 'data[mode]',
40
+ 'value' => 'configuration',
41
+ )
42
+ );
43
+
44
+ if(!$this->checkAPIKey()) {
45
+ $fieldset->addField(
46
+ 'api_warning', 'note', array(
47
+ 'text' => '<span style="color: red;">' . $this->__('Attention! Remarkety\'s API key is not the same as the Magento API key. Please set it below.') . '</span>'.
48
+ ' <a target="_blank" href="https://support.remarkety.com/hc/en-us/articles/209184646-Synchronizing-the-API-key">More Info</a>.',
49
+ )
50
+ );
51
+ }
52
+
53
+ $fieldset->addField(
54
+ 'api_key', 'text', array(
55
+ 'label' => $this->__('API Key:'),
56
+ 'name' => 'data[api_key]',
57
+ 'required' => true,
58
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
59
+ 'This API key will be used for Remarkety\'s sync and queue.'
60
+ ) . '</small>',
61
+ 'value' => Mage::getStoreConfig('remarkety/mgconnector/api_key'),
62
+ 'style' => 'float:left',
63
+ )
64
+ );
65
+
66
+ $fieldset->addField(
67
+ 'intervals', 'text', array(
68
+ 'label' => $this->__('Intervals:'),
69
+ 'name' => 'data[intervals]',
70
+ 'required' => false,
71
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
72
+ 'This defines the queue retry interval.<br/>
73
+ Type the amount of minutes between retries, separated by commas. For example "1,3,10" -
74
+ the second attempt will be after 1 minute, third after 3 minutes,<br/>
75
+ and fourth after 10 minutes. If the last attempt is unsuccessful,
76
+ the status will be changed to "failed" and will not be retried anymore.'
77
+ ) . '</small>',
78
+ 'value' => Mage::getStoreConfig('remarkety/mgconnector/intervals'),
79
+ 'style' => 'float:left',
80
+ )
81
+ );
82
+
83
+ $fieldset->addField(
84
+ 'bypasscache', 'checkbox', array(
85
+ 'label' => $this->__('Bypass page cache for website tracking:'),
86
+ 'name' => 'data[bypasscache]',
87
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
88
+ 'Enable this checkbox if you use caching on your store pages.'
89
+ ) . '</small>',
90
+ 'value' => 1,
91
+ 'checked' => \Remarkety_Mgconnector_Model_Webtracking::getBypassCache() ? 'checked' : '',
92
+ 'style' => 'float:left',
93
+ )
94
+ );
95
+
96
+ $fieldset->addField(
97
+ 'markgroupparent', 'checkbox', array(
98
+ 'label' => $this->__('Mark grouped product as parent of associated products'),
99
+ 'name' => 'data[markgroupparent]',
100
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
101
+ 'Enable this checkbox only if each simple product has only 1 parent grouped product'
102
+ ) . '</small>',
103
+ 'value' => 1,
104
+ 'checked' => Mage::getStoreConfig('remarkety/mgconnector/mark_group_parent') ? 'checked' : '',
105
+ 'style' => 'float:left',
106
+ )
107
+ );
108
+
109
+ $fieldset->addField(
110
+ 'simpleproductstandalone', 'checkbox', array(
111
+ 'label' => $this->__('Get images and urls independently for simple products'),
112
+ 'name' => 'data[simpleproductstandalone]',
113
+ 'after_element_html' => '<small style="float:left;width:100%;">' . $this->__(
114
+ 'Enable this checkbox if simple products that are related to configurable products have their own images and urls'
115
+ ) . '</small>',
116
+ 'value' => 1,
117
+ 'checked' => Mage::getStoreConfig('remarkety/mgconnector/configurable_standalone') ? 'checked' : '',
118
+ 'style' => 'float:left',
119
+ )
120
+ );
121
+
122
+ $button = $fieldset->addField(
123
+ 'button', 'note', array(
124
+ 'label' => false,
125
+ 'name' => 'button',
126
+ 'after_element_html' => '<button type="button" class="save" onclick="editForm.submit();"><span><span>'
127
+ . $this->__('Save') . '</span></span></button>',
128
+ )
129
+ );
130
+ $button->getRenderer()->setTemplate('mgconnector/element.phtml');
131
+
132
+ return parent::_prepareForm();
133
+ }
134
+
135
+ private function checkAPIKey()
136
+ {
137
+ try {
138
+ $uModel = Mage::getModel('api/user');
139
+ $apiKey = Mage::getStoreConfig('remarkety/mgconnector/api_key');
140
+ return $uModel->authenticate(\Remarkety_Mgconnector_Model_Install::WEB_SERVICE_USERNAME, $apiKey);
141
+ } catch (Exception $ex){
142
+ return false;
143
+ }
144
+ }
145
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid.php CHANGED
@@ -1,116 +1,132 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml queue grid block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
11
- {
12
- /**
13
- * Prepare block
14
- */
15
- public function __construct()
16
- {
17
- parent::__construct();
18
-
19
- $this
20
- ->setId('queue_grid')
21
- ->setDefaultSort('next_attempt')
22
- ->setDefaultDir('ASC')
23
- ->setSaveParametersInSession(true)
24
- ->setUseAjax(true);
25
- }
26
-
27
- /**
28
- * Prepare collection
29
- *
30
- * @return Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid
31
- */
32
- protected function _prepareCollection()
33
- {
34
- $collection = Mage::getResourceModel('mgconnector/queue_collection');
35
- $this->setCollection($collection);
36
-
37
- return parent::_prepareCollection();
38
- }
39
-
40
- /**
41
- * Prepare columns
42
- *
43
- * @return Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid
44
- * @throws Exception
45
- */
46
- protected function _prepareColumns()
47
- {
48
- $helper = Mage::helper('mgconnector');
49
-
50
- $this->addColumn('queue_id', array(
51
- 'header' => $helper->__('Queue #'),
52
- 'width' => '50px',
53
- 'type' => 'number',
54
- 'index' => 'queue_id'
55
- ));
56
- $this->addColumn('event_type', array(
57
- 'header' => $helper->__('Event Type'),
58
- 'index' => 'event_type',
59
- 'renderer' => 'Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_EventType',
60
- ));
61
- $this->addColumn('status', array(
62
- 'header' => $helper->__('Status'),
63
- 'width' => '200px',
64
- 'renderer' => 'Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_Status',
65
- 'index' => 'status'
66
- ));
67
- $this->addColumn('attempts', array(
68
- 'header' => $helper->__('Attempts'),
69
- 'index' => 'attempts'
70
- ));
71
- $this->addColumn('last_attempt', array(
72
- 'header' => $helper->__('Last Attempt'),
73
- 'width' => '200px',
74
- 'type' => 'datetime',
75
- 'index' => 'last_attempt'
76
- ));
77
- $this->addColumn('next_attempt', array(
78
- 'header' => $helper->__('Next Attempt'),
79
- 'width' => '200px',
80
- 'type' => 'datetime',
81
- 'index' => 'next_attempt'
82
- ));
83
-
84
- return parent::_prepareColumns();
85
- }
86
-
87
- /**
88
- * Return grid url
89
- *
90
- * @return string
91
- */
92
- public function getGridUrl()
93
- {
94
- return $this->getUrl('*/*/grid', array('_current' => true));
95
- }
96
-
97
-
98
- protected function _prepareMassaction()
99
- {
100
- $this->setMassactionIdField('queue_id');
101
- $this->getMassactionBlock()->setFormFieldName('queue');
102
-
103
- $this->getMassactionBlock()->addItem('resend', array(
104
- 'label' => $this->__('Resend'),
105
- 'url' => $this->getUrl('*/*/massResend')
106
- ));
107
-
108
- $this->getMassactionBlock()->addItem('delete', array(
109
- 'label' => $this->__('Delete'),
110
- 'url' => $this->getUrl('*/*/massDelete'),
111
- 'confirm' => $this->__('Really delete all these events?')
112
- ));
113
-
114
- return $this;
115
- }
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml queue grid block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
11
+ {
12
+ /**
13
+ * Prepare block
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ $this
20
+ ->setId('queue_grid')
21
+ ->setDefaultSort('next_attempt')
22
+ ->setDefaultDir('ASC')
23
+ ->setSaveParametersInSession(true)
24
+ ->setUseAjax(true);
25
+ }
26
+
27
+ /**
28
+ * Prepare collection
29
+ *
30
+ * @return Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid
31
+ */
32
+ protected function _prepareCollection()
33
+ {
34
+ $collection = Mage::getResourceModel('mgconnector/queue_collection');
35
+ $this->setCollection($collection);
36
+
37
+ return parent::_prepareCollection();
38
+ }
39
+
40
+ /**
41
+ * Prepare columns
42
+ *
43
+ * @return Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid
44
+ * @throws Exception
45
+ */
46
+ protected function _prepareColumns()
47
+ {
48
+ $helper = Mage::helper('mgconnector');
49
+
50
+ $this->addColumn(
51
+ 'queue_id', array(
52
+ 'header' => $helper->__('Queue #'),
53
+ 'width' => '50px',
54
+ 'type' => 'number',
55
+ 'index' => 'queue_id'
56
+ )
57
+ );
58
+ $this->addColumn(
59
+ 'event_type', array(
60
+ 'header' => $helper->__('Event Type'),
61
+ 'index' => 'event_type',
62
+ 'renderer' => 'Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_EventType',
63
+ )
64
+ );
65
+ $this->addColumn(
66
+ 'status', array(
67
+ 'header' => $helper->__('Status'),
68
+ 'width' => '200px',
69
+ 'renderer' => 'Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_Status',
70
+ 'index' => 'status'
71
+ )
72
+ );
73
+ $this->addColumn(
74
+ 'attempts', array(
75
+ 'header' => $helper->__('Attempts'),
76
+ 'index' => 'attempts'
77
+ )
78
+ );
79
+ $this->addColumn(
80
+ 'last_attempt', array(
81
+ 'header' => $helper->__('Last Attempt'),
82
+ 'width' => '200px',
83
+ 'type' => 'datetime',
84
+ 'index' => 'last_attempt'
85
+ )
86
+ );
87
+ $this->addColumn(
88
+ 'next_attempt', array(
89
+ 'header' => $helper->__('Next Attempt'),
90
+ 'width' => '200px',
91
+ 'type' => 'datetime',
92
+ 'index' => 'next_attempt'
93
+ )
94
+ );
95
+
96
+ return parent::_prepareColumns();
97
+ }
98
+
99
+ /**
100
+ * Return grid url
101
+ *
102
+ * @return string
103
+ */
104
+ public function getGridUrl()
105
+ {
106
+ return $this->getUrl('*/*/grid', array('_current' => true));
107
+ }
108
+
109
+
110
+ protected function _prepareMassaction()
111
+ {
112
+ $this->setMassactionIdField('queue_id');
113
+ $this->getMassactionBlock()->setFormFieldName('queue');
114
+
115
+ $this->getMassactionBlock()->addItem(
116
+ 'resend', array(
117
+ 'label' => $this->__('Resend'),
118
+ 'url' => $this->getUrl('*/*/massResend')
119
+ )
120
+ );
121
+
122
+ $this->getMassactionBlock()->addItem(
123
+ 'delete', array(
124
+ 'label' => $this->__('Delete'),
125
+ 'url' => $this->getUrl('*/*/massDelete'),
126
+ 'confirm' => $this->__('Really delete all these events?')
127
+ )
128
+ );
129
+
130
+ return $this;
131
+ }
132
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid/Column/Renderer/EventType.php CHANGED
@@ -1,29 +1,30 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml queue grid status column renderer block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_EventType
11
- extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
12
- {
13
- /**
14
- * Column renderer
15
- *
16
- * @param Varien_Object $row
17
- * @return string
18
- */
19
- public function render(Varien_Object $row)
20
- {
21
- $value = $row->getData($this->getColumn()->getIndex());
22
- try {
23
- $payload = json_encode(unserialize($row->getData('payload')));
24
- } catch (\Exception $e) {
25
- $payload = "?";
26
  }
27
- return '<span title="'.htmlentities($payload).'">'.$value.'</span>';
28
- }
29
- }
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml queue grid status column renderer block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_EventType
11
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
12
+ {
13
+ /**
14
+ * Column renderer
15
+ *
16
+ * @param Varien_Object $row
17
+ * @return string
18
+ */
19
+ public function render(Varien_Object $row)
20
+ {
21
+ $value = $row->getData($this->getColumn()->getIndex());
22
+ try {
23
+ $payload = json_encode(unserialize($row->getData('payload')));
24
+ } catch (\Exception $e) {
25
+ $payload = "?";
26
  }
27
+
28
+ return '<span title="'.htmlentities($payload).'">'.$value.'</span>';
29
+ }
30
+ }
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid/Column/Renderer/Status.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml queue grid status column renderer block
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_Status
11
- extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
12
- {
13
- /**
14
- * Column renderer
15
- *
16
- * @param Varien_Object $row
17
- * @return string
18
- */
19
- public function render(Varien_Object $row)
20
- {
21
- $value = $row->getData($this->getColumn()->getIndex());
22
-
23
- return Mage::helper('mgconnector')->__($value ? 'Queued' : 'Failed');
24
- }
25
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml queue grid status column renderer block
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Block_Adminhtml_Queue_Grid_Column_Renderer_Status
11
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
12
+ {
13
+ /**
14
+ * Column renderer
15
+ *
16
+ * @param Varien_Object $row
17
+ * @return string
18
+ */
19
+ public function render(Varien_Object $row)
20
+ {
21
+ $value = $row->getData($this->getColumn()->getIndex());
22
+
23
+ return Mage::helper('mgconnector')->__($value ? 'Queued' : 'Failed');
24
+ }
25
+ }
app/code/community/Remarkety/Mgconnector/Block/Tracking/Base.php CHANGED
@@ -16,7 +16,8 @@ class Remarkety_Mgconnector_Block_Tracking_Base extends Mage_Core_Block_Template
16
  return $m->getRemarketyPublicId($store);
17
  }
18
 
19
- public function shouldBypassCache(){
 
20
  return \Remarkety_Mgconnector_Model_Webtracking::getBypassCache();
21
  }
22
 
@@ -25,11 +26,13 @@ class Remarkety_Mgconnector_Block_Tracking_Base extends Mage_Core_Block_Template
25
  return Mage::getSingleton('customer/session')->getCustomer();
26
  }
27
 
28
- public function getEmail(){
 
29
  if(Mage::getSingleton('customer/session')->isLoggedIn()){
30
  return $this->getCustomer()->getEmail();
31
  }
 
32
  $email = Mage::getSingleton('customer/session')->getSubscriberEmail();
33
  return empty($email) ? false : $email;
34
  }
35
- }
16
  return $m->getRemarketyPublicId($store);
17
  }
18
 
19
+ public function shouldBypassCache()
20
+ {
21
  return \Remarkety_Mgconnector_Model_Webtracking::getBypassCache();
22
  }
23
 
26
  return Mage::getSingleton('customer/session')->getCustomer();
27
  }
28
 
29
+ public function getEmail()
30
+ {
31
  if(Mage::getSingleton('customer/session')->isLoggedIn()){
32
  return $this->getCustomer()->getEmail();
33
  }
34
+
35
  $email = Mage::getSingleton('customer/session')->getSubscriberEmail();
36
  return empty($email) ? false : $email;
37
  }
38
+ }
app/code/community/Remarkety/Mgconnector/Block/Tracking/General.php CHANGED
@@ -2,4 +2,4 @@
2
  class Remarkety_Mgconnector_Block_Tracking_General extends Remarkety_Mgconnector_Block_Tracking_Base
3
  {
4
 
5
- }
2
  class Remarkety_Mgconnector_Block_Tracking_General extends Remarkety_Mgconnector_Block_Tracking_Base
3
  {
4
 
5
+ }
app/code/community/Remarkety/Mgconnector/Block/Tracking/Product.php CHANGED
@@ -13,6 +13,7 @@ class Remarkety_Mgconnector_Block_Tracking_Product extends Remarkety_Mgconnector
13
  if($this->getProduct()){
14
  return $this->getProduct();
15
  }
 
16
  return Mage::registry('product');
17
  }
18
 
@@ -20,7 +21,8 @@ class Remarkety_Mgconnector_Block_Tracking_Product extends Remarkety_Mgconnector
20
  * Get arrays of Category ids and names
21
  * @return array
22
  */
23
- public function getCategories(){
 
24
  if(empty($this->_CategoryNames) || empty($this->_CategoryIds)) {
25
  $cats = $this->getActiveProduct()->getCategoryIds();
26
  $productCategoryNames = Array();
@@ -28,9 +30,11 @@ class Remarkety_Mgconnector_Block_Tracking_Product extends Remarkety_Mgconnector
28
  $_cat = Mage::getModel('catalog/category')->load($category_id);
29
  $productCategoryNames[] = $_cat->getName();
30
  }
 
31
  $this->_CategoryNames = $productCategoryNames;
32
  $this->_CategoryIds = $cats;
33
  }
 
34
  return Array(
35
  "ids" => $this->_CategoryIds,
36
  "names" => $this->_CategoryNames
@@ -41,7 +45,8 @@ class Remarkety_Mgconnector_Block_Tracking_Product extends Remarkety_Mgconnector
41
  * Return array of Category names
42
  * @return array
43
  */
44
- public function getCategoryNames(){
 
45
  $info = $this->getCategories();
46
  return $info['names'];
47
  }
@@ -50,8 +55,9 @@ class Remarkety_Mgconnector_Block_Tracking_Product extends Remarkety_Mgconnector
50
  * Return array of Category ids
51
  * @return array
52
  */
53
- public function getCategoryIds(){
 
54
  $info = $this->getCategories();
55
  return $info['ids'];
56
  }
57
- }
13
  if($this->getProduct()){
14
  return $this->getProduct();
15
  }
16
+
17
  return Mage::registry('product');
18
  }
19
 
21
  * Get arrays of Category ids and names
22
  * @return array
23
  */
24
+ public function getCategories()
25
+ {
26
  if(empty($this->_CategoryNames) || empty($this->_CategoryIds)) {
27
  $cats = $this->getActiveProduct()->getCategoryIds();
28
  $productCategoryNames = Array();
30
  $_cat = Mage::getModel('catalog/category')->load($category_id);
31
  $productCategoryNames[] = $_cat->getName();
32
  }
33
+
34
  $this->_CategoryNames = $productCategoryNames;
35
  $this->_CategoryIds = $cats;
36
  }
37
+
38
  return Array(
39
  "ids" => $this->_CategoryIds,
40
  "names" => $this->_CategoryNames
45
  * Return array of Category names
46
  * @return array
47
  */
48
+ public function getCategoryNames()
49
+ {
50
  $info = $this->getCategories();
51
  return $info['names'];
52
  }
55
  * Return array of Category ids
56
  * @return array
57
  */
58
+ public function getCategoryIds()
59
+ {
60
  $info = $this->getCategories();
61
  return $info['ids'];
62
  }
63
+ }
app/code/community/Remarkety/Mgconnector/Helper/Configuration.php CHANGED
@@ -4,7 +4,8 @@ class Remarkety_Mgconnector_Helper_Configuration extends Mage_Core_Helper_Abstra
4
  {
5
  private $_cache = array();
6
 
7
- public function getValue($key, $default = null) {
 
8
  // Check if the key is in our cache
9
  if (key_exists($key, $this->_cache))
10
  return $this->_cache[$key];
@@ -22,7 +23,8 @@ class Remarkety_Mgconnector_Helper_Configuration extends Mage_Core_Helper_Abstra
22
  $this->_cache[$key] = $value;
23
  return $value;
24
  }
 
25
  return $default;
26
 
27
  }
28
- }
4
  {
5
  private $_cache = array();
6
 
7
+ public function getValue($key, $default = null)
8
+ {
9
  // Check if the key is in our cache
10
  if (key_exists($key, $this->_cache))
11
  return $this->_cache[$key];
23
  $this->_cache[$key] = $value;
24
  return $value;
25
  }
26
+
27
  return $default;
28
 
29
  }
30
+ }
app/code/community/Remarkety/Mgconnector/Helper/Data.php CHANGED
@@ -14,7 +14,7 @@ class Remarkety_Mgconnector_Helper_Data extends Mage_Core_Helper_Abstract
14
  *
15
  * @return string
16
  */
17
- public function getInstalledVersion()
18
  {
19
  return Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
20
  }
@@ -59,13 +59,15 @@ class Remarkety_Mgconnector_Helper_Data extends Mage_Core_Helper_Abstract
59
  $mode = $forceMode;
60
  }
61
 
62
- if(!in_array($mode, array(
 
63
  Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE,
64
  Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN,
65
  Remarkety_Mgconnector_Model_Install::MODE_UPGRADE,
66
  Remarkety_Mgconnector_Model_Install::MODE_COMPLETE,
67
  Remarkety_Mgconnector_Model_Install::MODE_WELCOME,
68
- ))) {
 
69
  throw new Mage_Core_Exception('Installation mode can not be handled.');
70
  }
71
 
14
  *
15
  * @return string
16
  */
17
+ public function getInstalledVersion()
18
  {
19
  return Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
20
  }
59
  $mode = $forceMode;
60
  }
61
 
62
+ if(!in_array(
63
+ $mode, array(
64
  Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE,
65
  Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN,
66
  Remarkety_Mgconnector_Model_Install::MODE_UPGRADE,
67
  Remarkety_Mgconnector_Model_Install::MODE_COMPLETE,
68
  Remarkety_Mgconnector_Model_Install::MODE_WELCOME,
69
+ )
70
+ )) {
71
  throw new Mage_Core_Exception('Installation mode can not be handled.');
72
  }
73
 
app/code/community/Remarkety/Mgconnector/Helper/Links.php CHANGED
@@ -35,6 +35,7 @@ class Remarkety_Mgconnector_Helper_Links extends Mage_Core_Helper_Abstract
35
  if (!isset($this->simpleIds[$parentId])) {
36
  $this->simpleIds[$parentId] = array();
37
  }
 
38
  $this->simpleIds[$parentId][] = $productId;
39
  $this->parentId[$productId] = $parentId;
40
  }
@@ -67,6 +68,7 @@ class Remarkety_Mgconnector_Helper_Links extends Mage_Core_Helper_Abstract
67
  if (isset($this->simpleIds[$productId])) {
68
  return $this->simpleIds[$productId];
69
  }
 
70
  return null;
71
  }
72
- }
35
  if (!isset($this->simpleIds[$parentId])) {
36
  $this->simpleIds[$parentId] = array();
37
  }
38
+
39
  $this->simpleIds[$parentId][] = $productId;
40
  $this->parentId[$productId] = $parentId;
41
  }
68
  if (isset($this->simpleIds[$productId])) {
69
  return $this->simpleIds[$productId];
70
  }
71
+
72
  return null;
73
  }
74
+ }
app/code/community/Remarkety/Mgconnector/Helper/Urls.php CHANGED
@@ -30,17 +30,19 @@ class Remarkety_Mgconnector_Helper_Urls extends Mage_Core_Helper_Abstract
30
  }
31
 
32
  return $this->_urlKey[$store_id][$productId];
33
-
34
  }
 
35
  return false;
36
  }
37
 
38
- private function _getAttributeId() {
 
39
  if(!$this->_attributeId) {
40
  $this->_attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', 'url_key');
41
  }
 
42
  return $this->_attributeId;
43
  }
44
 
45
 
46
- }
30
  }
31
 
32
  return $this->_urlKey[$store_id][$productId];
 
33
  }
34
+
35
  return false;
36
  }
37
 
38
+ private function _getAttributeId()
39
+ {
40
  if(!$this->_attributeId) {
41
  $this->_attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', 'url_key');
42
  }
43
+
44
  return $this->_attributeId;
45
  }
46
 
47
 
48
+ }
app/code/community/Remarkety/Mgconnector/Model/Core/Api.php CHANGED
@@ -14,12 +14,23 @@ class Remarkety_Mgconnector_Model_Core_Api
14
  $limit = null,
15
  $page = null,
16
  $since_id = null,
17
- $returnLog = 0)
18
- {
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  $myModel = Mage::getModel("mgconnector/core");
21
- if ($returnLog)
22
- $myModel->sendLogInResponse();
23
 
24
  return $myModel->getCustomers(
25
  $mage_store_group_id,
@@ -27,7 +38,8 @@ class Remarkety_Mgconnector_Model_Core_Api
27
  $updated_at_max,
28
  $limit,
29
  $page,
30
- $since_id);
 
31
  }
32
 
33
  public function getOrders(
@@ -39,14 +51,26 @@ class Remarkety_Mgconnector_Model_Core_Api
39
  $since_id = null,
40
  $created_at_min = null,
41
  $created_at_max = null,
42
- $order_status = null, // Not implemented
 
43
  $order_id = null,
44
- $returnLog = 0)
45
- {
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  $myModel = Mage::getModel("mgconnector/core");
48
- if ($returnLog)
49
- $myModel->sendLogInResponse();
50
 
51
  return $myModel->getOrders(
52
  $mage_store_group_id,
@@ -58,7 +82,8 @@ class Remarkety_Mgconnector_Model_Core_Api
58
  $created_at_min,
59
  $created_at_max,
60
  $order_status, // Not implemented
61
- $order_id);
 
62
  }
63
 
64
  public function getQuotes(
@@ -68,12 +93,23 @@ class Remarkety_Mgconnector_Model_Core_Api
68
  $limit = null,
69
  $page = null,
70
  $since_id = null,
71
- $returnLog = 0)
72
- {
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  $myModel = Mage::getModel("mgconnector/core");
75
- if ($returnLog)
76
- $myModel->sendLogInResponse();
77
 
78
  return $myModel->getQuotes(
79
  $mage_store_group_id,
@@ -81,7 +117,8 @@ class Remarkety_Mgconnector_Model_Core_Api
81
  $updated_at_max,
82
  $limit,
83
  $page,
84
- $since_id);
 
85
  }
86
 
87
  public function getProducts(
@@ -90,21 +127,37 @@ class Remarkety_Mgconnector_Model_Core_Api
90
  $updated_at_max = null,
91
  $limit = null,
92
  $page = null,
93
- $handle = null, // Not implemented
94
- $vendor = null, // Not implemented
95
- $product_type = null, // Not implemented
96
- $collection_id = null, // Not implemented
 
 
 
 
97
  $since_id = null,
98
  $created_at_min = null,
99
  $created_at_max = null,
100
- $published_status = null, // Not implemented
 
101
  $product_id = null,
102
- $returnLog = 0)
103
- {
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  $myModel = Mage::getModel("mgconnector/core");
106
- if ($returnLog)
107
- $myModel->sendLogInResponse();
108
  return $myModel->getProducts(
109
  $mage_store_view_id,
110
  $updated_at_min,
@@ -120,57 +173,71 @@ class Remarkety_Mgconnector_Model_Core_Api
120
  $created_at_max,
121
  $published_status,
122
  $product_id,
123
- $returnLog);
 
124
  }
125
 
126
- public function getSubscribers($mage_store_view_id = null,
 
127
  $limit = null,
128
  $page = null,
129
- $sinceId = null,
130
- $returnLog = 0)
131
- {
 
 
 
 
 
 
 
 
 
 
 
132
  $myModel = Mage::getModel("mgconnector/core");
133
- if ($returnLog)
134
- $myModel->sendLogInResponse();
135
 
136
  return $myModel->getSubscribers(
137
  $mage_store_view_id,
138
  $limit,
139
  $page,
140
- $sinceId);
 
141
  }
142
 
143
  public function getSubscriberCount($mage_store_view_id = null, $returnLog = 0)
144
  {
145
 
146
- $myModel = Mage::getModel("mgconnector/core");
147
- if ($returnLog)
148
- $myModel->sendLogInResponse();
149
 
150
- return $myModel->getSubscriberCount($mage_store_view_id);
151
  }
152
 
153
  public function getStoreSettings($mage_store_view_id = null, $returnLog = 0)
154
  {
155
  $myModel = Mage::getModel("mgconnector/core");
156
- if ($returnLog)
157
- $myModel->sendLogInResponse();
158
  return $myModel->getStoreSettings($mage_store_view_id);
159
  }
160
 
161
  public function getStoreOrderStatuses($mage_store_view_id, $returnLog = 0)
162
  {
163
  $myModel = Mage::getModel("mgconnector/core");
164
- if ($returnLog)
165
- $myModel->sendLogInResponse();
166
  return $myModel->getStoreOrderStatuses($mage_store_view_id);
167
  }
168
 
169
  public function createCoupon($rule_id, $coupon_code, $expiration, $returnLog = 0)
170
  {
171
  $myModel = Mage::getModel("mgconnector/core");
172
- if ($returnLog)
173
- $myModel->sendLogInResponse();
174
  $ret = $myModel->createCoupon($rule_id, $coupon_code, $expiration);
175
  return $ret;
176
  }
@@ -178,8 +245,8 @@ class Remarkety_Mgconnector_Model_Core_Api
178
  public function unsubscribe($email, $returnLog = 0)
179
  {
180
  $myModel = Mage::getModel('mgconnector/core');
181
- if ($returnLog)
182
- $myModel->sendLogInResponse();
183
  $ret = $myModel->unsubscribe($email);
184
  return $ret;
185
  }
@@ -187,25 +254,25 @@ class Remarkety_Mgconnector_Model_Core_Api
187
  public function getCustomersCount($mage_store_group_id, $returnLog = 0)
188
  {
189
  $myModel = Mage::getModel("mgconnector/core");
190
- if ($returnLog)
191
- $myModel->sendLogInResponse();
192
  return $myModel->getCustomersCount($mage_store_group_id);
193
  }
194
 
195
  public function getOrdersCount($mage_store_group_id, $returnLog = 0)
196
  {
197
  $myModel = Mage::getModel("mgconnector/core");
198
- if ($returnLog)
199
- $myModel->sendLogInResponse();
200
  return $myModel->getOrdersCount($mage_store_group_id);
201
  }
202
 
203
  public function getProductsCount($mage_view_id, $returnLog = 0)
204
  {
205
  $myModel = Mage::getModel("mgconnector/core");
206
- if ($returnLog)
207
- $myModel->sendLogInResponse();
208
  $ret = $myModel->getProductsCount($mage_view_id);
209
  return $ret;
210
  }
211
- }
14
  $limit = null,
15
  $page = null,
16
  $since_id = null,
17
+ $returnLog = 0
18
+ )
19
+ {
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
 
31
  $myModel = Mage::getModel("mgconnector/core");
32
+ if ($returnLog)
33
+ $myModel->sendLogInResponse();
34
 
35
  return $myModel->getCustomers(
36
  $mage_store_group_id,
38
  $updated_at_max,
39
  $limit,
40
  $page,
41
+ $since_id
42
+ );
43
  }
44
 
45
  public function getOrders(
51
  $since_id = null,
52
  $created_at_min = null,
53
  $created_at_max = null,
54
+ $order_status = null,
55
+ // Not implemented
56
  $order_id = null,
57
+ $returnLog = 0
58
+ )
59
+ {
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
 
71
  $myModel = Mage::getModel("mgconnector/core");
72
+ if ($returnLog)
73
+ $myModel->sendLogInResponse();
74
 
75
  return $myModel->getOrders(
76
  $mage_store_group_id,
82
  $created_at_min,
83
  $created_at_max,
84
  $order_status, // Not implemented
85
+ $order_id
86
+ );
87
  }
88
 
89
  public function getQuotes(
93
  $limit = null,
94
  $page = null,
95
  $since_id = null,
96
+ $returnLog = 0
97
+ )
98
+ {
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
 
110
  $myModel = Mage::getModel("mgconnector/core");
111
+ if ($returnLog)
112
+ $myModel->sendLogInResponse();
113
 
114
  return $myModel->getQuotes(
115
  $mage_store_group_id,
117
  $updated_at_max,
118
  $limit,
119
  $page,
120
+ $since_id
121
+ );
122
  }
123
 
124
  public function getProducts(
127
  $updated_at_max = null,
128
  $limit = null,
129
  $page = null,
130
+ $handle = null,
131
+ // Not implemented
132
+ $vendor = null,
133
+ // Not implemented
134
+ $product_type = null,
135
+ // Not implemented
136
+ $collection_id = null,
137
+ // Not implemented
138
  $since_id = null,
139
  $created_at_min = null,
140
  $created_at_max = null,
141
+ $published_status = null,
142
+ // Not implemented
143
  $product_id = null,
144
+ $returnLog = 0
145
+ )
146
+ {
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
 
158
  $myModel = Mage::getModel("mgconnector/core");
159
+ if ($returnLog)
160
+ $myModel->sendLogInResponse();
161
  return $myModel->getProducts(
162
  $mage_store_view_id,
163
  $updated_at_min,
173
  $created_at_max,
174
  $published_status,
175
  $product_id,
176
+ $returnLog
177
+ );
178
  }
179
 
180
+ public function getSubscribers(
181
+ $mage_store_view_id = null,
182
  $limit = null,
183
  $page = null,
184
+ $sinceId = null,
185
+ $returnLog = 0
186
+ )
187
+ {
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
  $myModel = Mage::getModel("mgconnector/core");
199
+ if ($returnLog)
200
+ $myModel->sendLogInResponse();
201
 
202
  return $myModel->getSubscribers(
203
  $mage_store_view_id,
204
  $limit,
205
  $page,
206
+ $sinceId
207
+ );
208
  }
209
 
210
  public function getSubscriberCount($mage_store_view_id = null, $returnLog = 0)
211
  {
212
 
213
+ $myModel = Mage::getModel("mgconnector/core");
214
+ if ($returnLog)
215
+ $myModel->sendLogInResponse();
216
 
217
+ return $myModel->getSubscriberCount($mage_store_view_id);
218
  }
219
 
220
  public function getStoreSettings($mage_store_view_id = null, $returnLog = 0)
221
  {
222
  $myModel = Mage::getModel("mgconnector/core");
223
+ if ($returnLog)
224
+ $myModel->sendLogInResponse();
225
  return $myModel->getStoreSettings($mage_store_view_id);
226
  }
227
 
228
  public function getStoreOrderStatuses($mage_store_view_id, $returnLog = 0)
229
  {
230
  $myModel = Mage::getModel("mgconnector/core");
231
+ if ($returnLog)
232
+ $myModel->sendLogInResponse();
233
  return $myModel->getStoreOrderStatuses($mage_store_view_id);
234
  }
235
 
236
  public function createCoupon($rule_id, $coupon_code, $expiration, $returnLog = 0)
237
  {
238
  $myModel = Mage::getModel("mgconnector/core");
239
+ if ($returnLog)
240
+ $myModel->sendLogInResponse();
241
  $ret = $myModel->createCoupon($rule_id, $coupon_code, $expiration);
242
  return $ret;
243
  }
245
  public function unsubscribe($email, $returnLog = 0)
246
  {
247
  $myModel = Mage::getModel('mgconnector/core');
248
+ if ($returnLog)
249
+ $myModel->sendLogInResponse();
250
  $ret = $myModel->unsubscribe($email);
251
  return $ret;
252
  }
254
  public function getCustomersCount($mage_store_group_id, $returnLog = 0)
255
  {
256
  $myModel = Mage::getModel("mgconnector/core");
257
+ if ($returnLog)
258
+ $myModel->sendLogInResponse();
259
  return $myModel->getCustomersCount($mage_store_group_id);
260
  }
261
 
262
  public function getOrdersCount($mage_store_group_id, $returnLog = 0)
263
  {
264
  $myModel = Mage::getModel("mgconnector/core");
265
+ if ($returnLog)
266
+ $myModel->sendLogInResponse();
267
  return $myModel->getOrdersCount($mage_store_group_id);
268
  }
269
 
270
  public function getProductsCount($mage_view_id, $returnLog = 0)
271
  {
272
  $myModel = Mage::getModel("mgconnector/core");
273
+ if ($returnLog)
274
+ $myModel->sendLogInResponse();
275
  $ret = $myModel->getProductsCount($mage_view_id);
276
  return $ret;
277
  }
278
+ }
app/code/community/Remarkety/Mgconnector/Model/Extension/RewardPoints/MagestoreRewardPoints.php CHANGED
@@ -49,7 +49,8 @@ class Remarkety_Mgconnector_Model_Extension_RewardPoints_MagestoreRewardPoints
49
  public function modifyCustomersCollection(&$collection)
50
  {
51
  $collection->getSelect()
52
- ->joinLeft(array('rp' => $collection->getTable('rewardpoints/customer')),
 
53
  'e.entity_id = rp.customer_id',
54
  array('rewards_points' => 'point_balance')
55
  );
49
  public function modifyCustomersCollection(&$collection)
50
  {
51
  $collection->getSelect()
52
+ ->joinLeft(
53
+ array('rp' => $collection->getTable('rewardpoints/customer')),
54
  'e.entity_id = rp.customer_id',
55
  array('rewards_points' => 'point_balance')
56
  );
app/code/community/Remarkety/Mgconnector/Model/Install.php CHANGED
@@ -1,486 +1,505 @@
1
- <?php
2
-
3
- /**
4
- * Install model
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Model_Install
11
- {
12
- /**
13
- * Upgrade mode code
14
- */
15
- const MODE_UPGRADE = 'upgrade';
16
-
17
- /**
18
- * Install create mode code
19
- */
20
- const MODE_INSTALL_CREATE = 'install_create';
21
-
22
- /**
23
- * Install login mode code
24
- */
25
- const MODE_INSTALL_LOGIN = 'install_login';
26
-
27
- /**
28
- * Completed mode code
29
- */
30
- const MODE_COMPLETE = 'complete';
31
-
32
- /**
33
- * Welcome mode code
34
- */
35
- const MODE_WELCOME = 'welcome';
36
-
37
- /**
38
- * Web service remarkety username
39
- */
40
- const WEB_SERVICE_USERNAME = 'remarkety';
41
-
42
- /**
43
- * Web service role name
44
- */
45
- const WEB_SERVICE_ROLE = 'remarkety';
46
-
47
- /**
48
- * Store code scope
49
- */
50
- const STORE_SCOPE = 'stores';
51
-
52
- /**
53
- * Key in config for installed flag
54
- */
55
- const XPATH_INSTALLED = 'remarkety/mgconnector/installed';
56
-
57
- /**
58
- * Install data
59
- *
60
- * @var array
61
- */
62
- protected $_data = null;
63
-
64
- /**
65
- * Set data
66
- *
67
- * @param array $data
68
- * @return Remarkety_Mgconnector_Model_Install
69
- */
70
- public function setData(array $data)
71
- {
72
- $this->_data['mode'] = $data['mode'];
73
- $this->_data['email']= array_key_exists('email', $data) ? $data['email'] : null;
74
- $this->_data['first_name']= array_key_exists('first_name', $data) ? $data['first_name'] : null;
75
- $this->_data['last_name']= array_key_exists('last_name', $data) ? $data['last_name'] : null;
76
- $this->_data['phone']= array_key_exists('phone', $data) ? $data['phone'] : null;
77
- $this->_data['password']= array_key_exists('password', $data) ? $data['password'] : null;
78
- $this->_data['terms'] = array_key_exists('terms', $data) ? ($data['terms']== '1' ? 'true' : 'false') : null;
79
- $this->_data['store_id'] = array_key_exists('store_id', $data) ? $data['store_id'] : null;
80
- $this->_data['key'] = array_key_exists('key', $data) ? $data['key'] : null;
81
-
82
- return $this;
83
- }
84
-
85
- /**
86
- * Get data
87
- *
88
- * @return array
89
- */
90
- public function getData()
91
- {
92
- return $this->_data;
93
- }
94
-
95
- /**
96
- * Create web service role and user
97
- *
98
- * @throws Exception
99
- * @throws Mage_Core_Exception
100
- * @return Remarkety_Mgconnector_Model_Install
101
- */
102
- protected function _webServiceConfiguration()
103
- {
104
- $this->_data['key'] = $this->_generateApiKey();
105
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/api_key', $this->_data['key']);
106
-
107
- $wsFirstName = array_key_exists('first_name', $this->_data) && !empty($this->_data['first_name']) ? $this->_data['first_name'] : "Remarkety";
108
- $wsLastName = array_key_exists('last_name', $this->_data) && !empty($this->_data['last_name']) ? $this->_data['last_name'] : "API";
109
-
110
- if(!$this->_getWebServiceUser()->getId()) {
111
- $email = $this->_data['email'];
112
-
113
- $role = Mage::getModel('api/roles')
114
- ->setName(self::WEB_SERVICE_ROLE)
115
- ->setPid(false)
116
- ->setRoleType('G')
117
- ->save();
118
-
119
- Mage::getModel("api/rules")
120
- ->setRoleId($role->getId())
121
- ->setResources(array('all'))
122
- ->saveRel();
123
-
124
- $user = Mage::getModel('api/user')
125
- ->setData(array(
126
- 'username' => self::WEB_SERVICE_ROLE,
127
- 'firstname' => $wsFirstName,
128
- 'lastname' => $wsLastName,
129
- 'email' => $email,
130
- 'api_key' => $this->_data['key'],
131
- 'api_key_confirmation' => $this->_data['key'],
132
- 'is_active' => 1,
133
- 'user_roles' => '',
134
- 'assigned_user_role' => '',
135
- 'role_name' => '',
136
- 'roles' => array($role->getId())
137
- ));
138
-
139
- $retries = 0;
140
- $maxRetries = 5;
141
- while ($user->userExists() && $retries++ < $maxRetries) {
142
- $email = "_$email";
143
- $user->setData("email", $email);
144
- }
145
- if ($retries == $maxRetries) {
146
- throw new Exception("Could not create WebService user - all emails are taken");
147
- }
148
- $user->save();
149
-
150
- $user
151
- ->setRoleIds(array($role->getId()))
152
- ->setRoleUserId($user->getUserId())
153
- ->saveRelations();
154
- } else {
155
- $this
156
- ->_getWebServiceUser()
157
- //->setEmail($this->_data['email'])
158
- ->setFirstname($wsFirstName)
159
- ->setLastname($wsLastName)
160
- ->setNewApiKey($this->_data['key'])
161
- ->save();
162
- }
163
-
164
- return $this;
165
- }
166
-
167
- /**
168
- * Send request
169
- *
170
- * @param $payload
171
- * @return Remarkety_Mgconnector_Model_Install
172
- */
173
- protected function _sendRequest($payload)
174
- {
175
- Mage::getModel('mgconnector/request')->makeRequest($payload);
176
-
177
- return $this;
178
- }
179
-
180
- /**
181
- * Install extension creating new remarkety account
182
- *
183
- * @return Remarkety_Mgconnector_Model_Install
184
- * @throws Mage_Core_Exception
185
- */
186
- public function installByCreateExtension()
187
- {
188
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
189
-
190
- try {
191
- $connection->beginTransaction();
192
-
193
- $this->_webServiceConfiguration();
194
-
195
- $connection->commit();
196
- } catch(Mage_Core_Exception $e) {
197
- $connection->rollback();
198
- throw new Mage_Core_Exception($e->getMessage());
199
- }
200
-
201
- // Make sure that store_id entry is an array
202
- if(!empty($this->_data['store_id']) && !is_array($this->_data['store_id'])) {
203
- $this->_data['store_id'] = (array)$this->_data['store_id'];
204
- }
205
-
206
- // Create request for each store view separately
207
- foreach($this->_data['store_id'] as $_storeId) {
208
- $store = Mage::getModel('core/store')->load($_storeId);
209
- $this->_sendRequest(array(
210
- 'key' => $this->_data['key'],
211
- 'email' => $this->_data['email'],
212
- 'password' => $this->_data['password'],
213
- 'acceptTerms' => $this->_data['terms'],
214
- 'selectedView' => json_encode(array(
215
- 'website_id' => $store->getWebsiteId(),
216
- 'store_id' => $store->getGroupId(),
217
- 'view_id' => $_storeId,
218
- )),
219
- 'isNewUser' => true,
220
- 'firstName' => $this->_data['first_name'],
221
- 'lastName' => $this->_data['last_name'],
222
- 'phone' => $this->_data['phone'],
223
- 'storeFrontUrl' => $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK),
224
- 'viewName' => $store->name,
225
- 'ip' => Mage::helper('core/http')->getRemoteAddr()
226
- ));
227
-
228
- $this->_markInstalled($_storeId);
229
- }
230
-
231
- // Reinitialize configuration
232
- Mage::app()->getCacheInstance()->cleanType('config');
233
- Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
234
-
235
- return $this;
236
- }
237
-
238
- /**
239
- * Install extension using existing remarkety account
240
- *
241
- * @return Remarkety_Mgconnector_Model_Install
242
- * @throws Mage_Core_Exception
243
- */
244
- public function installByLoginExtension()
245
- {
246
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
247
-
248
- try {
249
- $connection->beginTransaction();
250
-
251
- $this->_webServiceConfiguration();
252
-
253
- $connection->commit();
254
- } catch(Mage_Core_Exception $e) {
255
- $connection->rollback();
256
- throw new Mage_Core_Exception($e->getMessage());
257
- }
258
-
259
- // Make sure that store_id entry is an array
260
- if(!empty($this->_data['store_id']) && !is_array($this->_data['store_id'])) {
261
- $this->_data['store_id'] = (array)$this->_data['store_id'];
262
- }
263
-
264
- // Create request for each store view separately
265
- foreach($this->_data['store_id'] as $_storeId) {
266
- $store = Mage::getModel('core/store')->load($_storeId);
267
-
268
- $this->_sendRequest(array(
269
- 'key' => $this->_data['key'],
270
- 'email' => $this->_data['email'],
271
- 'password' => $this->_data['password'],
272
- 'acceptTerms' => $this->_data['terms'],
273
- 'selectedView' => json_encode(array(
274
- 'website_id' => $store->getWebsiteId(),
275
- 'store_id' => $store->getGroupId(),
276
- 'view_id' => $_storeId,
277
- )),
278
- 'isNewUser' => false,
279
- 'storeFrontUrl' => $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK),
280
- 'viewName' => $store->name,
281
- 'ip' => Mage::helper('core/http')->getRemoteAddr()
282
- ));
283
-
284
- $this->_markInstalled($_storeId);
285
- }
286
-
287
- // Reinitialize configuration
288
- Mage::app()->getCacheInstance()->cleanType('config');
289
- Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
290
-
291
- return $this;
292
- }
293
-
294
- /**
295
- * Upgrade extension
296
- *
297
- * @return Remarkety_Mgconnector_Model_Install
298
- * @throws Mage_Core_Exception
299
- */
300
- public function upgradeExtension()
301
- {
302
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
303
-
304
- try {
305
- $connection->beginTransaction();
306
-
307
- $webServiceUser = $this->_getWebServiceUser();
308
-
309
- $this->_data['email'] = $webServiceUser->getEmail();
310
- $this->_data['key'] = $this->_generateApiKey();
311
-
312
- $this
313
- ->_getWebServiceUser()
314
- ->setNewApiKey($this->_data['key'])
315
- ->save();
316
-
317
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/api_key', $this->_data['key']);
318
-
319
- $connection->commit();
320
- } catch(Mage_Core_Exception $e) {
321
- $connection->rollback();
322
- throw new Mage_Core_Exception($e->getMessage());
323
- }
324
-
325
- $this->_sendRequest(array());
326
-
327
- return $this;
328
- }
329
-
330
- /**
331
- * Complete extension installation
332
- *
333
- * @return Remarkety_Mgconnector_Model_Install
334
- * @throws Mage_Core_Exception
335
- */
336
- public function completeExtensionInstallation()
337
- {
338
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
339
-
340
- try {
341
- $connection->beginTransaction();
342
-
343
- $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
344
- Mage::getModel('core/config')->saveConfig(self::XPATH_INSTALLED, $ver);
345
-
346
- $intervals = Mage::getStoreConfig('mgconnector_options/mgconnector_options_group/intervals');
347
- if(!empty($intervals)) {
348
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', $intervals);
349
- } else {
350
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', "1,3,10");
351
- }
352
-
353
- // remove old config entries if exist
354
- Mage::getModel('core/config')
355
- ->deleteConfig('mgconnector_options/mgconnector_options_group/api_key')
356
- ->deleteConfig('mgconnector_options/mgconnector_options_group/intervals');
357
-
358
- // remove old files
359
- $blockDir = Mage::getModuleDir('Block', 'Remarkety_Mgconnector') . DS . 'Block';
360
- $etcDir = Mage::getModuleDir('etc', 'Remarkety_Mgconnector');
361
-
362
- if(file_exists($file = $etcDir . DS . 'system.xml')) {
363
- unlink($file);
364
- }
365
- if(file_exists($file = $blockDir . DS . 'Adminhtml' . DS . 'Mgconnector.php')) {
366
- unlink($file);
367
- }
368
- if(file_exists($file = $blockDir . DS . 'Adminhtml' . DS . 'Mgconnector' . DS . 'Grid.php')) {
369
- unlink($file);
370
- }
371
- if(file_exists($file = $blockDir . DS . 'Adminhtml' . DS . 'Mgconnector' . DS . 'Grid' . DS . 'Column' . DS . 'Renderer' . DS . 'Status.php')) {
372
- unlink($file);
373
- }
374
-
375
- $connection->commit();
376
- } catch(Mage_Core_Exception $e) {
377
- $connection->rollback();
378
- throw new Mage_Core_Exception($e->getMessage());
379
- }
380
-
381
- return $this;
382
- }
383
-
384
- /**
385
- * Generate new api key
386
- *
387
- * @return string
388
- * @throws Mage_Core_Exception
389
- */
390
- protected function _generateApiKey()
391
- {
392
- $apiKey = Mage::getStoreConfig('remarkety/mgconnector/api_key');
393
- if (!empty($apiKey))
394
- return $apiKey;
395
- if(!empty($this->_data['email'])) {
396
- return md5($this->_data['email'] . time());
397
- }
398
- throw new Mage_Core_Exception('Can not generate api key');
399
- }
400
-
401
- /**
402
- * Return remarkety webservice user
403
- *
404
- * @return Mage_Api_Model_User
405
- */
406
- protected function _getWebServiceUser()
407
- {
408
- $webServiceUser = Mage::getModel('api/user')
409
- ->loadByUsername(self::WEB_SERVICE_USERNAME);
410
-
411
- return $webServiceUser;
412
- }
413
-
414
- /**
415
- * Return remarkety webservice user by email
416
- *
417
- * @param string $email
418
- * @return Mage_Api_Model_User
419
- */
420
- protected function _getWebServiceUserByEmail($email) {
421
- $webServiceUser = Mage::getModel('api/user')
422
- ->loadByEmail($email);
423
-
424
- return $webServiceUser;
425
- }
426
-
427
- /**
428
- * Mark extension as installed for provided store id
429
- *
430
- * @param int $storeId
431
- * @throws Mage_Core_Exception
432
- * @return Remarkety_Mgconnector_Model_Install
433
- */
434
- protected function _markInstalled($storeId) {
435
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
436
-
437
- try {
438
- $connection->beginTransaction();
439
-
440
- $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
441
- Mage::getModel('core/config')->saveConfig(
442
- self::XPATH_INSTALLED,
443
- $ver,
444
- self::STORE_SCOPE,
445
- $storeId
446
- );
447
-
448
- $response = Mage::getSingleton('core/session')->getRemarketyLastResponseMessage();
449
- $response = !empty($response) ? unserialize($response) : array();
450
- if(!empty($response['storePublicId'])){
451
- /**
452
- * @var $m Remarkety_Mgconnector_Model_Webtracking
453
- */
454
- $m = Mage::getModel('mgconnector/webtracking');
455
- $m->setRemarketyPublicId($storeId, $response['storePublicId']);
456
- }
457
-
458
- $connection->commit();
459
- } catch(Mage_Core_Exception $e) {
460
- $connection->rollback();
461
- throw new Mage_Core_Exception($e->getMessage());
462
- }
463
-
464
- return $this;
465
- }
466
-
467
- /**
468
- * Return core_config_data entries for stores where extension is installed
469
- *
470
- * @return object
471
- */
472
- public function getConfiguredStores()
473
- {
474
- $collection = Mage::getModel('core/config_data')->getCollection();
475
- $collection
476
- ->getSelect()
477
- ->where('scope = ?', self::STORE_SCOPE)
478
- ->where('path = ?', self::XPATH_INSTALLED);
479
-
480
- return $collection;
481
- }
482
-
483
- public static function isMultipleStores() {
484
- return 'true' === 'true';
485
- }
486
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Install model
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Model_Install
11
+ {
12
+ /**
13
+ * Upgrade mode code
14
+ */
15
+ const MODE_UPGRADE = 'upgrade';
16
+
17
+ /**
18
+ * Install create mode code
19
+ */
20
+ const MODE_INSTALL_CREATE = 'install_create';
21
+
22
+ /**
23
+ * Install login mode code
24
+ */
25
+ const MODE_INSTALL_LOGIN = 'install_login';
26
+
27
+ /**
28
+ * Completed mode code
29
+ */
30
+ const MODE_COMPLETE = 'complete';
31
+
32
+ /**
33
+ * Welcome mode code
34
+ */
35
+ const MODE_WELCOME = 'welcome';
36
+
37
+ /**
38
+ * Web service remarkety username
39
+ */
40
+ const WEB_SERVICE_USERNAME = 'remarkety';
41
+
42
+ /**
43
+ * Web service role name
44
+ */
45
+ const WEB_SERVICE_ROLE = 'remarkety';
46
+
47
+ /**
48
+ * Store code scope
49
+ */
50
+ const STORE_SCOPE = 'stores';
51
+
52
+ /**
53
+ * Key in config for installed flag
54
+ */
55
+ const XPATH_INSTALLED = 'remarkety/mgconnector/installed';
56
+
57
+ /**
58
+ * Install data
59
+ *
60
+ * @var array
61
+ */
62
+ protected $_data = null;
63
+
64
+ /**
65
+ * Set data
66
+ *
67
+ * @param array $data
68
+ * @return Remarkety_Mgconnector_Model_Install
69
+ */
70
+ public function setData(array $data)
71
+ {
72
+ $this->_data['mode'] = $data['mode'];
73
+ $this->_data['email']= array_key_exists('email', $data) ? $data['email'] : null;
74
+ $this->_data['first_name']= array_key_exists('first_name', $data) ? $data['first_name'] : null;
75
+ $this->_data['last_name']= array_key_exists('last_name', $data) ? $data['last_name'] : null;
76
+ $this->_data['phone']= array_key_exists('phone', $data) ? $data['phone'] : null;
77
+ $this->_data['password']= array_key_exists('password', $data) ? $data['password'] : null;
78
+ $this->_data['terms'] = array_key_exists('terms', $data) ? ($data['terms']== '1' ? 'true' : 'false') : null;
79
+ $this->_data['store_id'] = array_key_exists('store_id', $data) ? $data['store_id'] : null;
80
+ $this->_data['key'] = array_key_exists('key', $data) ? $data['key'] : null;
81
+
82
+ return $this;
83
+ }
84
+
85
+ /**
86
+ * Get data
87
+ *
88
+ * @return array
89
+ */
90
+ public function getData()
91
+ {
92
+ return $this->_data;
93
+ }
94
+
95
+ /**
96
+ * Create web service role and user
97
+ *
98
+ * @throws Exception
99
+ * @throws Mage_Core_Exception
100
+ * @return Remarkety_Mgconnector_Model_Install
101
+ */
102
+ protected function _webServiceConfiguration()
103
+ {
104
+ $this->_data['key'] = $this->_generateApiKey();
105
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/api_key', $this->_data['key']);
106
+
107
+ $wsFirstName = array_key_exists('first_name', $this->_data) && !empty($this->_data['first_name']) ? $this->_data['first_name'] : "Remarkety";
108
+ $wsLastName = array_key_exists('last_name', $this->_data) && !empty($this->_data['last_name']) ? $this->_data['last_name'] : "API";
109
+
110
+ if(!$this->_getWebServiceUser()->getId()) {
111
+ $email = $this->_data['email'];
112
+
113
+ $role = Mage::getModel('api/roles')
114
+ ->setName(self::WEB_SERVICE_ROLE)
115
+ ->setPid(false)
116
+ ->setRoleType('G')
117
+ ->save();
118
+
119
+ Mage::getModel("api/rules")
120
+ ->setRoleId($role->getId())
121
+ ->setResources(array('all'))
122
+ ->saveRel();
123
+
124
+ $user = Mage::getModel('api/user')
125
+ ->setData(
126
+ array(
127
+ 'username' => self::WEB_SERVICE_ROLE,
128
+ 'firstname' => $wsFirstName,
129
+ 'lastname' => $wsLastName,
130
+ 'email' => $email,
131
+ 'api_key' => $this->_data['key'],
132
+ 'api_key_confirmation' => $this->_data['key'],
133
+ 'is_active' => 1,
134
+ 'user_roles' => '',
135
+ 'assigned_user_role' => '',
136
+ 'role_name' => '',
137
+ 'roles' => array($role->getId())
138
+ )
139
+ );
140
+
141
+ $retries = 0;
142
+ $maxRetries = 5;
143
+ while ($user->userExists() && $retries++ < $maxRetries) {
144
+ $email = "_$email";
145
+ $user->setData("email", $email);
146
+ }
147
+
148
+ if ($retries == $maxRetries) {
149
+ throw new Exception("Could not create WebService user - all emails are taken");
150
+ }
151
+
152
+ $user->save();
153
+
154
+ $user
155
+ ->setRoleIds(array($role->getId()))
156
+ ->setRoleUserId($user->getUserId())
157
+ ->saveRelations();
158
+ } else {
159
+ $this
160
+ ->_getWebServiceUser()
161
+ //->setEmail($this->_data['email'])
162
+ ->setFirstname($wsFirstName)
163
+ ->setLastname($wsLastName)
164
+ ->setNewApiKey($this->_data['key'])
165
+ ->save();
166
+ }
167
+
168
+ return $this;
169
+ }
170
+
171
+ /**
172
+ * Send request
173
+ *
174
+ * @param $payload
175
+ * @return Remarkety_Mgconnector_Model_Install
176
+ */
177
+ protected function _sendRequest($payload)
178
+ {
179
+ Mage::getModel('mgconnector/request')->makeRequest($payload);
180
+
181
+ return $this;
182
+ }
183
+
184
+ /**
185
+ * Install extension creating new remarkety account
186
+ *
187
+ * @return Remarkety_Mgconnector_Model_Install
188
+ * @throws Mage_Core_Exception
189
+ */
190
+ public function installByCreateExtension()
191
+ {
192
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
193
+
194
+ try {
195
+ $connection->beginTransaction();
196
+
197
+ $this->_webServiceConfiguration();
198
+
199
+ $connection->commit();
200
+ } catch(Mage_Core_Exception $e) {
201
+ $connection->rollback();
202
+ throw new Mage_Core_Exception($e->getMessage());
203
+ }
204
+
205
+ // Make sure that store_id entry is an array
206
+ if(!empty($this->_data['store_id']) && !is_array($this->_data['store_id'])) {
207
+ $this->_data['store_id'] = (array)$this->_data['store_id'];
208
+ }
209
+
210
+ // Create request for each store view separately
211
+ foreach($this->_data['store_id'] as $_storeId) {
212
+ $store = Mage::getModel('core/store')->load($_storeId);
213
+ $this->_sendRequest(
214
+ array(
215
+ 'key' => $this->_data['key'],
216
+ 'email' => $this->_data['email'],
217
+ 'password' => $this->_data['password'],
218
+ 'acceptTerms' => $this->_data['terms'],
219
+ 'selectedView' => json_encode(
220
+ array(
221
+ 'website_id' => $store->getWebsiteId(),
222
+ 'store_id' => $store->getGroupId(),
223
+ 'view_id' => $_storeId,
224
+ )
225
+ ),
226
+ 'isNewUser' => true,
227
+ 'firstName' => $this->_data['first_name'],
228
+ 'lastName' => $this->_data['last_name'],
229
+ 'phone' => $this->_data['phone'],
230
+ 'storeFrontUrl' => $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK),
231
+ 'viewName' => $store->name,
232
+ 'ip' => Mage::helper('core/http')->getRemoteAddr()
233
+ )
234
+ );
235
+
236
+ $this->_markInstalled($_storeId);
237
+ }
238
+
239
+ // Reinitialize configuration
240
+ Mage::app()->getCacheInstance()->cleanType('config');
241
+ Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
242
+
243
+ return $this;
244
+ }
245
+
246
+ /**
247
+ * Install extension using existing remarkety account
248
+ *
249
+ * @return Remarkety_Mgconnector_Model_Install
250
+ * @throws Mage_Core_Exception
251
+ */
252
+ public function installByLoginExtension()
253
+ {
254
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
255
+
256
+ try {
257
+ $connection->beginTransaction();
258
+
259
+ $this->_webServiceConfiguration();
260
+
261
+ $connection->commit();
262
+ } catch(Mage_Core_Exception $e) {
263
+ $connection->rollback();
264
+ throw new Mage_Core_Exception($e->getMessage());
265
+ }
266
+
267
+ // Make sure that store_id entry is an array
268
+ if(!empty($this->_data['store_id']) && !is_array($this->_data['store_id'])) {
269
+ $this->_data['store_id'] = (array)$this->_data['store_id'];
270
+ }
271
+
272
+ // Create request for each store view separately
273
+ foreach($this->_data['store_id'] as $_storeId) {
274
+ $store = Mage::getModel('core/store')->load($_storeId);
275
+
276
+ $this->_sendRequest(
277
+ array(
278
+ 'key' => $this->_data['key'],
279
+ 'email' => $this->_data['email'],
280
+ 'password' => $this->_data['password'],
281
+ 'acceptTerms' => $this->_data['terms'],
282
+ 'selectedView' => json_encode(
283
+ array(
284
+ 'website_id' => $store->getWebsiteId(),
285
+ 'store_id' => $store->getGroupId(),
286
+ 'view_id' => $_storeId,
287
+ )
288
+ ),
289
+ 'isNewUser' => false,
290
+ 'storeFrontUrl' => $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK),
291
+ 'viewName' => $store->name,
292
+ 'ip' => Mage::helper('core/http')->getRemoteAddr()
293
+ )
294
+ );
295
+
296
+ $this->_markInstalled($_storeId);
297
+ }
298
+
299
+ // Reinitialize configuration
300
+ Mage::app()->getCacheInstance()->cleanType('config');
301
+ Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
302
+
303
+ return $this;
304
+ }
305
+
306
+ /**
307
+ * Upgrade extension
308
+ *
309
+ * @return Remarkety_Mgconnector_Model_Install
310
+ * @throws Mage_Core_Exception
311
+ */
312
+ public function upgradeExtension()
313
+ {
314
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
315
+
316
+ try {
317
+ $connection->beginTransaction();
318
+
319
+ $webServiceUser = $this->_getWebServiceUser();
320
+
321
+ $this->_data['email'] = $webServiceUser->getEmail();
322
+ $this->_data['key'] = $this->_generateApiKey();
323
+
324
+ $this
325
+ ->_getWebServiceUser()
326
+ ->setNewApiKey($this->_data['key'])
327
+ ->save();
328
+
329
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/api_key', $this->_data['key']);
330
+
331
+ $connection->commit();
332
+ } catch(Mage_Core_Exception $e) {
333
+ $connection->rollback();
334
+ throw new Mage_Core_Exception($e->getMessage());
335
+ }
336
+
337
+ $this->_sendRequest(array());
338
+
339
+ return $this;
340
+ }
341
+
342
+ /**
343
+ * Complete extension installation
344
+ *
345
+ * @return Remarkety_Mgconnector_Model_Install
346
+ * @throws Mage_Core_Exception
347
+ */
348
+ public function completeExtensionInstallation()
349
+ {
350
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
351
+
352
+ try {
353
+ $connection->beginTransaction();
354
+
355
+ $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
356
+ Mage::getModel('core/config')->saveConfig(self::XPATH_INSTALLED, $ver);
357
+
358
+ $intervals = Mage::getStoreConfig('mgconnector_options/mgconnector_options_group/intervals');
359
+ if(!empty($intervals)) {
360
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', $intervals);
361
+ } else {
362
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', "1,3,10");
363
+ }
364
+
365
+ // remove old config entries if exist
366
+ Mage::getModel('core/config')
367
+ ->deleteConfig('mgconnector_options/mgconnector_options_group/api_key')
368
+ ->deleteConfig('mgconnector_options/mgconnector_options_group/intervals');
369
+
370
+ // remove old files
371
+ $blockDir = Mage::getModuleDir('Block', 'Remarkety_Mgconnector') . DS . 'Block';
372
+ $etcDir = Mage::getModuleDir('etc', 'Remarkety_Mgconnector');
373
+
374
+ if(file_exists($file = $etcDir . DS . 'system.xml')) {
375
+ unlink($file);
376
+ }
377
+
378
+ if(file_exists($file = $blockDir . DS . 'Adminhtml' . DS . 'Mgconnector.php')) {
379
+ unlink($file);
380
+ }
381
+
382
+ if(file_exists($file = $blockDir . DS . 'Adminhtml' . DS . 'Mgconnector' . DS . 'Grid.php')) {
383
+ unlink($file);
384
+ }
385
+
386
+ if(file_exists($file = $blockDir . DS . 'Adminhtml' . DS . 'Mgconnector' . DS . 'Grid' . DS . 'Column' . DS . 'Renderer' . DS . 'Status.php')) {
387
+ unlink($file);
388
+ }
389
+
390
+ $connection->commit();
391
+ } catch(Mage_Core_Exception $e) {
392
+ $connection->rollback();
393
+ throw new Mage_Core_Exception($e->getMessage());
394
+ }
395
+
396
+ return $this;
397
+ }
398
+
399
+ /**
400
+ * Generate new api key
401
+ *
402
+ * @return string
403
+ * @throws Mage_Core_Exception
404
+ */
405
+ protected function _generateApiKey()
406
+ {
407
+ $apiKey = Mage::getStoreConfig('remarkety/mgconnector/api_key');
408
+ if (!empty($apiKey))
409
+ return $apiKey;
410
+ if(!empty($this->_data['email'])) {
411
+ return md5($this->_data['email'] . time());
412
+ }
413
+
414
+ throw new Mage_Core_Exception('Can not generate api key');
415
+ }
416
+
417
+ /**
418
+ * Return remarkety webservice user
419
+ *
420
+ * @return Mage_Api_Model_User
421
+ */
422
+ protected function _getWebServiceUser()
423
+ {
424
+ $webServiceUser = Mage::getModel('api/user')
425
+ ->loadByUsername(self::WEB_SERVICE_USERNAME);
426
+
427
+ return $webServiceUser;
428
+ }
429
+
430
+ /**
431
+ * Return remarkety webservice user by email
432
+ *
433
+ * @param string $email
434
+ * @return Mage_Api_Model_User
435
+ */
436
+ protected function _getWebServiceUserByEmail($email)
437
+ {
438
+ $webServiceUser = Mage::getModel('api/user')
439
+ ->loadByEmail($email);
440
+
441
+ return $webServiceUser;
442
+ }
443
+
444
+ /**
445
+ * Mark extension as installed for provided store id
446
+ *
447
+ * @param int $storeId
448
+ * @throws Mage_Core_Exception
449
+ * @return Remarkety_Mgconnector_Model_Install
450
+ */
451
+ protected function _markInstalled($storeId)
452
+ {
453
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
454
+
455
+ try {
456
+ $connection->beginTransaction();
457
+
458
+ $ver = Mage::getConfig()->getModuleConfig("Remarkety_Mgconnector")->version;
459
+ Mage::getModel('core/config')->saveConfig(
460
+ self::XPATH_INSTALLED,
461
+ $ver,
462
+ self::STORE_SCOPE,
463
+ $storeId
464
+ );
465
+
466
+ $response = Mage::getSingleton('core/session')->getRemarketyLastResponseMessage();
467
+ $response = !empty($response) ? unserialize($response) : array();
468
+ if(!empty($response['storePublicId'])){
469
+ /**
470
+ * @var $m Remarkety_Mgconnector_Model_Webtracking
471
+ */
472
+ $m = Mage::getModel('mgconnector/webtracking');
473
+ $m->setRemarketyPublicId($storeId, $response['storePublicId']);
474
+ }
475
+
476
+ $connection->commit();
477
+ } catch(Mage_Core_Exception $e) {
478
+ $connection->rollback();
479
+ throw new Mage_Core_Exception($e->getMessage());
480
+ }
481
+
482
+ return $this;
483
+ }
484
+
485
+ /**
486
+ * Return core_config_data entries for stores where extension is installed
487
+ *
488
+ * @return object
489
+ */
490
+ public function getConfiguredStores()
491
+ {
492
+ $collection = Mage::getModel('core/config_data')->getCollection();
493
+ $collection
494
+ ->getSelect()
495
+ ->where('scope = ?', self::STORE_SCOPE)
496
+ ->where('path = ?', self::XPATH_INSTALLED);
497
+
498
+ return $collection;
499
+ }
500
+
501
+ public static function isMultipleStores()
502
+ {
503
+ return 'true' === 'true';
504
+ }
505
+ }
app/code/community/Remarkety/Mgconnector/Model/Observer.php CHANGED
@@ -735,7 +735,7 @@ class Remarkety_Mgconnector_Model_Observer
735
  'main_table.rule_id = catalogrule_product.rule_id',
736
  array('product_id')
737
  )
738
- ->group(['main_table.rule_id', 'catalogrule_product.product_id']);
739
 
740
  if(is_null($ruleId)){
741
  $collection->getSelect()
735
  'main_table.rule_id = catalogrule_product.rule_id',
736
  array('product_id')
737
  )
738
+ ->group(array('main_table.rule_id', 'catalogrule_product.product_id'));
739
 
740
  if(is_null($ruleId)){
741
  $collection->getSelect()
app/code/community/Remarkety/Mgconnector/Model/Queue.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
-
3
- /**
4
- * Queue model
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Model_Queue extends Mage_Core_Model_Abstract
11
- {
12
- protected function _construct()
13
- {
14
- $this->_init('mgconnector/queue');
15
- }
16
- }
1
+ <?php
2
+
3
+ /**
4
+ * Queue model
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Model_Queue extends Mage_Core_Model_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init('mgconnector/queue');
15
+ }
16
+ }
app/code/community/Remarkety/Mgconnector/Model/Recovery.php CHANGED
@@ -61,7 +61,8 @@ class Remarkety_Mgconnector_Model_Recovery
61
  * @param $id
62
  * @return string
63
  */
64
- public function encodeQuoteId($id){
 
65
  $sign = md5($id . '.' . $this->_apikey);
66
  return base64_encode($id . ':' . $sign);
67
  }
@@ -71,7 +72,8 @@ class Remarkety_Mgconnector_Model_Recovery
71
  * @param $hashed_id
72
  * @return bool|int
73
  */
74
- public function decodeQuoteId($hashed_id){
 
75
  $id = null;
76
  $parts = base64_decode($hashed_id);
77
  if(!empty($parts)){
@@ -87,6 +89,7 @@ class Remarkety_Mgconnector_Model_Recovery
87
  }
88
  }
89
  }
 
90
  return false;
91
  }
92
  }
61
  * @param $id
62
  * @return string
63
  */
64
+ public function encodeQuoteId($id)
65
+ {
66
  $sign = md5($id . '.' . $this->_apikey);
67
  return base64_encode($id . ':' . $sign);
68
  }
72
  * @param $hashed_id
73
  * @return bool|int
74
  */
75
+ public function decodeQuoteId($hashed_id)
76
+ {
77
  $id = null;
78
  $parts = base64_decode($hashed_id);
79
  if(!empty($parts)){
89
  }
90
  }
91
  }
92
+
93
  return false;
94
  }
95
  }
app/code/community/Remarkety/Mgconnector/Model/Request.php CHANGED
@@ -47,16 +47,19 @@ class Remarkety_Mgconnector_Model_Request
47
  return $arr;
48
  }
49
 
50
- public function getStoreID($magento_store_id){
 
51
  try {
52
  $store = Mage::getModel('core/store')->load($magento_store_id);
53
  $payload = $this->_getPayloadBase();
54
 
55
- $payload['selectedView'] = json_encode(array(
 
56
  'website_id' => $store->getWebsiteId(),
57
  'store_id' => $store->getGroupId(),
58
  'view_id' => $magento_store_id,
59
- ));
 
60
  $payload['key'] = Mage::getStoreConfig('remarkety/mgconnector/api_key');
61
 
62
  $client = new Zend_Http_Client(
@@ -78,9 +81,11 @@ class Remarkety_Mgconnector_Model_Request
78
  if(!empty($body['storePublicId'])){
79
  return $body['storePublicId'];
80
  }
 
81
  //if no store id
82
  throw new Exception('Response from Remarkety without storeId');
83
  }
 
84
  switch ($response->getStatus()) {
85
  case '200':
86
  return $body;
47
  return $arr;
48
  }
49
 
50
+ public function getStoreID($magento_store_id)
51
+ {
52
  try {
53
  $store = Mage::getModel('core/store')->load($magento_store_id);
54
  $payload = $this->_getPayloadBase();
55
 
56
+ $payload['selectedView'] = json_encode(
57
+ array(
58
  'website_id' => $store->getWebsiteId(),
59
  'store_id' => $store->getGroupId(),
60
  'view_id' => $magento_store_id,
61
+ )
62
+ );
63
  $payload['key'] = Mage::getStoreConfig('remarkety/mgconnector/api_key');
64
 
65
  $client = new Zend_Http_Client(
81
  if(!empty($body['storePublicId'])){
82
  return $body['storePublicId'];
83
  }
84
+
85
  //if no store id
86
  throw new Exception('Response from Remarkety without storeId');
87
  }
88
+
89
  switch ($response->getStatus()) {
90
  case '200':
91
  return $body;
app/code/community/Remarkety/Mgconnector/Model/Resource/Queue.php CHANGED
@@ -1,30 +1,18 @@
1
- <?php
2
-
3
- /**
4
- * Queue resource model
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- if (version_compare(Mage::getVersion(), '1.6', '>=')) {
11
-
12
- class Remarkety_Mgconnector_Model_Resource_Queue extends Mage_Core_Model_Resource_Db_Abstract
13
- {
14
- protected function _construct()
15
- {
16
- $this->_init('mgconnector/queue', 'queue_id');
17
- }
18
- }
19
-
20
- } else {
21
-
22
- class Remarkety_Mgconnector_Model_Resource_Queue extends Mage_Core_Model_Mysql4_Abstract
23
- {
24
- protected function _construct()
25
- {
26
- $this->_init('mgconnector/queue', 'queue_id');
27
- }
28
- }
29
-
30
- }
1
+ <?php
2
+
3
+ /**
4
+ * Queue resource model
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+
11
+ class Remarkety_Mgconnector_Model_Resource_Queue extends Mage_Core_Model_Resource_Db_Abstract
12
+ {
13
+ protected function _construct()
14
+ {
15
+ $this->_init('mgconnector/queue', 'queue_id');
16
+ }
17
+ }
18
+
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Remarkety/Mgconnector/Model/Resource/Queue/Collection.php CHANGED
@@ -1,30 +1,18 @@
1
- <?php
2
-
3
- /**
4
- * Mgconnector collection resource model
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- if (version_compare(Mage::getVersion(), '1.6', '>=')) {
11
-
12
- class Remarkety_Mgconnector_Model_Resource_Queue_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
13
- {
14
- protected function _construct()
15
- {
16
- $this->_init('mgconnector/queue');
17
- }
18
- }
19
-
20
- } else {
21
-
22
- class Remarkety_Mgconnector_Model_Resource_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
23
- {
24
- protected function _construct()
25
- {
26
- $this->_init('mgconnector/queue');
27
- }
28
- }
29
-
30
- }
1
+ <?php
2
+
3
+ /**
4
+ * Mgconnector collection resource model
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+
11
+ class Remarkety_Mgconnector_Model_Resource_Queue_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
12
+ {
13
+ protected function _construct()
14
+ {
15
+ $this->_init('mgconnector/queue');
16
+ }
17
+ }
18
+
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Remarkety/Mgconnector/Model/Resource/Rule/Collection.php CHANGED
@@ -26,7 +26,6 @@ class Remarkety_Mgconnector_Model_Resource_Rule_Collection extends Mage_SalesRu
26
  public function setValidationFilter($websiteId, $customerGroupId, $couponCode = '', $now = null)
27
  {
28
  if (!$this->getFlag('validation_filter')) {
29
-
30
  if (is_null($now)) {
31
  $now = Mage::getModel('core/date')->date('Y-m-d');
32
  }
@@ -74,19 +73,23 @@ class Remarkety_Mgconnector_Model_Resource_Rule_Collection extends Mage_SalesRu
74
  $noCouponCondition . ' OR ((' . $orWhereCondition . ') AND rule_coupons.code = ?)', $couponCode
75
  );
76
 
77
- $select->where('(rule_coupons.expiration_date IS NULL) AND
 
78
  (to_date is null or to_date >= ?)
79
  OR
80
  (rule_coupons.expiration_date IS NOT NULL) AND
81
- (rule_coupons.expiration_date >= ?) ', $now);
 
82
  } else {
83
  $this->addFieldToFilter('main_table.coupon_type', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON);
84
  }
85
 
86
- $select->where('
 
87
  (main_table.to_date IS NULL) OR
88
  (main_table.to_date >= ?)
89
- ', $now);
 
90
 
91
  $this->setOrder('sort_order', self::SORT_ORDER_ASC);
92
  $this->setFlag('validation_filter', true);
26
  public function setValidationFilter($websiteId, $customerGroupId, $couponCode = '', $now = null)
27
  {
28
  if (!$this->getFlag('validation_filter')) {
 
29
  if (is_null($now)) {
30
  $now = Mage::getModel('core/date')->date('Y-m-d');
31
  }
73
  $noCouponCondition . ' OR ((' . $orWhereCondition . ') AND rule_coupons.code = ?)', $couponCode
74
  );
75
 
76
+ $select->where(
77
+ '(rule_coupons.expiration_date IS NULL) AND
78
  (to_date is null or to_date >= ?)
79
  OR
80
  (rule_coupons.expiration_date IS NOT NULL) AND
81
+ (rule_coupons.expiration_date >= ?) ', $now
82
+ );
83
  } else {
84
  $this->addFieldToFilter('main_table.coupon_type', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON);
85
  }
86
 
87
+ $select->where(
88
+ '
89
  (main_table.to_date IS NULL) OR
90
  (main_table.to_date >= ?)
91
+ ', $now
92
+ );
93
 
94
  $this->setOrder('sort_order', self::SORT_ORDER_ASC);
95
  $this->setFlag('validation_filter', true);
app/code/community/Remarkety/Mgconnector/Model/Resource/Setup.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Mgconnector resource setup model
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
11
- {
12
-
13
- }
1
+ <?php
2
+
3
+ /**
4
+ * Mgconnector resource setup model
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
11
+ {
12
+
13
+ }
app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/ConfigureController.php CHANGED
@@ -1,55 +1,67 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml Configure controller
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Adminhtml_ConfigureController extends Mage_Adminhtml_Controller_Action
11
- {
12
- /**
13
- * Init action
14
- *
15
- * @return Remarkety_Mgconnector_Adminhtml_ConfigureController
16
- */
17
- protected function _initAction()
18
- {
19
- $this
20
- ->loadLayout()
21
- ->_title($this->__('Remarkety'))
22
- ->_setActiveMenu('mgconnector');
23
-
24
- return $this;
25
- }
26
-
27
- /**
28
- * Configuration action
29
- */
30
- public function indexAction()
31
- {
32
- $mode = Mage::helper('mgconnector')->getMode();
33
- if($mode === Remarkety_Mgconnector_Model_Install::MODE_WELCOME) {
34
- $this
35
- ->_initAction()
36
- ->_title($this->__('Configuration'))
37
- ->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_configure'))
38
- ->renderLayout();
39
- } else {
40
- $this->_redirect('*/install/install');
41
- }
42
- }
43
-
44
- public function saveAction()
45
- {
46
- if($this->getRequest()->isPost()) {
47
- $params = $this->getRequest()->getParams();
48
-
49
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', $params['data']['intervals']);
50
- $this->_getSession()->addSuccess($this->__('Configuration has been saved.'));
51
- }
52
-
53
- $this->_redirect('*/queue/index');
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml Configure controller
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Adminhtml_ConfigureController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ /**
14
+ * Is allowed action
15
+ *
16
+ * @return bool
17
+ */
18
+
19
+ protected function _isAllowed()
20
+ {
21
+ return true;
22
+ }
23
+
24
+ /**
25
+ * Init action
26
+ *
27
+ * @return Remarkety_Mgconnector_Adminhtml_ConfigureController
28
+ */
29
+ protected function _initAction()
30
+ {
31
+ $this
32
+ ->loadLayout()
33
+ ->_title($this->__('Remarkety'))
34
+ ->_setActiveMenu('mgconnector');
35
+
36
+ return $this;
37
+ }
38
+
39
+ /**
40
+ * Configuration action
41
+ */
42
+ public function indexAction()
43
+ {
44
+ $mode = Mage::helper('mgconnector')->getMode();
45
+ if($mode === Remarkety_Mgconnector_Model_Install::MODE_WELCOME) {
46
+ $this
47
+ ->_initAction()
48
+ ->_title($this->__('Configuration'))
49
+ ->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_configure'))
50
+ ->renderLayout();
51
+ } else {
52
+ $this->_redirect('*/install/install');
53
+ }
54
+ }
55
+
56
+ public function saveAction()
57
+ {
58
+ if($this->getRequest()->isPost()) {
59
+ $params = $this->getRequest()->getParams();
60
+
61
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', $params['data']['intervals']);
62
+ $this->_getSession()->addSuccess($this->__('Configuration has been saved.'));
63
+ }
64
+
65
+ $this->_redirect('*/queue/index');
66
+ }
67
+ }
app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/Extension/AbstractController.php CHANGED
@@ -10,6 +10,18 @@
10
  abstract class Remarkety_Mgconnector_Adminhtml_Extension_AbstractController
11
  extends Mage_Adminhtml_Controller_Action
12
  {
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Init action.
15
  *
10
  abstract class Remarkety_Mgconnector_Adminhtml_Extension_AbstractController
11
  extends Mage_Adminhtml_Controller_Action
12
  {
13
+
14
+ /**
15
+ * Is allowed action
16
+ *
17
+ * @return bool
18
+ */
19
+
20
+ protected function _isAllowed()
21
+ {
22
+ return true;
23
+ }
24
+
25
  /**
26
  * Init action.
27
  *
app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/InstallController.php CHANGED
@@ -1,189 +1,205 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml Install controller
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Adminhtml_InstallController extends Mage_Adminhtml_Controller_Action
11
- {
12
- /**
13
- * Init action
14
- *
15
- * @return Remarkety_Mgconnector_Adminhtml_InstallController
16
- */
17
- protected function _initAction()
18
- {
19
- $this
20
- ->loadLayout()
21
- ->_title($this->__('Remarkety'))
22
- ->_setActiveMenu('mgconnector');
23
-
24
- return $this;
25
- }
26
-
27
- /**
28
- * Reinstall action
29
- */
30
- public function reinstallAction()
31
- {
32
- $config = Mage::getModel('core/config');
33
- $config
34
- ->deleteConfig(Remarkety_Mgconnector_Model_Install::XPATH_INSTALLED)
35
- ->deleteConfig('remarkety/mgconnector/api_key')
36
- ->deleteConfig('remarkety/mgconnector/public_storeId')
37
- ->deleteConfig('remarkety/mgconnector/intervals')
38
- ->deleteConfig('remarkety/mgconnector/last_response_status')
39
- ->deleteConfig('remarkety/mgconnector/last_response_message');
40
-
41
- foreach (Mage::app()->getWebsites() as $_website) {
42
- foreach ($_website->getGroups() as $_group) {
43
- foreach ($_group->getStores() as $_store) {
44
- $scope = $_store->getStoreId();
45
- $config->deleteConfig(Remarkety_Mgconnector_Model_Install::XPATH_INSTALLED, 'stores', $scope);
46
- $config->deleteConfig('remarkety/mgconnector/public_storeId', 'stores', $scope);
47
- }
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
-
51
- Mage::app()->getCacheInstance()->cleanType('config');
52
- Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
53
-
54
- Mage::getSingleton('core/session')->unsRemarketyLastResponseMessage();
55
- Mage::getSingleton('core/session')->unsRemarketyLastResponseStatus();
56
-
57
- $this->_redirect('*/*/install');
58
- }
59
-
60
- /**
61
- * Installation action
62
- */
63
- public function installAction()
64
- {
65
- $mode = Mage::helper('mgconnector')->getMode();
66
- $this
67
- ->_initAction()
68
- ->_title($this->__($this->_getTitle($mode)));
69
-
70
- $this
71
- ->_addContent($this->getLayout()->createBlock(sprintf('mgconnector/adminhtml_install_%s', $mode)))
72
- ->_addAdditionalContent()
73
- ->renderLayout();
74
- }
75
-
76
- /**
77
- * Enable webtracking action
78
- */
79
- public function installWebtrackingAction()
80
- {
81
- $store_id = $this->getRequest()->getParam('store');
82
- if(!is_numeric($store_id) || is_null($store_id)){
83
- throw new Exception("Missing store id");
84
  }
85
- /**
86
- * @var $m Remarkety_Mgconnector_Model_Webtracking
87
- */
88
- $m = Mage::getModel('mgconnector/webtracking');
89
-
90
- /**
91
- * @var $req Remarkety_Mgconnector_Model_Request
92
- */
93
- $req = Mage::getModel('mgconnector/request');
94
- $rmStoreId = $req->getStoreID($store_id);
95
- if($rmStoreId){
96
- $m->setRemarketyPublicId($store_id, $rmStoreId);
97
- Mage::app()->getCacheInstance()->cleanType('config');
98
- Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
99
  }
100
- $this->_redirect('*/install/install', array('mode' => 'welcome'));
101
- }
102
-
103
- /**
104
- * Disable webtracking action
105
- */
106
- public function disableWebtrackingAction()
107
- {
108
- $store_id = $this->getRequest()->getParam('store');
109
- if(!is_numeric($store_id) || is_null($store_id)){
110
- throw new Exception("Missing store id");
111
- }
112
- /**
113
- * @var $m Remarkety_Mgconnector_Model_Webtracking
114
- */
115
- $m = Mage::getModel('mgconnector/webtracking');
116
- $m->setRemarketyPublicId($store_id, null);
117
- Mage::app()->getCacheInstance()->cleanType('config');
118
- Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
119
- $this->_redirect('*/install/install', array('mode' => 'welcome'));
120
- }
121
-
122
- protected function _addAdditionalContent()
123
- {
124
- $mode = Mage::helper('mgconnector')->getMode();
125
-
126
- switch($mode) {
127
- case Remarkety_Mgconnector_Model_Install::MODE_WELCOME:
128
- $this->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_install_welcome_store'));
129
- break;
130
- }
131
-
132
- return $this;
133
- }
134
-
135
- /**
136
- * Return title
137
- *
138
- * @param string $mode
139
- * @return string
140
- */
141
- protected function _getTitle($mode) {
142
- return ucwords(str_replace('_', ' - ', $mode));
143
- }
144
-
145
- /**
146
- * Complete action
147
- */
148
- public function completeAction()
149
- {
150
- $redirectBack = true;
151
-
152
- if($this->getRequest()->isPost()) {
153
- $params = $this->getRequest()->getParams();
154
-
155
- try {
156
- $install = Mage::getModel('mgconnector/install')
157
- ->setData($params['data']);
158
-
159
- switch($params['data']['mode']) {
160
- case Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE:
161
- $install->installByCreateExtension();
162
- break;
163
- case Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN:
164
- $install->installByLoginExtension();
165
- break;
166
- case Remarkety_Mgconnector_Model_Install::MODE_UPGRADE:
167
- $install->upgradeExtension();
168
- break;
169
- case Remarkety_Mgconnector_Model_Install::MODE_COMPLETE:
170
- $install->completeExtensionInstallation();
171
- break;
172
- default:
173
- throw new Mage_Core_Exception('Selected mode can not be handled.');
174
- }
175
-
176
- $redirectBack = false;
177
- } catch(Mage_Core_Exception $e) {
178
- $this->_getSession()->addError($e->getMessage());
179
- }
180
- }
181
-
182
- if($redirectBack) {
183
- $mode = isset($params['data']['mode']) ? $params['data']['mode'] : null;
184
- $this->_redirect('*/install/install', array('mode' => $mode));
185
- } else {
186
- $this->_redirect('*/install/install', array('mode' => 'welcome'));
187
- }
188
- }
189
- }
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml Install controller
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Adminhtml_InstallController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ /**
14
+ * Is allowed action
15
+ *
16
+ * @return bool
17
+ */
18
+
19
+ protected function _isAllowed()
20
+ {
21
+ return true;
22
+ }
23
+
24
+ /**
25
+ * Init action
26
+ *
27
+ * @return Remarkety_Mgconnector_Adminhtml_InstallController
28
+ */
29
+ protected function _initAction()
30
+ {
31
+ $this
32
+ ->loadLayout()
33
+ ->_title($this->__('Remarkety'))
34
+ ->_setActiveMenu('mgconnector');
35
+
36
+ return $this;
37
+ }
38
+
39
+ /**
40
+ * Reinstall action
41
+ */
42
+ public function reinstallAction()
43
+ {
44
+ $config = Mage::getModel('core/config');
45
+ $config
46
+ ->deleteConfig(Remarkety_Mgconnector_Model_Install::XPATH_INSTALLED)
47
+ ->deleteConfig('remarkety/mgconnector/api_key')
48
+ ->deleteConfig('remarkety/mgconnector/public_storeId')
49
+ ->deleteConfig('remarkety/mgconnector/intervals')
50
+ ->deleteConfig('remarkety/mgconnector/last_response_status')
51
+ ->deleteConfig('remarkety/mgconnector/last_response_message');
52
+
53
+ foreach (Mage::app()->getWebsites() as $_website) {
54
+ foreach ($_website->getGroups() as $_group) {
55
+ foreach ($_group->getStores() as $_store) {
56
+ $scope = $_store->getStoreId();
57
+ $config->deleteConfig(Remarkety_Mgconnector_Model_Install::XPATH_INSTALLED, 'stores', $scope);
58
+ $config->deleteConfig('remarkety/mgconnector/public_storeId', 'stores', $scope);
59
+ }
60
+ }
61
+ }
62
+
63
+ Mage::app()->getCacheInstance()->cleanType('config');
64
+ Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
65
+
66
+ Mage::getSingleton('core/session')->unsRemarketyLastResponseMessage();
67
+ Mage::getSingleton('core/session')->unsRemarketyLastResponseStatus();
68
+
69
+ $this->_redirect('*/*/install');
70
+ }
71
+
72
+ /**
73
+ * Installation action
74
+ */
75
+ public function installAction()
76
+ {
77
+ $mode = Mage::helper('mgconnector')->getMode();
78
+ $this
79
+ ->_initAction()
80
+ ->_title($this->__($this->_getTitle($mode)));
81
+
82
+ $this
83
+ ->_addContent($this->getLayout()->createBlock(sprintf('mgconnector/adminhtml_install_%s', $mode)))
84
+ ->_addAdditionalContent()
85
+ ->renderLayout();
86
+ }
87
+
88
+ /**
89
+ * Enable webtracking action
90
+ */
91
+ public function installWebtrackingAction()
92
+ {
93
+ $store_id = $this->getRequest()->getParam('store');
94
+ if(!is_numeric($store_id) || is_null($store_id)){
95
+ throw new Exception("Missing store id");
96
  }
97
+
98
+ /**
99
+ * @var $m Remarkety_Mgconnector_Model_Webtracking
100
+ */
101
+ $m = Mage::getModel('mgconnector/webtracking');
102
+
103
+ /**
104
+ * @var $req Remarkety_Mgconnector_Model_Request
105
+ */
106
+ $req = Mage::getModel('mgconnector/request');
107
+ $rmStoreId = $req->getStoreID($store_id);
108
+ if($rmStoreId){
109
+ $m->setRemarketyPublicId($store_id, $rmStoreId);
110
+ Mage::app()->getCacheInstance()->cleanType('config');
111
+ Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
+
114
+ $this->_redirect('*/install/install', array('mode' => 'welcome'));
115
+ }
116
+
117
+ /**
118
+ * Disable webtracking action
119
+ */
120
+ public function disableWebtrackingAction()
121
+ {
122
+ $store_id = $this->getRequest()->getParam('store');
123
+ if(!is_numeric($store_id) || is_null($store_id)){
124
+ throw new Exception("Missing store id");
 
 
125
  }
126
+
127
+ /**
128
+ * @var $m Remarkety_Mgconnector_Model_Webtracking
129
+ */
130
+ $m = Mage::getModel('mgconnector/webtracking');
131
+ $m->setRemarketyPublicId($store_id, null);
132
+ Mage::app()->getCacheInstance()->cleanType('config');
133
+ Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
134
+ $this->_redirect('*/install/install', array('mode' => 'welcome'));
135
+ }
136
+
137
+ protected function _addAdditionalContent()
138
+ {
139
+ $mode = Mage::helper('mgconnector')->getMode();
140
+
141
+ switch($mode) {
142
+ case Remarkety_Mgconnector_Model_Install::MODE_WELCOME:
143
+ $this->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_install_welcome_store'));
144
+ break;
145
+ }
146
+
147
+ return $this;
148
+ }
149
+
150
+ /**
151
+ * Return title
152
+ *
153
+ * @param string $mode
154
+ * @return string
155
+ */
156
+ protected function _getTitle($mode)
157
+ {
158
+ return ucwords(str_replace('_', ' - ', $mode));
159
+ }
160
+
161
+ /**
162
+ * Complete action
163
+ */
164
+ public function completeAction()
165
+ {
166
+ $redirectBack = true;
167
+
168
+ if($this->getRequest()->isPost()) {
169
+ $params = $this->getRequest()->getParams();
170
+
171
+ try {
172
+ $install = Mage::getModel('mgconnector/install')
173
+ ->setData($params['data']);
174
+
175
+ switch($params['data']['mode']) {
176
+ case Remarkety_Mgconnector_Model_Install::MODE_INSTALL_CREATE:
177
+ $install->installByCreateExtension();
178
+ break;
179
+ case Remarkety_Mgconnector_Model_Install::MODE_INSTALL_LOGIN:
180
+ $install->installByLoginExtension();
181
+ break;
182
+ case Remarkety_Mgconnector_Model_Install::MODE_UPGRADE:
183
+ $install->upgradeExtension();
184
+ break;
185
+ case Remarkety_Mgconnector_Model_Install::MODE_COMPLETE:
186
+ $install->completeExtensionInstallation();
187
+ break;
188
+ default:
189
+ throw new Mage_Core_Exception('Selected mode can not be handled.');
190
+ }
191
+
192
+ $redirectBack = false;
193
+ } catch(Mage_Core_Exception $e) {
194
+ $this->_getSession()->addError($e->getMessage());
195
+ }
196
+ }
197
+
198
+ if($redirectBack) {
199
+ $mode = isset($params['data']['mode']) ? $params['data']['mode'] : null;
200
+ $this->_redirect('*/install/install', array('mode' => $mode));
201
+ } else {
202
+ $this->_redirect('*/install/install', array('mode' => 'welcome'));
203
+ }
204
+ }
205
+ }
 
 
 
 
 
 
 
 
 
 
app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/MgconnectorController.php CHANGED
@@ -9,6 +9,18 @@
9
  */
10
  class Remarkety_Mgconnector_Adminhtml_MgconnectorController extends Mage_Adminhtml_Controller_Action
11
  {
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Init action
14
  *
@@ -178,15 +190,17 @@ class Remarkety_Mgconnector_Adminhtml_MgconnectorController extends Mage_Adminht
178
  $mode = $forceMode;
179
  }
180
 
181
- if(!in_array($mode, array(
 
182
  Remarkety_Mgconnector_Model_Install::MODE_INSTALL,
183
  Remarkety_Mgconnector_Model_Install::MODE_UPGRADE,
184
  Remarkety_Mgconnector_Model_Install::MODE_COMPLETE,
185
  Remarkety_Mgconnector_Model_Install::MODE_CONFIGURATION
186
- ))) {
 
187
  throw new Mage_Core_Exception('Installation mode can not be handled.');
188
  }
189
 
190
  return $mode;
191
  }
192
- }
9
  */
10
  class Remarkety_Mgconnector_Adminhtml_MgconnectorController extends Mage_Adminhtml_Controller_Action
11
  {
12
+
13
+ /**
14
+ * Is allowed action
15
+ *
16
+ * @return bool
17
+ */
18
+
19
+ protected function _isAllowed()
20
+ {
21
+ return true;
22
+ }
23
+
24
  /**
25
  * Init action
26
  *
190
  $mode = $forceMode;
191
  }
192
 
193
+ if(!in_array(
194
+ $mode, array(
195
  Remarkety_Mgconnector_Model_Install::MODE_INSTALL,
196
  Remarkety_Mgconnector_Model_Install::MODE_UPGRADE,
197
  Remarkety_Mgconnector_Model_Install::MODE_COMPLETE,
198
  Remarkety_Mgconnector_Model_Install::MODE_CONFIGURATION
199
+ )
200
+ )) {
201
  throw new Mage_Core_Exception('Installation mode can not be handled.');
202
  }
203
 
204
  return $mode;
205
  }
206
+ }
app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/QueueController.php CHANGED
@@ -1,143 +1,159 @@
1
- <?php
2
-
3
- /**
4
- * Adminhtml Queue controller
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- class Remarkety_Mgconnector_Adminhtml_QueueController extends Mage_Adminhtml_Controller_Action
11
- {
12
- /**
13
- * Init action
14
- *
15
- * @return Remarkety_Mgconnector_Adminhtml_QueueController
16
- */
17
- protected function _initAction()
18
- {
19
- $this
20
- ->loadLayout()
21
- ->_title($this->__('Remarkety'))
22
- ->_setActiveMenu('mgconnector');
23
-
24
- return $this;
25
- }
26
-
27
- /**
28
- * Index action
29
- */
30
- public function indexAction()
31
- {
32
- $this
33
- ->_initAction()
34
- ->_title($this->__('Queue'))
35
- ->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_queue_configure'))
36
- ->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_queue'))
37
- ->renderLayout();
38
- }
39
-
40
- public function saveAction()
41
- {
42
- if($this->getRequest()->isPost()) {
43
- $params = $this->getRequest()->getParams();
44
-
45
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', $params['data']['intervals']);
46
-
47
- if(isset($params['data']['api_key'])){
48
- $key = $params['data']['api_key'];
49
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/api_key', $key);
50
- $apiUser = Mage::getModel('api/user')->loadByUsername(\Remarkety_Mgconnector_Model_Install::WEB_SERVICE_USERNAME);
51
- $apiUser
52
- ->setNewApiKey($key)
53
- ->save();
54
- }
55
- if(isset($params['data']['bypasscache'])){
56
- Mage::getModel('core/config')->saveConfig(\Remarkety_Mgconnector_Model_Webtracking::RM_BYPASS_CACHE, true);
57
- } else {
58
- Mage::getModel('core/config')->saveConfig(\Remarkety_Mgconnector_Model_Webtracking::RM_BYPASS_CACHE, false);
59
- }
60
-
61
- if(isset($params['data']['markgroupparent'])){
62
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/mark_group_parent', true);
63
- } else {
64
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/mark_group_parent', false);
65
- }
66
-
67
- if(isset($params['data']['simpleproductstandalone'])){
68
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/configurable_standalone', true);
69
- } else {
70
- Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/configurable_standalone', false);
71
- }
72
-
73
- Mage::app()->getCacheInstance()->cleanType('config');
74
- Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
75
-
76
- $this->_getSession()->addSuccess($this->__('Configuration has been saved.'));
77
- }
78
-
79
- $this->_redirect('*/queue/index');
80
- }
81
-
82
- /**
83
- * Grid action
84
- */
85
- public function gridAction()
86
- {
87
- $this->loadLayout();
88
- $this->getResponse()->setBody(
89
- $this->getLayout()->createBlock('mgconnector/adminhtml_queue_grid')->toHtml()
90
- );
91
- }
92
-
93
- public function massResendAction() {
94
-
95
- $queueIds = $this->getRequest()->getParam('queue');
96
- if (!is_array($queueIds)) {
97
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select queue item(s)'));
98
- }
99
- else {
100
- try {
101
- $collection = Mage::getModel('mgconnector/queue')->getCollection();
102
- $collection
103
- ->addFieldToFilter('queue_id',$queueIds)
104
- ->getSelect();
105
- $observer = Mage::getModel('mgconnector/observer');
106
- $itemsSent = $observer->resend($collection);
107
- Mage::getSingleton('adminhtml/session')->addSuccess(
108
- Mage::helper('adminhtml')->__('Total of %d events(s) were resent', $itemsSent)
109
- );
110
- } catch (Exception $e) {
111
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
112
- }
113
- }
114
-
115
- $this->_redirect('*/queue/index');
116
- }
117
-
118
- public function massDeleteAction() {
119
-
120
- $queueIds = $this->getRequest()->getParam('queue');
121
- if (!is_array($queueIds)) {
122
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select queue item(s)'));
123
- }
124
- else {
125
- try {
126
- $collection = Mage::getModel('mgconnector/queue')->getCollection();
127
- $collection
128
- ->addFieldToFilter('queue_id',$queueIds)
129
- ->getSelect();
130
- foreach ($collection as $item) {
131
- $item->delete();
132
- }
133
- Mage::getSingleton('adminhtml/session')->addSuccess(
134
- Mage::helper('adminhtml')->__('Total of %d events(s) were deleted', count($queueIds))
135
- );
136
- } catch (Exception $e) {
137
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
138
- }
139
- }
140
-
141
- $this->_redirect('*/queue/index');
142
- }
143
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml Queue controller
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ class Remarkety_Mgconnector_Adminhtml_QueueController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ /**
14
+ * Is allowed action
15
+ *
16
+ * @return bool
17
+ */
18
+
19
+ protected function _isAllowed()
20
+ {
21
+ return true;
22
+ }
23
+
24
+ /**
25
+ * Init action
26
+ *
27
+ * @return Remarkety_Mgconnector_Adminhtml_QueueController
28
+ */
29
+ protected function _initAction()
30
+ {
31
+ $this
32
+ ->loadLayout()
33
+ ->_title($this->__('Remarkety'))
34
+ ->_setActiveMenu('mgconnector');
35
+
36
+ return $this;
37
+ }
38
+
39
+ /**
40
+ * Index action
41
+ */
42
+ public function indexAction()
43
+ {
44
+ $this
45
+ ->_initAction()
46
+ ->_title($this->__('Queue'))
47
+ ->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_queue_configure'))
48
+ ->_addContent($this->getLayout()->createBlock('mgconnector/adminhtml_queue'))
49
+ ->renderLayout();
50
+ }
51
+
52
+ public function saveAction()
53
+ {
54
+ if($this->getRequest()->isPost()) {
55
+ $params = $this->getRequest()->getParams();
56
+
57
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/intervals', $params['data']['intervals']);
58
+
59
+ if(isset($params['data']['api_key'])){
60
+ $key = $params['data']['api_key'];
61
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/api_key', $key);
62
+ $apiUser = Mage::getModel('api/user')->loadByUsername(\Remarkety_Mgconnector_Model_Install::WEB_SERVICE_USERNAME);
63
+ $apiUser
64
+ ->setNewApiKey($key)
65
+ ->save();
66
+ }
67
+
68
+ if(isset($params['data']['bypasscache'])){
69
+ Mage::getModel('core/config')->saveConfig(\Remarkety_Mgconnector_Model_Webtracking::RM_BYPASS_CACHE, true);
70
+ } else {
71
+ Mage::getModel('core/config')->saveConfig(\Remarkety_Mgconnector_Model_Webtracking::RM_BYPASS_CACHE, false);
72
+ }
73
+
74
+ if(isset($params['data']['markgroupparent'])){
75
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/mark_group_parent', true);
76
+ } else {
77
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/mark_group_parent', false);
78
+ }
79
+
80
+ if(isset($params['data']['simpleproductstandalone'])){
81
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/configurable_standalone', true);
82
+ } else {
83
+ Mage::getModel('core/config')->saveConfig('remarkety/mgconnector/configurable_standalone', false);
84
+ }
85
+
86
+ Mage::app()->getCacheInstance()->cleanType('config');
87
+ Mage::dispatchEvent('adminhtml_cache_refresh_type', array('type' => 'config'));
88
+
89
+ $this->_getSession()->addSuccess($this->__('Configuration has been saved.'));
90
+ }
91
+
92
+ $this->_redirect('*/queue/index');
93
+ }
94
+
95
+ /**
96
+ * Grid action
97
+ */
98
+ public function gridAction()
99
+ {
100
+ $this->loadLayout();
101
+ $this->getResponse()->setBody(
102
+ $this->getLayout()->createBlock('mgconnector/adminhtml_queue_grid')->toHtml()
103
+ );
104
+ }
105
+
106
+ public function massResendAction()
107
+ {
108
+
109
+ $queueIds = $this->getRequest()->getParam('queue');
110
+ if (!is_array($queueIds)) {
111
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select queue item(s)'));
112
+ }
113
+ else {
114
+ try {
115
+ $collection = Mage::getModel('mgconnector/queue')->getCollection();
116
+ $collection
117
+ ->addFieldToFilter('queue_id', $queueIds)
118
+ ->getSelect();
119
+ $observer = Mage::getModel('mgconnector/observer');
120
+ $itemsSent = $observer->resend($collection);
121
+ Mage::getSingleton('adminhtml/session')->addSuccess(
122
+ Mage::helper('adminhtml')->__('Total of %d events(s) were resent', $itemsSent)
123
+ );
124
+ } catch (Exception $e) {
125
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
126
+ }
127
+ }
128
+
129
+ $this->_redirect('*/queue/index');
130
+ }
131
+
132
+ public function massDeleteAction()
133
+ {
134
+
135
+ $queueIds = $this->getRequest()->getParam('queue');
136
+ if (!is_array($queueIds)) {
137
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select queue item(s)'));
138
+ }
139
+ else {
140
+ try {
141
+ $collection = Mage::getModel('mgconnector/queue')->getCollection();
142
+ $collection
143
+ ->addFieldToFilter('queue_id', $queueIds)
144
+ ->getSelect();
145
+ foreach ($collection as $item) {
146
+ $item->delete();
147
+ }
148
+
149
+ Mage::getSingleton('adminhtml/session')->addSuccess(
150
+ Mage::helper('adminhtml')->__('Total of %d events(s) were deleted', count($queueIds))
151
+ );
152
+ } catch (Exception $e) {
153
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
154
+ }
155
+ }
156
+
157
+ $this->_redirect('*/queue/index');
158
+ }
159
+ }
app/code/community/Remarkety/Mgconnector/controllers/RecoveryController.php CHANGED
@@ -42,7 +42,6 @@ class Remarkety_Mgconnector_RecoveryController extends Mage_Core_Controller_Fron
42
  }
43
 
44
  try {
45
-
46
  $recovery->quoteRestore($quoteId);
47
  } catch (Mage_Core_Exception $e) {
48
  Mage::throwException(self::MESSAGE_ERROR_DURING_PROCESSING);
42
  }
43
 
44
  try {
 
45
  $recovery->quoteRestore($quoteId);
46
  } catch (Mage_Core_Exception $e) {
47
  Mage::throwException(self::MESSAGE_ERROR_DURING_PROCESSING);
app/code/community/Remarkety/Mgconnector/controllers/WebtrackingController.php CHANGED
@@ -11,7 +11,7 @@ class Remarkety_Mgconnector_WebtrackingController extends Mage_Core_Controller_F
11
  {
12
  public function identifyAction()
13
  {
14
- $this->getResponse()->clearHeaders()->setHeader('Content-type','application/x-javascript',true);
15
  $email = $this->getEmail();
16
  if($email){
17
  $this->getResponse()->setBody('_rmData.push(["setCustomer", "'.$email.'"]);');
@@ -21,11 +21,13 @@ class Remarkety_Mgconnector_WebtrackingController extends Mage_Core_Controller_F
21
 
22
  }
23
 
24
- private function getEmail(){
 
25
  if(Mage::getSingleton('customer/session')->isLoggedIn()){
26
  $customer = Mage::getSingleton('customer/session')->getCustomer();
27
  return $customer->getEmail();
28
  }
 
29
  $email = Mage::getSingleton('customer/session')->getSubscriberEmail();
30
  return empty($email) ? false : $email;
31
  }
11
  {
12
  public function identifyAction()
13
  {
14
+ $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/x-javascript', true);
15
  $email = $this->getEmail();
16
  if($email){
17
  $this->getResponse()->setBody('_rmData.push(["setCustomer", "'.$email.'"]);');
21
 
22
  }
23
 
24
+ private function getEmail()
25
+ {
26
  if(Mage::getSingleton('customer/session')->isLoggedIn()){
27
  $customer = Mage::getSingleton('customer/session')->getCustomer();
28
  return $customer->getEmail();
29
  }
30
+
31
  $email = Mage::getSingleton('customer/session')->getSubscriberEmail();
32
  return empty($email) ? false : $email;
33
  }
app/code/community/Remarkety/Mgconnector/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Remarkety_Mgconnector>
5
- <version>1.4.8.8</version>
6
  </Remarkety_Mgconnector>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Remarkety_Mgconnector>
5
+ <version>1.4.9.0</version>
6
  </Remarkety_Mgconnector>
7
  </modules>
8
  <global>
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-install-1.0.0.13.php CHANGED
@@ -1,26 +1,28 @@
1
- <?php
2
-
3
- /**
4
- * Install script to version 1.0.0.13
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- $installer = $this;
11
- $installer->startSetup();
12
-
13
- $installer->run("
14
- CREATE TABLE IF NOT EXISTS `{$installer->getTable('mgconnector/queue')}` (
15
- `queue_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Remarkety queue ID',
16
- `event_type` varchar(20) NOT NULL COMMENT 'Event_type',
17
- `payload` text NOT NULL COMMENT 'Payload',
18
- `attempts` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Attempts',
19
- `last_attempt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last_attempt',
20
- `next_attempt` timestamp NULL DEFAULT NULL COMMENT 'Next_attempt',
21
- `status` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Status',
22
- PRIMARY KEY (`queue_id`)
23
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Remarkety queue table';
24
- ");
25
-
26
- $installer->endSetup();
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Install script to version 1.0.0.13
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->run(
14
+ "
15
+ CREATE TABLE IF NOT EXISTS `{$installer->getTable('mgconnector/queue')}` (
16
+ `queue_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Remarkety queue ID',
17
+ `event_type` varchar(20) NOT NULL COMMENT 'Event_type',
18
+ `payload` text NOT NULL COMMENT 'Payload',
19
+ `attempts` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Attempts',
20
+ `last_attempt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last_attempt',
21
+ `next_attempt` timestamp NULL DEFAULT NULL COMMENT 'Next_attempt',
22
+ `status` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Status',
23
+ PRIMARY KEY (`queue_id`)
24
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Remarkety queue table';
25
+ "
26
+ );
27
+
28
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.13-1.0.0.14.php CHANGED
@@ -1,26 +1,28 @@
1
- <?php
2
-
3
- /**
4
- * Upgrade script from version 1.0.0.13 to 1.0.0.14
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- $installer = $this;
11
- $installer->startSetup();
12
-
13
- $installer->run("
14
- CREATE TABLE IF NOT EXISTS `{$installer->getTable('mgconnector/queue')}` (
15
- `queue_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Remarkety queue ID',
16
- `event_type` varchar(20) NOT NULL COMMENT 'Event_type',
17
- `payload` text NOT NULL COMMENT 'Payload',
18
- `attempts` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Attempts',
19
- `last_attempt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last_attempt',
20
- `next_attempt` timestamp NULL DEFAULT NULL COMMENT 'Next_attempt',
21
- `status` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Status',
22
- PRIMARY KEY (`queue_id`)
23
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Remarkety queue table';
24
- ");
25
-
26
- $installer->endSetup();
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Upgrade script from version 1.0.0.13 to 1.0.0.14
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->run(
14
+ "
15
+ CREATE TABLE IF NOT EXISTS `{$installer->getTable('mgconnector/queue')}` (
16
+ `queue_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Remarkety queue ID',
17
+ `event_type` varchar(20) NOT NULL COMMENT 'Event_type',
18
+ `payload` text NOT NULL COMMENT 'Payload',
19
+ `attempts` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Attempts',
20
+ `last_attempt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last_attempt',
21
+ `next_attempt` timestamp NULL DEFAULT NULL COMMENT 'Next_attempt',
22
+ `status` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Status',
23
+ PRIMARY KEY (`queue_id`)
24
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Remarkety queue table';
25
+ "
26
+ );
27
+
28
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.14-1.0.0.15.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Upgrade script from version 1.0.0.14 to 1.0.0.15
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- $installer = $this;
11
- $installer->startSetup();
12
-
13
- $installer->endSetup();
1
+ <?php
2
+
3
+ /**
4
+ * Upgrade script from version 1.0.0.14 to 1.0.0.15
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.14-1.1.0.0.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
-
3
- /**
4
- * Upgrade script from version 1.0.0.14 to 1.1.0.0
5
- *
6
- * @category Remarkety
7
- * @package Remarkety_Mgconnector
8
- * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
- */
10
- $installer = $this;
11
- $installer->startSetup();
12
-
13
- $installer->endSetup();
1
+ <?php
2
+
3
+ /**
4
+ * Upgrade script from version 1.0.0.14 to 1.1.0.0
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Piotr Pierzak <piotrek.pierzak@gmail.com>
9
+ */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.0.5-1.1.0.6.php CHANGED
@@ -12,4 +12,4 @@ $installer->startSetup();
12
 
13
  //@TODO remove installed entry for 0 scope with api key
14
 
15
- $installer->endSetup();
12
 
13
  //@TODO remove installed entry for 0 scope with api key
14
 
15
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.8-1.1.2.9.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Upgrade script from version 1.1.2.8 to 1.1.2.9
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Rafał Andryanczyk <rafal.andryanczyk@gmail.com>
9
+ */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->getConnection()
14
+ ->addColumn(
15
+ $installer->getTable('salesrule/coupon'), 'added_by_remarkety', array(
16
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
17
+ 'nullable' => true,
18
+ 'default' => null,
19
+ 'comment' => '1 = added by remarkety api',
20
+ )
21
+ );
22
+
23
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.8-1.3.0.0.php CHANGED
@@ -11,11 +11,13 @@ $installer = $this;
11
  $installer->startSetup();
12
 
13
  $installer->getConnection()
14
- ->addColumn($installer->getTable('salesrule/coupon'),'added_by_remarkety', array(
 
15
  'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
16
  'nullable' => true,
17
  'default' => null,
18
  'comment' => '1 = added by remarkety api',
19
- ));
 
20
 
21
- $installer->endSetup();
11
  $installer->startSetup();
12
 
13
  $installer->getConnection()
14
+ ->addColumn(
15
+ $installer->getTable('salesrule/coupon'), 'added_by_remarkety', array(
16
  'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
17
  'nullable' => true,
18
  'default' => null,
19
  'comment' => '1 = added by remarkety api',
20
+ )
21
+ );
22
 
23
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.9-1.1.3.0.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Upgrade script from version 1.1.2.9 to 1.1.3.0
5
+ *
6
+ * @category Remarkety
7
+ * @package Remarkety_Mgconnector
8
+ * @author Rafał Andryanczyk <rafal.andryanczyk@gmail.com>
9
+ */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->getConnection()
14
+ ->addColumn(
15
+ $installer->getTable('catalogrule'), 'updated_at', array(
16
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
17
+ 'default' => Varien_Db_Ddl_Table::TIMESTAMP_UPDATE,
18
+ 'comment' => 'update date',
19
+ )
20
+ );
21
+
22
+ $installer->endSetup();
app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.4.7.2-1.4.8.0.php CHANGED
@@ -12,11 +12,13 @@ $installer->startSetup();
12
 
13
 
14
  $installer->getConnection()
15
- ->addColumn($installer->getTable('catalogrule/rule'),'updated_at', array(
 
16
  'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
17
  'nullable' => true,
18
  'default' => null,
19
  'comment' => 'updated_at',
20
- ));
 
21
 
22
- $installer->endSetup();
12
 
13
 
14
  $installer->getConnection()
15
+ ->addColumn(
16
+ $installer->getTable('catalogrule/rule'), 'updated_at', array(
17
  'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
18
  'nullable' => true,
19
  'default' => null,
20
  'comment' => 'updated_at',
21
+ )
22
+ );
23
 
24
+ $installer->endSetup();
app/design/adminhtml/default/default/template/mgconnector/extension/rewardpoints.phtml CHANGED
@@ -50,4 +50,4 @@ $enabledExtensions = $extensionHelper->getEnabledRewardPointsExtensions();
50
  </a>
51
  </div>
52
  </div>
53
- </div>
50
  </a>
51
  </div>
52
  </div>
53
+ </div>
app/design/adminhtml/default/default/template/mgconnector/install/welcome/store.phtml CHANGED
@@ -63,8 +63,8 @@ if (!$apiValid || \Remarkety_Mgconnector_Model_Install::isMultipleStores()) {
63
  </tr>
64
  </tbody>
65
  </table>
66
- <?php endif; ?>
67
  </div>
68
  </div>
69
  </div>
70
- <?php } ?>
63
  </tr>
64
  </tbody>
65
  </table>
66
+ <?php endif; ?>
67
  </div>
68
  </div>
69
  </div>
70
+ <?php } ?>
app/design/frontend/base/default/template/mgconnector/tracking/general.phtml CHANGED
@@ -3,7 +3,8 @@
3
  var _rmData = _rmData || [];
4
  _rmData.push(['setStoreKey', '<?php echo $this->getRemarketyPublicId(); ?>']);
5
  <?php if(!$this->shouldBypassCache()): ?>
6
- <?php $_rmEmail = $this->getEmail(); if ($_rmEmail): ?>_rmData.push(["setCustomer", "<?php echo $_rmEmail; ?>"]);<?php endif; ?>
 
7
  <?php else: ?>
8
  (function(d, t) {
9
  var g = d.createElement(t),
@@ -20,4 +21,4 @@
20
  g.src = 'https://s3.amazonaws.com/downloads.remarkety.com/webtracking/remarkety.js';
21
  s.parentNode.insertBefore(g, s);
22
  }(document, 'script'));</script>
23
- <?php endif; ?>
3
  var _rmData = _rmData || [];
4
  _rmData.push(['setStoreKey', '<?php echo $this->getRemarketyPublicId(); ?>']);
5
  <?php if(!$this->shouldBypassCache()): ?>
6
+ <?php $_rmEmail = $this->getEmail(); if ($_rmEmail): ?>_rmData.push(["setCustomer", "<?php echo $_rmEmail; ?>"]);<?php
7
+ endif; ?>
8
  <?php else: ?>
9
  (function(d, t) {
10
  var g = d.createElement(t),
21
  g.src = 'https://s3.amazonaws.com/downloads.remarkety.com/webtracking/remarkety.js';
22
  s.parentNode.insertBefore(g, s);
23
  }(document, 'script'));</script>
24
+ <?php endif; ?>
app/design/frontend/base/default/template/mgconnector/tracking/product_view.phtml CHANGED
@@ -7,4 +7,4 @@
7
  productCategoriesIds: <?php echo json_encode($this->getCategoryIds()); ?>,
8
  }]);
9
  </script>
10
- <?php endif; ?>
7
  productCategoriesIds: <?php echo json_encode($this->getCategoryIds()); ?>,
8
  }]);
9
  </script>
10
+ <?php endif; ?>
app/etc/modules/Remarkety_Mgconnector.xml CHANGED
File without changes
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Remarkety_Mgconnector</name>
4
- <version>1.4.8.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl-3.0.html">GPL v3</license>
7
  <channel>community</channel>
@@ -9,15 +9,15 @@
9
  <summary>Remarkety Magento Connector</summary>
10
  <description>Remarkety Magento Connector</description>
11
  <notes>No comments</notes>
12
- <date>2016-11-01</date>
13
- <time>13-13-57</time>
14
  <contents>
15
  <target name="magecommunity">
16
- <dir name="Remarkety"><dir name="Mgconnector"><dir name="Block"><dir name="Adminhtml"><dir name="Configuration"><dir name="Complete"><file name="Form.php" hash="dc799532128513364fc3afd17eabb78b"/></dir><file name="Complete.php" hash="b9f7b4ecbd2be587c0efbd16523b167e"/><dir name="Configuration"><file name="Form.php" hash="ffe6b6ce5b2906c916694007ca5a1b28"/></dir><file name="Configuration.php" hash="67b3b564c2c3123301f5f97b2b258a7a"/><dir name="Install"><file name="Form.php" hash="59541fe2ad9a49b9fb56a41f00e6a591"/></dir><file name="Install.php" hash="f631fcdfd86d2bc416eb1ad4422fc20c"/><dir name="Upgrade"><file name="Form.php" hash="598f83eca99d0153537e22f9ee6b1934"/></dir><file name="Upgrade.php" hash="c672741b0407f108d2266dd939590846"/></dir><file name="Configuration.php" hash="bf0c9aabe92f669694e0699c009b2a9c"/><dir name="Extension"><file name="RewardPoints.php" hash="82e320930f59dfd45e5aa73005118833"/></dir><dir name="Install"><dir name="Complete"><file name="Form.php" hash="5992149b9ff2d2a7c2b008d98098362d"/></dir><file name="Complete.php" hash="452944c613b88ede358ee4dacd562d05"/><dir name="Install"><dir name="Create"><file name="Form.php" hash="65d98f1449ce6af413a3185692e07533"/></dir><file name="Create.php" hash="0d3182923fd5542e3d0a757625a85ae4"/><dir name="Login"><file name="Form.php" hash="a58c19056e47c7851eb6a5f40517f757"/></dir><file name="Login.php" hash="3ee61a883f843c55b1b32a328af84322"/></dir><dir name="Upgrade"><file name="Form.php" hash="6f4e2ac19d30115de4e275fdb8dca5b6"/></dir><file name="Upgrade.php" hash="f16ba61a8c86007bbc0a980e8faeade1"/><dir name="Welcome"><file name="Form.php" hash="58cb26cc7555498bd0367c77a99c8d60"/><file name="Store.php" hash="a3b77928861fb2660dc069a821e67932"/></dir><file name="Welcome.php" hash="86589c79b5c38ea5f25d58ac932f33cb"/></dir><dir name="Queue"><dir name="Configure"><file name="Form.php" hash="8eb691898c79cd5aed15c7857cb84b4c"/></dir><file name="Configure.php" hash="03d5ebf7644462904c439d172cde3afc"/><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="EventType.php" hash="4ac5971c368b70efa96b4c8297c85c3c"/><file name="Status.php" hash="ec57ddafc2515b952958e6ace6de22ec"/></dir></dir></dir><file name="Grid.php" hash="74d5f3b18d76cdf8219e2d39a83a2f7c"/></dir><file name="Queue.php" hash="2c905cc54a6c08d4d73a392d5b95a25c"/></dir><dir name="Tracking"><file name="Base.php" hash="5e0f245ac5ee59d2f6c6f35087059b56"/><file name="General.php" hash="9ca2796c6f2bf9233553e6b782f3722b"/><file name="Product.php" hash="3a0c1b1a5fcbd23d1dcd04714742ebe9"/></dir></dir><dir name="Helper"><file name="Configuration.php" hash="5c20237a83db488fa1fae9345bacdb15"/><file name="Data.php" hash="b27f970b943e6e989e9061275cc25c7b"/><file name="Extension.php" hash="5788a232ffaa32674b4bfc1e12e4ea98"/><file name="Links.php" hash="8bb36c918e956663113646183bd33c4c"/><file name="Urls.php" hash="ce396940c96bf8139da8ec59bb498acf"/></dir><dir name="Model"><dir name="Core"><file name="Api.php" hash="948c7965f7fe9d044b532314aaa8e0f9"/></dir><file name="Core.php" hash="ee964a27d5700393a656d9d3c48118f0"/><dir name="Extension"><dir name="RewardPoints"><file name="AbstractIntegration.php" hash="4ac34942072ce49d2971065a82d1068c"/><file name="IntegrationInterface.php" hash="f95f9f1e243c9fd920d27b9299b90f72"/><file name="MagestoreRewardPoints.php" hash="28671b6f35cb829f2d11166f081ad816"/><dir name="Observer"><file name="AbstractObserver.php" hash="eb710b7582050de644de2a8402d759ec"/><file name="MagestoreRewardPoints.php" hash="bac2ae11f94aa923accb0437027b4bec"/></dir></dir></dir><file name="Install.php" hash="3745801877f95a8dd01fe4c7207ba8cd"/><file name="Observer.php" hash="f351de3b13d72aca1ccbdb5d5e897b30"/><file name="Queue.php" hash="3a0fda4b18ec947c20e6e81cc1e995de"/><file name="Recovery.php" hash="bd856fdd5788e00bcf29a67446ad8ef1"/><file name="Request.php" hash="0d2dd4dfea7dbb7b4fe736425fd9c507"/><dir name="Resource"><file name="Coupon.php" hash="6079c05e422e9c1ad5327fc881cee7e3"/><dir name="Queue"><file name="Collection.php" hash="ce59b04c8a8146f5094d6622134885d3"/></dir><file name="Queue.php" hash="971a539849d0cde2e413b0642403a6ca"/><dir name="Rule"><file name="Collection.php" hash="b7cd7bbc0c4100a1a320e0f551be067a"/></dir><file name="Setup.php" hash="13253a5b7a2749f4a3bc84e32e31e27c"/></dir><file name="Webtracking.php" hash="e5b5f1d1bcd50d83e56ce8e3ba910de7"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigureController.php" hash="b4e51acf22ea798e2d2144a4672bc30f"/><dir name="Extension"><file name="AbstractController.php" hash="f5402dbc0e13412a52b70b5d36a14110"/><file name="RewardPointsController.php" hash="3e94e5ae4d467abf03f41e260b0421f9"/></dir><file name="InstallController.php" hash="d3183a180e6fa26be6767e4abbe701af"/><file name="MgconnectorController.php" hash="a8e55464624c5fa9e9641cf97f963b3b"/><file name="QueueController.php" hash="ed1fc5e937aa8e46e6e6149566504c7c"/></dir><file name="RecoveryController.php" hash="0a53efaef9019c6b661fe494067473e3"/><file name="WebtrackingController.php" hash="fd2c5034d94161c0e6f7f4e6b5816a55"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a417737a2225ef9f70b47eef77d75b7c"/><file name="api.xml" hash="9f6d5fd3330bb0640f97efc3f819e684"/><file name="config.xml" hash="d55c05529c3cfa5146ade9a606706606"/></dir><dir name="sql"><dir name="mgconnector_setup"><file name="mysql4-install-1.0.0.13.php" hash="d1033ffd3d6b13af28ad4082d5744c25"/><file name="mysql4-upgrade-1.0.0.13-1.0.0.14.php" hash="db871ba73f3dcc7abfb806991edc12f1"/><file name="mysql4-upgrade-1.0.0.14-1.0.0.15.php" hash="c9ced7a4a2e85c9d594e9f97320cab58"/><file name="mysql4-upgrade-1.0.0.14-1.1.0.0.php" hash="fd445e8c179cdb2718a85adec05c5343"/><file name="mysql4-upgrade-1.1.0.5-1.1.0.6.php" hash="e24831cfd077827ba545f7ea71669729"/><file name="mysql4-upgrade-1.1.2.8-1.3.0.0.php" hash="97bbb9e411bcd45f875f29fcc8c8b420"/><file name="mysql4-upgrade-1.4.7.2-1.4.8.0.php" hash="bb01ef486d9457fc7ef661a654fd1ec6"/></dir></dir></dir></dir></target>
17
  <target name="mageetc">
18
  <dir name="modules"><file name="Remarkety_Mgconnector.xml" hash="d584b234f653fbf34376e7dcb8caf117"/></dir></target>
19
  <target name="magedesign">
20
- <dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mgconnector.xml" hash="f08b20d71711e3497822310184cc903f"/></dir><dir name="template"><dir name="mgconnector"><file name="element.phtml" hash="b956df05d4eeb30f5199a75deab74fbc"/><dir name="extension"><file name="rewardpoints.phtml" hash="80b6252967b82121a2c6c19eff26b6a4"/></dir><dir name="install"><dir name="welcome"><file name="store.phtml" hash="3839928b62115329e0f3af442f44774d"/></dir></dir><dir name="widget"><dir name="form"><dir name="renderer"><dir name="fieldset"><file name="element.phtml" hash="abd5b9848b714779ddecb4536c846395"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mgconnector.xml" hash="81584e822ae52179c8fb1dfc48cb8a9f"/></dir><dir name="template"><dir name="mgconnector"><dir name="tracking"><file name="general.phtml" hash="9da11c45059c094753ea65b2067be9a7"/><file name="product_view.phtml" hash="cf48e30b61979eaed3813b422959937f"/></dir></dir></dir></dir></dir></dir></target>
21
  </contents>
22
  <compatible/>
23
  <dependencies>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Remarkety_Mgconnector</name>
4
+ <version>1.4.9.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl-3.0.html">GPL v3</license>
7
  <channel>community</channel>
9
  <summary>Remarkety Magento Connector</summary>
10
  <description>Remarkety Magento Connector</description>
11
  <notes>No comments</notes>
12
+ <date>2016-11-17</date>
13
+ <time>14-46-52</time>
14
  <contents>
15
  <target name="magecommunity">
16
+ <dir name="Remarkety"><dir name="Mgconnector"><dir name="Block"><dir name="Adminhtml"><dir name="Configuration"><dir name="Complete"><file name="Form.php" hash="e6dc10d742071fe8d041801d4ae605ff"/></dir><file name="Complete.php" hash="d816f575e8ef99c8dbb4440666963bd0"/><dir name="Configuration"><file name="Form.php" hash="861b674ee5ac1e384fd68e29bd59bb02"/></dir><file name="Configuration.php" hash="8f8c4988205d9d1e2c7cd23c27a9483f"/><dir name="Install"><file name="Form.php" hash="cede3e19bde805c40342ea26e1deeda5"/></dir><file name="Install.php" hash="9c093e25a8cc9a1fe16c87cfea2e3819"/><dir name="Upgrade"><file name="Form.php" hash="9af9dbeae95cbcdae2ec32632447f9c6"/></dir><file name="Upgrade.php" hash="93222bbdfff6b417b4b6ecbfc7c3d764"/></dir><file name="Configuration.php" hash="4df74b83acfbbe6e6fdaa708f0d9ba7e"/><dir name="Extension"><file name="RewardPoints.php" hash="82e320930f59dfd45e5aa73005118833"/></dir><dir name="Install"><dir name="Complete"><file name="Form.php" hash="fd219a65921dba3099ba77166f59e8da"/></dir><file name="Complete.php" hash="c20351873d05cde757620ae6458c1ec4"/><dir name="Install"><dir name="Create"><file name="Form.php" hash="af271c9df233ac8164dfa73216a524fc"/></dir><file name="Create.php" hash="bcd942c4fd64543c1b65001ec84d0d71"/><dir name="Login"><file name="Form.php" hash="bb431cadabe945c82df6cb921c5e2c30"/></dir><file name="Login.php" hash="6f7e30f2c36e56925be25496fde1e29a"/></dir><dir name="Upgrade"><file name="Form.php" hash="490a20b1e39d153af18e90844593c772"/></dir><file name="Upgrade.php" hash="5e30edfcc5954ccf65dcd36192356bed"/><dir name="Welcome"><file name="Form.php" hash="b4f135c3c0106a8391931d6d5865d599"/><file name="Store.php" hash="c4be91045c5ce42128f3c22350ac589b"/></dir><file name="Welcome.php" hash="de47e1c94e4073e2d2af94a0b5455250"/></dir><dir name="Queue"><dir name="Configure"><file name="Form.php" hash="4668539bf05e44ec9cdfcf2388277e9a"/></dir><file name="Configure.php" hash="87841e46d93c568bdd09304d016de589"/><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="EventType.php" hash="13fd2faaa07dc11d6052ab9e0c6a4261"/><file name="Status.php" hash="7f087c6d8e55b67d5a7781a31d1ed924"/></dir></dir></dir><file name="Grid.php" hash="f822b539114f10256a69333c8bf4a2e6"/></dir><file name="Queue.php" hash="b778ce9202431147083365b8021103d0"/></dir><dir name="Tracking"><file name="Base.php" hash="13ca340914c121828b2a479af40e2e7d"/><file name="General.php" hash="2fbff52cfe2924412376bbb4328068be"/><file name="Product.php" hash="11fd52b220b73fb5f2dc87a4684b056a"/></dir></dir><dir name="Helper"><file name="Configuration.php" hash="45084eee5817158fbf19959217797c6e"/><file name="Data.php" hash="e07e033f6594609aa78c82a45708dd85"/><file name="Extension.php" hash="5788a232ffaa32674b4bfc1e12e4ea98"/><file name="Links.php" hash="9f154ee8056f27f8b42f1a42880bb90a"/><file name="Urls.php" hash="2d431aa22e9cd1595c421502ecda62b8"/></dir><dir name="Model"><dir name="Core"><file name="Api.php" hash="fc55e8b87e999498bb14340db7e9cde4"/></dir><file name="Core.php" hash="ee964a27d5700393a656d9d3c48118f0"/><dir name="Extension"><dir name="RewardPoints"><file name="AbstractIntegration.php" hash="4ac34942072ce49d2971065a82d1068c"/><file name="IntegrationInterface.php" hash="f95f9f1e243c9fd920d27b9299b90f72"/><file name="MagestoreRewardPoints.php" hash="70c4c74fedd4bfb717132d6d825e438d"/><dir name="Observer"><file name="AbstractObserver.php" hash="eb710b7582050de644de2a8402d759ec"/><file name="MagestoreRewardPoints.php" hash="bac2ae11f94aa923accb0437027b4bec"/></dir></dir></dir><file name="Install.php" hash="902f33bd045e653e9c4fed2ce632b26e"/><file name="Observer.php" hash="a39ccd3d09f949b86d8d5a4b5aa94a9e"/><file name="Queue.php" hash="afda656a56b9d44d2ce18a60fdce0912"/><file name="Recovery.php" hash="69bd78f2a3d92db91601cf2afa9c131c"/><file name="Request.php" hash="e7e8860a186ae21a7eee44f6f49d6a8c"/><dir name="Resource"><file name="Coupon.php" hash="6079c05e422e9c1ad5327fc881cee7e3"/><dir name="Queue"><file name="Collection.php" hash="61b5b2fb72b1cbc9465b8efa6f161e46"/></dir><file name="Queue.php" hash="fd9ce12e48148c2eb88db7336b43e5ac"/><dir name="Rule"><file name="Collection.php" hash="d38eed437f15d67b21c3be935053fea5"/></dir><file name="Setup.php" hash="5387a1470bf28911ba531ed88e156569"/></dir><file name="Webtracking.php" hash="e5b5f1d1bcd50d83e56ce8e3ba910de7"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigureController.php" hash="0b7a6beed2fc4eed01ad7c3363a73dbb"/><dir name="Extension"><file name="AbstractController.php" hash="fa816f490f29820c3b3faa17a3fc00e5"/><file name="RewardPointsController.php" hash="3e94e5ae4d467abf03f41e260b0421f9"/></dir><file name="InstallController.php" hash="be36853b940c958f29fe00535eea1df1"/><file name="MgconnectorController.php" hash="8eecb0d7625336661d2b541d64999f8a"/><file name="QueueController.php" hash="b8c8a0ab8c4efde1fdc9283a37f93b4e"/></dir><file name="RecoveryController.php" hash="a2493669b27287ceb4ada2f9128f5c08"/><file name="WebtrackingController.php" hash="03835c6f4760d203ed81dcea6b591de5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a417737a2225ef9f70b47eef77d75b7c"/><file name="api.xml" hash="9f6d5fd3330bb0640f97efc3f819e684"/><file name="config.xml" hash="030773ee3c76b4d67a11a2b1ab152ee1"/></dir><dir name="sql"><dir name="mgconnector_setup"><file name="mysql4-install-1.0.0.13.php" hash="6d0bc421987b0238e350003629e8c464"/><file name="mysql4-upgrade-1.0.0.13-1.0.0.14.php" hash="2c28f665f2a8f78cdfc0b121703734af"/><file name="mysql4-upgrade-1.0.0.14-1.0.0.15.php" hash="284433b68df4ce4e83389db33f4a197c"/><file name="mysql4-upgrade-1.0.0.14-1.1.0.0.php" hash="2042704f23d7337ba3d0901f662096a8"/><file name="mysql4-upgrade-1.1.0.5-1.1.0.6.php" hash="2cc5dc8b986cd4ea1a70519ca59a7be9"/><file name="mysql4-upgrade-1.1.2.8-1.1.2.9.php" hash="ef7be7f476ed01e81fe8f9a62b63d008"/><file name="mysql4-upgrade-1.1.2.8-1.3.0.0.php" hash="fef6b0ee2a43cd42036ca12915885794"/><file name="mysql4-upgrade-1.1.2.9-1.1.3.0.php" hash="4871718266ef707c3b136e6d5591ed25"/><file name="mysql4-upgrade-1.4.7.2-1.4.8.0.php" hash="d2b686bdedc6645a5c4f9609c6cea434"/></dir></dir></dir></dir></target>
17
  <target name="mageetc">
18
  <dir name="modules"><file name="Remarkety_Mgconnector.xml" hash="d584b234f653fbf34376e7dcb8caf117"/></dir></target>
19
  <target name="magedesign">
20
+ <dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mgconnector.xml" hash="f08b20d71711e3497822310184cc903f"/></dir><dir name="template"><dir name="mgconnector"><file name="element.phtml" hash="b956df05d4eeb30f5199a75deab74fbc"/><dir name="extension"><file name="rewardpoints.phtml" hash="bb7e14c4173c81403f9d61c77429c8e1"/></dir><dir name="install"><dir name="welcome"><file name="store.phtml" hash="cff8433cb12531d8527a062242baa51b"/></dir></dir><dir name="widget"><dir name="form"><dir name="renderer"><dir name="fieldset"><file name="element.phtml" hash="abd5b9848b714779ddecb4536c846395"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mgconnector.xml" hash="81584e822ae52179c8fb1dfc48cb8a9f"/></dir><dir name="template"><dir name="mgconnector"><dir name="tracking"><file name="general.phtml" hash="c5699a557130609f8d1bf85cb68bf177"/><file name="product_view.phtml" hash="34c1d41a5b7c303b5a4a1e4ca1f8c0be"/></dir></dir></dir></dir></dir></dir></target>
21
  </contents>
22
  <compatible/>
23
  <dependencies>