Version Notes
No comments
Download this release
Release Info
Developer | Remarkety |
Extension | Remarkety_Mgconnector |
Version | 1.4.3.0 |
Comparing to | |
See all releases |
Version 1.4.3.0
- CHANGELOG.txt +79 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration.php +24 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete.php +35 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete/Form.php +62 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration.php +41 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration/Form.php +64 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install.php +35 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install/Form.php +90 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade.php +35 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade/Form.php +71 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete.php +37 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete/Form.php +63 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create.php +33 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create/Form.php +140 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login.php +33 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login/Form.php +130 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade.php +37 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade/Form.php +62 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome.php +39 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Form.php +56 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Store.php +60 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue.php +24 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure.php +38 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure/Form.php +104 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid.php +116 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid/Column/Renderer/EventType.php +29 -0
- app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Grid/Column/Renderer/Status.php +25 -0
- app/code/community/Remarkety/Mgconnector/Block/Tracking/Base.php +35 -0
- app/code/community/Remarkety/Mgconnector/Block/Tracking/General.php +5 -0
- app/code/community/Remarkety/Mgconnector/Block/Tracking/Product.php +57 -0
- app/code/community/Remarkety/Mgconnector/Helper/Data.php +74 -0
- app/code/community/Remarkety/Mgconnector/Helper/Links.php +64 -0
- app/code/community/Remarkety/Mgconnector/Helper/Urls.php +46 -0
- app/code/community/Remarkety/Mgconnector/Model/Core.php +1399 -0
- app/code/community/Remarkety/Mgconnector/Model/Core/Api.php +211 -0
- app/code/community/Remarkety/Mgconnector/Model/Install.php +484 -0
- app/code/community/Remarkety/Mgconnector/Model/Observer.php +499 -0
- app/code/community/Remarkety/Mgconnector/Model/Queue.php +16 -0
- app/code/community/Remarkety/Mgconnector/Model/Recovery.php +92 -0
- app/code/community/Remarkety/Mgconnector/Model/Request.php +131 -0
- app/code/community/Remarkety/Mgconnector/Model/Resource/Coupon.php +77 -0
- app/code/community/Remarkety/Mgconnector/Model/Resource/Queue.php +30 -0
- app/code/community/Remarkety/Mgconnector/Model/Resource/Queue/Collection.php +30 -0
- app/code/community/Remarkety/Mgconnector/Model/Resource/Rule/Collection.php +138 -0
- app/code/community/Remarkety/Mgconnector/Model/Resource/Setup.php +13 -0
- app/code/community/Remarkety/Mgconnector/Model/Webtracking.php +40 -0
- app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/ConfigureController.php +55 -0
- app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/InstallController.php +186 -0
- app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/MgconnectorController.php +192 -0
- app/code/community/Remarkety/Mgconnector/controllers/Adminhtml/QueueController.php +129 -0
- app/code/community/Remarkety/Mgconnector/controllers/RecoveryController.php +53 -0
- app/code/community/Remarkety/Mgconnector/controllers/WebtrackingController.php +31 -0
- app/code/community/Remarkety/Mgconnector/etc/adminhtml.xml +55 -0
- app/code/community/Remarkety/Mgconnector/etc/api.xml +68 -0
- app/code/community/Remarkety/Mgconnector/etc/config.xml +163 -0
- app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-install-1.0.0.13.php +26 -0
- app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.13-1.0.0.14.php +26 -0
- app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.14-1.0.0.15.php +13 -0
- app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.0.0.14-1.1.0.0.php +13 -0
- app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.0.5-1.1.0.6.php +15 -0
- app/code/community/Remarkety/Mgconnector/sql/mgconnector_setup/mysql4-upgrade-1.1.2.8-1.3.0.0.php +21 -0
- app/design/adminhtml/default/default/template/mgconnector/element.phtml +26 -0
- app/design/adminhtml/default/default/template/mgconnector/install/welcome/store.phtml +70 -0
- app/design/adminhtml/default/default/template/mgconnector/widget/form/renderer/fieldset/element.phtml +26 -0
- app/design/frontend/base/default/layout/mgconnector.xml +13 -0
- app/design/frontend/base/default/template/mgconnector/tracking/general.phtml +23 -0
- app/design/frontend/base/default/template/mgconnector/tracking/product_view.phtml +10 -0
- app/etc/modules/Remarkety_Mgconnector.xml +12 -0
- package.xml +31 -0
CHANGELOG.txt
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
1.4.3.0
|
2 |
+
-------
|
3 |
+
- Bypass store cache for website tracking
|
4 |
+
- Changed menu titles
|
5 |
+
|
6 |
+
1.4.2.0
|
7 |
+
-------
|
8 |
+
- Clear cache after enable/disable website tracking
|
9 |
+
- Bugfix: Array declaration error on old PHP versions
|
10 |
+
|
11 |
+
1.4.1.0
|
12 |
+
-------
|
13 |
+
Allow admin to change Remarkety's api key
|
14 |
+
|
15 |
+
1.4.0.2
|
16 |
+
-------
|
17 |
+
Bug fix subscribers view id
|
18 |
+
|
19 |
+
1.4.0.1
|
20 |
+
-------
|
21 |
+
Newsletter subscription saves the email address to the cart
|
22 |
+
|
23 |
+
1.4.0.0
|
24 |
+
-------
|
25 |
+
Enable website tracking from the Remarkety installation menu
|
26 |
+
|
27 |
+
1.3.0.1
|
28 |
+
-------
|
29 |
+
Automatic tagging for newsletter subscribers
|
30 |
+
|
31 |
+
1.3.0.0
|
32 |
+
-------
|
33 |
+
- Add support for per-coupon expiration dates
|
34 |
+
|
35 |
+
1.2.0.0
|
36 |
+
-------
|
37 |
+
- Automatic tagging for newsletter subscribers
|
38 |
+
- Add cart recovery link
|
39 |
+
- Payment method field added for segmentation
|
40 |
+
|
41 |
+
1.1.2.7
|
42 |
+
-------
|
43 |
+
- Don't sync products which are not visible
|
44 |
+
- Deal with no tags collection
|
45 |
+
- Fix table prefix issue
|
46 |
+
|
47 |
+
1.1.2.6
|
48 |
+
-------
|
49 |
+
- Backward compatibility for PHP 5.3
|
50 |
+
|
51 |
+
1.1.0.10
|
52 |
+
--------
|
53 |
+
- Support installation of multiple views through the plugin
|
54 |
+
- Error logging improvements
|
55 |
+
|
56 |
+
1.1.0.9
|
57 |
+
-------
|
58 |
+
- API can return log for analysis
|
59 |
+
- Return more information: Discount prices, stock levels, parent product
|
60 |
+
- Performance improvements when fetching products
|
61 |
+
|
62 |
+
1.1.0.4
|
63 |
+
-------
|
64 |
+
- Fix bug in creating a Magento Web Service user, when another WS user already has the same email
|
65 |
+
|
66 |
+
1.1.0.3
|
67 |
+
-------
|
68 |
+
- Fix bug in comparing what's changed in customer observer
|
69 |
+
|
70 |
+
1.1.0.1
|
71 |
+
-------
|
72 |
+
- Resend / delete queue events
|
73 |
+
|
74 |
+
1.1.0.0
|
75 |
+
-------
|
76 |
+
- Implement one-click install for Magento
|
77 |
+
- Send customer update events (signup / subscribe / unsubscribe) immediately (push)
|
78 |
+
- Fix problem with multiple views
|
79 |
+
- Resend / delete queue events
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration.php
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete.php
ADDED
@@ -0,0 +1,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('save', array(
|
30 |
+
'label' => Mage::helper('adminhtml')->__('Done'),
|
31 |
+
'onclick' => 'editForm.submit();',
|
32 |
+
'class' => 'save',
|
33 |
+
), 1);
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Complete/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration.php
ADDED
@@ -0,0 +1,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('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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Configuration/Form.php
ADDED
@@ -0,0 +1,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(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' => true,
|
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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install.php
ADDED
@@ -0,0 +1,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('save', array(
|
30 |
+
'label' => Mage::helper('adminhtml')->__('Complete Installation'),
|
31 |
+
'onclick' => 'editForm.submit();',
|
32 |
+
'class' => 'save',
|
33 |
+
), 1);
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Install/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade.php
ADDED
@@ -0,0 +1,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('save', array(
|
30 |
+
'label' => Mage::helper('adminhtml')->__('Complete Installation'),
|
31 |
+
'onclick' => 'editForm.submit();',
|
32 |
+
'class' => 'save',
|
33 |
+
), 1);
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Configuration/Upgrade/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete.php
ADDED
@@ -0,0 +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_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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Complete/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create.php
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Create/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login.php
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Install/Login/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade.php
ADDED
@@ -0,0 +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_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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Upgrade/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome.php
ADDED
@@ -0,0 +1,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('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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Form.php
ADDED
@@ -0,0 +1,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(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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Install/Welcome/Store.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Remarkety_Mgconnector_Block_Adminhtml_Install_Welcome_Store extends Mage_Adminhtml_Block_Template
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Prepare block
|
7 |
+
*/
|
8 |
+
public function __construct()
|
9 |
+
{
|
10 |
+
$this->setTemplate('mgconnector/install/welcome/store.phtml');
|
11 |
+
parent::__construct();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function getStoresStatus()
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* @var $wtModel Remarkety_Mgconnector_Model_Webtracking
|
18 |
+
*/
|
19 |
+
$wtModel = Mage::getModel('mgconnector/webtracking');
|
20 |
+
|
21 |
+
$stores = array();
|
22 |
+
|
23 |
+
foreach (Mage::app()->getWebsites() as $_website) {
|
24 |
+
$stores[$_website->getCode()] = array(
|
25 |
+
'name' => $_website->getName(),
|
26 |
+
'id' => $_website->getWebsiteId(),
|
27 |
+
);
|
28 |
+
|
29 |
+
foreach ($_website->getGroups() as $_group) {
|
30 |
+
$stores[$_website->getCode()]['store_groups'][$_group->getCode()] = array(
|
31 |
+
'name' => $_group->getName(),
|
32 |
+
'id' => $_group->getGroupId(),
|
33 |
+
);
|
34 |
+
|
35 |
+
foreach ($_group->getStores() as $_store) {
|
36 |
+
$isInstalled = $_store->getConfig(Remarkety_Mgconnector_Model_Install::XPATH_INSTALLED);
|
37 |
+
$webtracking = $wtModel->getRemarketyPublicId($_store->getStoreId());
|
38 |
+
$stores[$_website->getCode()]['store_groups'][$_group->getCode()]['store_views'][$_store->getCode()] = array(
|
39 |
+
'name' => $_store->getName(),
|
40 |
+
'id' => $_store->getStoreId(),
|
41 |
+
'isInstalled' => $isInstalled,
|
42 |
+
'webTracking' => $webtracking
|
43 |
+
);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
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');
|
55 |
+
return $uModel->authenticate(\Remarkety_Mgconnector_Model_Install::WEB_SERVICE_USERNAME, $apiKey);
|
56 |
+
} catch (Exception $ex){
|
57 |
+
return false;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue.php
ADDED
@@ -0,0 +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 |
+
}
|
app/code/community/Remarkety/Mgconnector/Block/Adminhtml/Queue/Configure.php
ADDED
@@ -0,0 +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()
|