Version Notes
- Coding stardard
Download this release
Release Info
Developer | Temando |
Extension | Temando_Installer |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.5
- app/code/community/Temando/Installer/Block/Adminhtml/Installer.php +32 -30
- app/code/community/Temando/Installer/Block/Adminhtml/Installer/Grid.php +115 -86
- app/code/community/Temando/Installer/Block/Adminhtml/Notifications.php +18 -17
- app/code/community/Temando/Installer/Block/Adminhtml/System/Config/Form/Button/Manage.php +24 -23
- app/code/community/Temando/Installer/Helper/Data.php +264 -254
- app/code/community/Temando/Installer/Model/Api/Rest/Client.php +129 -121
- app/code/community/Temando/Installer/Model/Connect.php +150 -140
- app/code/community/Temando/Installer/Model/Cron.php +69 -62
- app/code/community/Temando/Installer/Model/Installer.php +225 -210
- app/code/community/Temando/Installer/Model/{Mysql4 → Resource}/Installer.php +14 -14
- app/code/community/Temando/Installer/Model/{Mysql4 → Resource}/Installer/Collection.php +16 -16
- app/code/community/Temando/Installer/Model/Tester.php +130 -122
- app/code/community/Temando/Installer/controllers/Adminhtml/Temandoinstaller/InstallerController.php +94 -58
- app/code/community/Temando/Installer/data/temandoinstaller_setup/data-install-1.0.0.php +26 -31
- app/code/community/Temando/Installer/data/temandoinstaller_setup/data-upgrade-1.0.2-1.0.3.php +28 -27
- app/code/community/Temando/Installer/etc/adminhtml.xml +40 -40
- app/code/community/Temando/Installer/etc/config.xml +5 -5
- app/code/community/Temando/Installer/etc/system.xml +43 -43
- app/code/community/Temando/Installer/sql/temandoinstaller_setup/mysql4-install-1.0.0.php +28 -30
- app/design/adminhtml/default/default/layout/temandoinstaller.xml +15 -15
- app/design/adminhtml/default/default/template/temando/installer/notifications.phtml +16 -16
- app/etc/modules/Temando_Installer.xml +8 -8
- app/locale/fr_FR/Temando_Installer.csv +44 -44
- package.xml +5 -5
app/code/community/Temando/Installer/Block/Adminhtml/Installer.php
CHANGED
@@ -1,30 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Adminhtml Installer
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
$this->
|
14 |
-
$this->
|
15 |
-
$this->
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
}
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Adminhtml Installer
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Block_Adminhtml_Installer extends Mage_Adminhtml_Block_Widget_Grid_Container
|
10 |
+
{
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
$this->_blockGroup = 'temandoinstaller';
|
14 |
+
$this->_controller = 'adminhtml_installer';
|
15 |
+
$this->_headerText = $this->__('Manage Temando');
|
16 |
+
$this->_addButtonLabel = $this->__('Install Temando');
|
17 |
+
/** if (Mage::helper('temandoinstaller')->getTemandoVersionNumber()) {
|
18 |
+
$this->_addButton('connectionSettings', array(
|
19 |
+
'label' => $this->__('Test Connection Settings'),
|
20 |
+
'id' => 'connectionSettings',
|
21 |
+
'onclick' => "window.location = '" .
|
22 |
+
$this->getUrl('adminhtml/temandoinstaller_installer/testConnectionSettings') . "'",
|
23 |
+
'value' => '',
|
24 |
+
'class' => 'go',
|
25 |
+
));
|
26 |
+
}*/
|
27 |
+
parent::__construct();
|
28 |
+
if (Mage::helper('temandoinstaller')->getTemandoVersionNumber()) {
|
29 |
+
$this->removeButton('add');
|
30 |
+
}
|
31 |
+
}
|
32 |
+
}
|
app/code/community/Temando/Installer/Block/Adminhtml/Installer/Grid.php
CHANGED
@@ -1,86 +1,115 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Adminhtml Installer Grid
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
$this->
|
15 |
-
$this->
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
$
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
'
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
$this->addColumn(
|
37 |
-
'
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
}
|
81 |
-
|
82 |
-
public function
|
83 |
-
{
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Adminhtml Installer Grid
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Block_Adminhtml_Installer_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
10 |
+
{
|
11 |
+
public function _construct()
|
12 |
+
{
|
13 |
+
parent::_construct();
|
14 |
+
$this->setDefaultSort('id');
|
15 |
+
$this->setDefaultDir('DESC');
|
16 |
+
$this->setSaveParametersInSession(true);
|
17 |
+
}
|
18 |
+
|
19 |
+
protected function _prepareCollection()
|
20 |
+
{
|
21 |
+
$collection = Mage::getModel('temandoinstaller/installer')->getCollection();
|
22 |
+
$this->setCollection($collection);
|
23 |
+
parent::_prepareCollection();
|
24 |
+
}
|
25 |
+
|
26 |
+
protected function _prepareColumns()
|
27 |
+
{
|
28 |
+
$this->addColumn(
|
29 |
+
'name',
|
30 |
+
array(
|
31 |
+
'header' => Mage::helper('temandoinstaller')->__('Name'),
|
32 |
+
'index' => 'name',
|
33 |
+
)
|
34 |
+
);
|
35 |
+
|
36 |
+
$this->addColumn(
|
37 |
+
'version',
|
38 |
+
array(
|
39 |
+
'header' => Mage::helper('temandoinstaller')->__('Version'),
|
40 |
+
'index' => 'version',
|
41 |
+
)
|
42 |
+
);
|
43 |
+
|
44 |
+
$this->addColumn(
|
45 |
+
'token',
|
46 |
+
array(
|
47 |
+
'header' => Mage::helper('temandoinstaller')->__('Token'),
|
48 |
+
'index' => 'token',
|
49 |
+
)
|
50 |
+
);
|
51 |
+
|
52 |
+
$this->addColumn(
|
53 |
+
'install_date',
|
54 |
+
array(
|
55 |
+
'header' => Mage::helper('temandoinstaller')->__('Install date'),
|
56 |
+
'type' => 'datetime',
|
57 |
+
'index' => 'install_date',
|
58 |
+
)
|
59 |
+
);
|
60 |
+
|
61 |
+
$this->addColumn(
|
62 |
+
'update_date',
|
63 |
+
array(
|
64 |
+
'header' => Mage::helper('temandoinstaller')->__('Update date'),
|
65 |
+
'type' => 'datetime',
|
66 |
+
'index' => 'update_date',
|
67 |
+
)
|
68 |
+
);
|
69 |
+
|
70 |
+
$this->addColumn(
|
71 |
+
'update_details',
|
72 |
+
array(
|
73 |
+
'header' => Mage::helper('temandoinstaller')->__('Update available'),
|
74 |
+
'index' => 'update_details',
|
75 |
+
'filter' => false,
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
parent::_prepareColumns();
|
80 |
+
}
|
81 |
+
|
82 |
+
public function _prepareMassaction()
|
83 |
+
{
|
84 |
+
parent::_prepareMassaction();
|
85 |
+
$this->getMassactionBlock()->addItem(
|
86 |
+
'uninstall',
|
87 |
+
array(
|
88 |
+
'label'=> Mage::helper('temandoinstaller')->__('Uninstall'),
|
89 |
+
'url' => $this->getUrl('*/*/uninstall'),
|
90 |
+
'confirm' => Mage::helper('temandoinstaller')->
|
91 |
+
__('Are you sure you want to uninstall the Temando module?'),
|
92 |
+
)
|
93 |
+
);
|
94 |
+
|
95 |
+
$this->getMassactionBlock()->addItem(
|
96 |
+
'update',
|
97 |
+
array(
|
98 |
+
'label' => Mage::helper('temandoinstaller')->__('Update'),
|
99 |
+
'url' => $this->getUrl('*/*/update'),
|
100 |
+
'confirm' => Mage::helper('temandoinstaller')->
|
101 |
+
__('Are you sure you want to update the Temando module?'),
|
102 |
+
)
|
103 |
+
);
|
104 |
+
|
105 |
+
$this->setMassactionIdField('id');
|
106 |
+
$this->getMassactionBlock()->setUseSelectAll(false);
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
public function getRowUrl($row)
|
112 |
+
{
|
113 |
+
return;
|
114 |
+
} */
|
115 |
+
}
|
app/code/community/Temando/Installer/Block/Adminhtml/Notifications.php
CHANGED
@@ -1,17 +1,18 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Adminhtml Notifications
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
$installerModules
|
14 |
-
$installerModules->addFieldToFilter('
|
15 |
-
|
16 |
-
|
17 |
-
}
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Adminhtml Notifications
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Block_Adminhtml_Notifications extends Mage_Adminhtml_Block_Template
|
10 |
+
{
|
11 |
+
public function getModuleNotifications()
|
12 |
+
{
|
13 |
+
$installerModules = Mage::getModel('temandoinstaller/installer')->getCollection();
|
14 |
+
$installerModules->addFieldToFilter('update_dismissed', false);
|
15 |
+
$installerModules->addFieldToFilter('update_available', true);
|
16 |
+
return $installerModules;
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Temando/Installer/Block/Adminhtml/System/Config/Form/Button/Manage.php
CHANGED
@@ -1,23 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Adminhtml System Config Form Button Manage
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
$
|
15 |
-
|
16 |
-
->
|
17 |
-
->
|
18 |
-
->
|
19 |
-
->
|
20 |
-
->
|
21 |
-
|
22 |
-
|
23 |
-
}
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Adminhtml System Config Form Button Manage
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Block_Adminhtml_System_Config_Form_Button_Manage
|
10 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field
|
11 |
+
{
|
12 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
13 |
+
{
|
14 |
+
$this->setElement($element);
|
15 |
+
$html = $this->getLayout()
|
16 |
+
->createBlock('adminhtml/widget_button')
|
17 |
+
->setType('button')->setClass('scalable go')
|
18 |
+
->setLabel(Mage::helper('temandoinstaller')->__('Manage Temando Installation'))
|
19 |
+
->setOnClick('setLocation(\'' . $this->getUrl('adminhtml/temandoinstaller_installer') .'\')')
|
20 |
+
->setTitle(Mage::helper('temandoinstaller')->__('Manage Temando Installation'))
|
21 |
+
->toHtml();
|
22 |
+
return $html;
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Temando/Installer/Helper/Data.php
CHANGED
@@ -1,254 +1,264 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Helper Data
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
const
|
13 |
-
const
|
14 |
-
const
|
15 |
-
const
|
16 |
-
const
|
17 |
-
const
|
18 |
-
const
|
19 |
-
const
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
*
|
26 |
-
*
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
$
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
$this->_tmdVersion = self::
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
public function
|
68 |
-
{
|
69 |
-
$
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
case self::
|
78 |
-
$versionName = '
|
79 |
-
break;
|
80 |
-
case self::
|
81 |
-
$versionName = '
|
82 |
-
break;
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
self::
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
$
|
187 |
-
$
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
->
|
214 |
-
->
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
$
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Helper Data
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Helper_Data extends Mage_Core_Helper_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
const TMD_VERSION_STARTER = '1.0.0';
|
13 |
+
const TMD_VERSION_PROFFESIONAL = '2.0.0';
|
14 |
+
const TMD_VERSION_BUSINESS = '3.0.0';
|
15 |
+
const TMD_VERSION_ENTERPRISE = '4.0.0';
|
16 |
+
const TEMANDO_VERSION_STARTER = 'magento-starter';
|
17 |
+
const TEMANDO_VERSION_PROFESSIONAL = 'magento-professional';
|
18 |
+
const TEMANDO_VERSION_BUSINESS = 'magento-business';
|
19 |
+
const TEMANDO_VERSION_ENTERPRISE = 'magento-enterprise';
|
20 |
+
const TMD_MODULE_NAME = 'Temando_Temando';
|
21 |
+
|
22 |
+
protected $_tmdVersion = null;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Gets version of main Temando_Temando extension
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function getTemandoVersion()
|
30 |
+
{
|
31 |
+
if (!$this->_tmdVersion) {
|
32 |
+
$version = (string) Mage::getConfig()->getNode()->modules->Temando_Temando->version;
|
33 |
+
if (version_compare($version, self::TMD_VERSION_PROFFESIONAL, '<')) {
|
34 |
+
//anything less than 2.0.0
|
35 |
+
$this->_tmdVersion = self::TMD_VERSION_STARTER;
|
36 |
+
}
|
37 |
+
|
38 |
+
if (version_compare($version, self::TMD_VERSION_PROFFESIONAL, '>=')
|
39 |
+
&& version_compare($version, self::TMD_VERSION_BUSINESS, '<')) {
|
40 |
+
//equals or greater than 2.0.0 but less then 3.0.0
|
41 |
+
$this->_tmdVersion = self::TMD_VERSION_PROFFESIONAL;
|
42 |
+
}
|
43 |
+
|
44 |
+
if (version_compare($version, self::TMD_VERSION_BUSINESS, '>=')
|
45 |
+
&& version_compare($version, self::TMD_VERSION_ENTERPRISE, '<')) {
|
46 |
+
//equals or greater than 2.0.0 but less then 3.0.0
|
47 |
+
$this->_tmdVersion = self::TMD_VERSION_BUSINESS;
|
48 |
+
}
|
49 |
+
|
50 |
+
if (version_compare($version, self::TMD_VERSION_ENTERPRISE, '>=')) {
|
51 |
+
$this->_tmdVersion = self::TMD_VERSION_ENTERPRISE;
|
52 |
+
}
|
53 |
+
|
54 |
+
if (!$version) {
|
55 |
+
$this->_tmdVersion = null;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
return $this->_tmdVersion;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Retrieves an element from the module configuration data.
|
64 |
+
*
|
65 |
+
* @param string $field
|
66 |
+
*/
|
67 |
+
public function getConfigData($field)
|
68 |
+
{
|
69 |
+
$path = 'temandoinstaller/' . $field;
|
70 |
+
return Mage::getStoreConfig($path);
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getTemandoVersionName()
|
74 |
+
{
|
75 |
+
$versionName = null;
|
76 |
+
switch ($this->getTemandoVersion()) {
|
77 |
+
case self::TMD_VERSION_STARTER:
|
78 |
+
$versionName = 'starter';
|
79 |
+
break;
|
80 |
+
case self::TMD_VERSION_PROFFESIONAL:
|
81 |
+
$versionName = 'professional';
|
82 |
+
break;
|
83 |
+
case self::TMD_VERSION_BUSINESS:
|
84 |
+
$versionName = 'business';
|
85 |
+
break;
|
86 |
+
case self::TMD_VERSION_ENTERPRISE:
|
87 |
+
$versionName = 'enterprise';
|
88 |
+
break;
|
89 |
+
}
|
90 |
+
|
91 |
+
return $versionName;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getVersions()
|
95 |
+
{
|
96 |
+
return array(
|
97 |
+
self::TEMANDO_VERSION_STARTER,
|
98 |
+
self::TEMANDO_VERSION_PROFESSIONAL,
|
99 |
+
self::TEMANDO_VERSION_BUSINESS,
|
100 |
+
self::TEMANDO_VERSION_ENTERPRISE);
|
101 |
+
}
|
102 |
+
|
103 |
+
public function getVersionNameFromSlug($slug)
|
104 |
+
{
|
105 |
+
$strippedSlug = substr($slug, 0, -3);
|
106 |
+
$names = array(
|
107 |
+
self::TEMANDO_VERSION_STARTER => 'Temando Starter',
|
108 |
+
self::TEMANDO_VERSION_PROFESSIONAL => 'Temando Professional',
|
109 |
+
self::TEMANDO_VERSION_BUSINESS => 'Temando Business',
|
110 |
+
self::TEMANDO_VERSION_ENTERPRISE => 'Temando Enterprise'
|
111 |
+
);
|
112 |
+
return $names[$strippedSlug];
|
113 |
+
}
|
114 |
+
|
115 |
+
public function getTemandoVersionNumber()
|
116 |
+
{
|
117 |
+
$version = (string) Mage::getConfig()->getNode()->modules->Temando_Temando->version;
|
118 |
+
return $version;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function getTemandoModuleName()
|
122 |
+
{
|
123 |
+
return self::TMD_MODULE_NAME;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function getTemandoToken()
|
127 |
+
{
|
128 |
+
return $this->getConfigData('general/token');
|
129 |
+
}
|
130 |
+
|
131 |
+
public function getTemandoWarehouses()
|
132 |
+
{
|
133 |
+
return Mage::getResourceModel('temando/warehouse_collection');
|
134 |
+
}
|
135 |
+
|
136 |
+
public function getTemandoRules()
|
137 |
+
{
|
138 |
+
return Mage::getResourceModel('temando/rule_collection');
|
139 |
+
}
|
140 |
+
|
141 |
+
public function testAccountDetails()
|
142 |
+
{
|
143 |
+
try {
|
144 |
+
$api = $this->connect();
|
145 |
+
$result = $api->getLocations(array('clientId' => Mage::helper('temando')->getClientId()));
|
146 |
+
if (!$result) {
|
147 |
+
return 'Could not connect to the api';
|
148 |
+
}
|
149 |
+
} catch (Exception $e) {
|
150 |
+
return $e->getMessage();
|
151 |
+
}
|
152 |
+
|
153 |
+
return false;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* @return Temando_Temando_Model_Api_Client
|
158 |
+
*/
|
159 |
+
public function connect()
|
160 |
+
{
|
161 |
+
$api = Mage::getModel('temando/api_client');
|
162 |
+
switch ($this->getTemandoVersion()) {
|
163 |
+
case self::TMD_VERSION_BUSINESS:
|
164 |
+
$api = $api->connect($this->getTemandoProfile());
|
165 |
+
break;
|
166 |
+
default:
|
167 |
+
$api = $api->connect(
|
168 |
+
Mage::helper('temando')->getConfigData('general/username'),
|
169 |
+
Mage::helper('temando')->getConfigData('general/password'),
|
170 |
+
Mage::helper('temando')->getConfigData('general/sandbox')
|
171 |
+
);
|
172 |
+
break;
|
173 |
+
}
|
174 |
+
|
175 |
+
return $api;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Returns cheapest available quote for dummy order
|
180 |
+
*
|
181 |
+
* @return null|Temando_Temando_Model_Quote
|
182 |
+
*/
|
183 |
+
public function loadCheapestQuote()
|
184 |
+
{
|
185 |
+
//get first origin location
|
186 |
+
$origins = $this->getTemandoWarehouses();
|
187 |
+
foreach ($origins as $origin) {
|
188 |
+
continue;
|
189 |
+
}
|
190 |
+
|
191 |
+
if (!$origin) {
|
192 |
+
return null;
|
193 |
+
}
|
194 |
+
|
195 |
+
/** @var $origin Temando_Temando_Model_Warehouse */
|
196 |
+
$allowedCarriers = explode(',', Mage::getStoreConfig('carriers/temando/allowed_methods'));
|
197 |
+
$request = Mage::getModel('temando/api_request');
|
198 |
+
/** @var $request Temando_Temando_Model_Api_Request */
|
199 |
+
|
200 |
+
switch ($this->getTemandoVersion()) {
|
201 |
+
case self::TMD_VERSION_BUSINESS:
|
202 |
+
$request->setConnectionParams($origin->getTemandoProfile());
|
203 |
+
break;
|
204 |
+
default:
|
205 |
+
$request
|
206 |
+
->setUsername(Mage::helper('temando')->getConfigData('general/username'))
|
207 |
+
->setPassword(Mage::helper('temando')->getConfigData('general/password'))
|
208 |
+
->setSandbox(Mage::helper('temando')->getConfigData('general/sandbox'));
|
209 |
+
break;
|
210 |
+
}
|
211 |
+
|
212 |
+
$request
|
213 |
+
->setMagentoQuoteId(100000000 + mt_rand(0, 100000))
|
214 |
+
->setDestination(
|
215 |
+
'AU',
|
216 |
+
'2000',
|
217 |
+
'SYDNEY',
|
218 |
+
'123 Pitt Street'
|
219 |
+
)
|
220 |
+
|
221 |
+
->setOrigin($origin->getName())
|
222 |
+
->setItems($this->getTestBox())
|
223 |
+
->setReady()
|
224 |
+
->setAllowedCarriers($allowedCarriers);
|
225 |
+
|
226 |
+
$quotes = $request->getQuotes()->getItems();
|
227 |
+
return Mage::helper('temando/functions')->getCheapestQuote($quotes);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Creates a test box
|
232 |
+
* @return array
|
233 |
+
*/
|
234 |
+
public function getTestBox()
|
235 |
+
{
|
236 |
+
$box = Mage::getModel('temando/box');
|
237 |
+
/** @var $box Temando_Temando_Model_Box */
|
238 |
+
$box
|
239 |
+
->setComment('My Package')
|
240 |
+
->setQty('1')
|
241 |
+
->setValue('10')
|
242 |
+
->setLength('10')
|
243 |
+
->setWidth('10')
|
244 |
+
->setHeight('10')
|
245 |
+
->setMeasureUnit(Temando_Temando_Model_System_Config_Source_Unit_Measure::CENTIMETRES)
|
246 |
+
->setWeight('100')
|
247 |
+
->setWeightUnit(Temando_Temando_Model_System_Config_Source_Unit_Weight::GRAMS)
|
248 |
+
->setPackaging(Temando_Temando_Model_System_Config_Source_Shipment_Packaging::BOX);
|
249 |
+
/** ->setFragile($package['fragile'])
|
250 |
+
->setArticles($package['articles']); */
|
251 |
+
return array($box);
|
252 |
+
}
|
253 |
+
|
254 |
+
protected function getTemandoProfile()
|
255 |
+
{
|
256 |
+
return array(
|
257 |
+
'sandbox' => Mage::helper('temando')->getConfigData('general/sandbox'),
|
258 |
+
'clientid' => Mage::helper('temando')->getConfigData('general/client'),
|
259 |
+
'username' => Mage::helper('temando')->getConfigData('general/username'),
|
260 |
+
'password' => Mage::helper('temando')->getConfigData('general/password'),
|
261 |
+
'payment' => Mage::helper('temando')->getConfigData('general/payment_type'),
|
262 |
+
);
|
263 |
+
}
|
264 |
+
}
|
app/code/community/Temando/Installer/Model/Api/Rest/Client.php
CHANGED
@@ -1,121 +1,129 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Api Rest Client
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
* @method StdClass getLastResponse()
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
->setUri($this->_uri
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
Mage::
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
if (!$this->_uri) {
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
if (!$this->
|
100 |
-
Mage::logException(new Exception(__CLASS__.': missing
|
101 |
-
return false;
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Api Rest Client
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
* @method StdClass getLastResponse()
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Temando_Installer_Model_Api_Rest_Client
|
11 |
+
extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Auth token
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
protected $_token = null;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The HTTP Client
|
22 |
+
* @var Varien_Http_Client
|
23 |
+
*/
|
24 |
+
protected $_client = null;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Service Uri
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
protected $_uri = null;
|
31 |
+
|
32 |
+
|
33 |
+
public function _construct()
|
34 |
+
{
|
35 |
+
parent::_construct();
|
36 |
+
$this->_prepareClient();
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
public function getService($request, $jsonDecode = true)
|
41 |
+
{
|
42 |
+
if (!$this->_validate($request)) {
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
|
46 |
+
try {
|
47 |
+
if ($jsonDecode) {
|
48 |
+
$this->_client
|
49 |
+
->setHeaders(array('Authorization' => 'Bearer ' . $this->_token))
|
50 |
+
->setUri($this->_uri);
|
51 |
+
} else {
|
52 |
+
$this->_client
|
53 |
+
->setUri($this->_uri . '?access_token=' . $this->_token);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Getting response via raw body and decoding coz of a bug in Zend yielding
|
58 |
+
* exception when ->getBody() is used to decode and return response
|
59 |
+
*/
|
60 |
+
|
61 |
+
$rawBody = $this->_client->request(Varien_Http_Client::GET)->getRawBody();
|
62 |
+
|
63 |
+
if ($jsonDecode) {
|
64 |
+
$response = Mage::helper('core')->jsonDecode($rawBody, Zend_Json::TYPE_OBJECT);
|
65 |
+
} else {
|
66 |
+
$response = $rawBody;
|
67 |
+
}
|
68 |
+
|
69 |
+
if (!($this->_client->getLastResponse()->getStatus() == 200 && !empty($response))) {
|
70 |
+
//if not good, then log
|
71 |
+
Mage::logException(new Exception($this->_client->getLastResponse()));
|
72 |
+
Mage::log($this->_client->getLastRequest(), null, 'tmd-http-request.log', true);
|
73 |
+
Mage::log($this->_client->getLastResponse(), null, 'tmd-http-response.log', true);
|
74 |
+
}
|
75 |
+
|
76 |
+
return $response;
|
77 |
+
} catch (Exception $e) {
|
78 |
+
Mage::logException($e);
|
79 |
+
if (!$this->_sandbox) {
|
80 |
+
Mage::log($this->_client->getLastRequest(), null, 'tmd-http-request.log', true);
|
81 |
+
Mage::log($this->_client->getLastResponse(), null, 'tmd-http-response.log', true);
|
82 |
+
}
|
83 |
+
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Validate data before sending request
|
90 |
+
*
|
91 |
+
* @return boolean
|
92 |
+
*/
|
93 |
+
protected function _validate($request)
|
94 |
+
{
|
95 |
+
if (!$this->_uri) {
|
96 |
+
$this->_uri = $request['uri'];
|
97 |
+
}
|
98 |
+
|
99 |
+
if (!$this->_uri) {
|
100 |
+
Mage::logException(new Exception(__CLASS__.': missing request url.'));
|
101 |
+
return false;
|
102 |
+
}
|
103 |
+
|
104 |
+
if (!$this->_token) {
|
105 |
+
Mage::logException(new Exception(__CLASS__.': missing authorisation token.'));
|
106 |
+
return false;
|
107 |
+
}
|
108 |
+
|
109 |
+
return true;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Initializes http client to communicate with Temando REST Api
|
114 |
+
*
|
115 |
+
* @return \Temando_Installer_Model_Api_Rest_Client
|
116 |
+
*/
|
117 |
+
protected function _prepareClient()
|
118 |
+
{
|
119 |
+
if (!$this->_client) {
|
120 |
+
$this->_client = new Varien_Http_Client();
|
121 |
+
}
|
122 |
+
|
123 |
+
if (!$this->_token) {
|
124 |
+
$this->_token = Mage::helper('temandoinstaller')->getTemandoToken();
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
}
|
app/code/community/Temando/Installer/Model/Connect.php
CHANGED
@@ -1,140 +1,150 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Connect
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
protected $
|
12 |
-
protected $
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
*
|
19 |
-
*
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
$cmd
|
36 |
-
$cmd->
|
37 |
-
$cmd->
|
38 |
-
$
|
39 |
-
$
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
$cmd
|
64 |
-
$
|
65 |
-
$
|
66 |
-
$
|
67 |
-
$
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
if (!$this->
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
}
|
135 |
-
|
136 |
-
if (!$this->
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Connect
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Model_Connect extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
protected $_config;
|
12 |
+
protected $_sconfig;
|
13 |
+
protected $_frontend;
|
14 |
+
|
15 |
+
const DEFAULT_DOWNLOADER_PATH = "downloader";
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Default single config filename
|
19 |
+
*
|
20 |
+
* 'cache.cfg'
|
21 |
+
*/
|
22 |
+
const DEFAULT_SCONFIG_FILENAME = 'cache.cfg';
|
23 |
+
|
24 |
+
public function _construct()
|
25 |
+
{
|
26 |
+
parent::_construct();
|
27 |
+
$this->initialize();
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
public function install($file)
|
32 |
+
{
|
33 |
+
try {
|
34 |
+
Mage_Connect_Command::getCommands();
|
35 |
+
$cmd = Mage_Connect_Command::getInstance('install-file');
|
36 |
+
$cmd->setSconfig($this->_sconfig);
|
37 |
+
$cmd->setConfigObject($this->_config);
|
38 |
+
$cmd->setFrontendObject($this->_frontend);
|
39 |
+
$params = array($file);
|
40 |
+
$cmd->run('install-file', array(), $params);
|
41 |
+
} catch (Exception $ex) {
|
42 |
+
Mage::register('temandoinstaller_errors', array('There was an error installing'));
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
|
46 |
+
if ($cmd->ui()->hasErrors()) {
|
47 |
+
$errors = array();
|
48 |
+
foreach ($cmd->ui()->getErrors() as $error) {
|
49 |
+
$errors[] = $error[1];
|
50 |
+
}
|
51 |
+
|
52 |
+
Mage::register('temandoinstaller_errors', $errors);
|
53 |
+
return false;
|
54 |
+
}
|
55 |
+
|
56 |
+
return true;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function uninstall($module)
|
60 |
+
{
|
61 |
+
try {
|
62 |
+
Mage_Connect_Command::getCommands();
|
63 |
+
$cmd = Mage_Connect_Command::getInstance('uninstall');
|
64 |
+
$cmd->setSconfig($this->_sconfig);
|
65 |
+
$cmd->setConfigObject($this->_config);
|
66 |
+
$cmd->setFrontendObject($this->_frontend);
|
67 |
+
$package = $this->_sconfig->getPackageObject('community', $module);
|
68 |
+
$contents = $package->getContents();
|
69 |
+
$params = array('community', $module);
|
70 |
+
$cmd->run('uninstall', array(), $params);
|
71 |
+
} catch (Exception $ex) {
|
72 |
+
Mage::register('temandoinstaller_errors', array('There was an error uninstalling'));
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
|
76 |
+
if ($cmd->ui()->hasErrors()) {
|
77 |
+
$errors = array();
|
78 |
+
foreach ($cmd->ui()->getErrors() as $error) {
|
79 |
+
$errors[] = $error[1];
|
80 |
+
}
|
81 |
+
|
82 |
+
Mage::register('temandoinstaller_errors', $errors);
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
|
86 |
+
//clean the directories
|
87 |
+
$targetPath = rtrim($this->_config->magento_root, "\\/");
|
88 |
+
// @codingStandardsIgnoreStart
|
89 |
+
foreach ($contents as $file) {
|
90 |
+
$fileName = basename($file);
|
91 |
+
$filePath = dirname($file);
|
92 |
+
$dest = $targetPath . DIRECTORY_SEPARATOR . $filePath . DIRECTORY_SEPARATOR . $fileName;
|
93 |
+
$this->removeEmptyDirectory(dirname($dest));
|
94 |
+
}
|
95 |
+
// @codingStandardsIgnoreEnd
|
96 |
+
return true;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Return the single config class
|
101 |
+
* @return Mage_Connect_Singleconfig
|
102 |
+
*/
|
103 |
+
public function getSingleConfig()
|
104 |
+
{
|
105 |
+
return $this->_sconfig;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Remove empty directories recursively up
|
110 |
+
*
|
111 |
+
* @param string $dir
|
112 |
+
* @param Mage_Connect_Ftp $ftp
|
113 |
+
*/
|
114 |
+
protected function removeEmptyDirectory($dir)
|
115 |
+
{
|
116 |
+
try {
|
117 |
+
// @codingStandardsIgnoreStart
|
118 |
+
if (@rmdir($dir)) {
|
119 |
+
$this->removeEmptyDirectory(dirname($dir));
|
120 |
+
}// @codingStandardsIgnoreEnd
|
121 |
+
} catch (Exception $ex) {
|
122 |
+
return false;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
protected function initialize()
|
127 |
+
{
|
128 |
+
if (!$this->_config) {
|
129 |
+
// @codingStandardsIgnoreStart
|
130 |
+
$this->_config = new Mage_Connect_Config();
|
131 |
+
// @codingStandardsIgnoreEnd
|
132 |
+
$this->_config->magento_root = Mage::getBaseDir() .
|
133 |
+
DIRECTORY_SEPARATOR.self::DEFAULT_DOWNLOADER_PATH . DIRECTORY_SEPARATOR.'..';
|
134 |
+
}
|
135 |
+
|
136 |
+
if (!$this->_sconfig) {
|
137 |
+
// @codingStandardsIgnoreStart
|
138 |
+
$this->_sconfig = new Mage_Connect_Singleconfig(
|
139 |
+
Mage::getBaseDir() . DIRECTORY_SEPARATOR .
|
140 |
+
self::DEFAULT_DOWNLOADER_PATH . DIRECTORY_SEPARATOR .
|
141 |
+
self::DEFAULT_SCONFIG_FILENAME
|
142 |
+
);
|
143 |
+
}
|
144 |
+
|
145 |
+
if (!$this->_frontend) {
|
146 |
+
$this->_frontend = new Mage_Connect_Frontend();
|
147 |
+
}
|
148 |
+
// @codingStandardsIgnoreEnd
|
149 |
+
}
|
150 |
+
}
|
app/code/community/Temando/Installer/Model/Cron.php
CHANGED
@@ -1,62 +1,69 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Cron
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*
|
8 |
-
* Cron job currently for checking updates on the main Temando module
|
9 |
-
*/
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
$
|
45 |
-
$
|
46 |
-
$installerModules
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cron
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*
|
8 |
+
* Cron job currently for checking updates on the main Temando module
|
9 |
+
*/
|
10 |
+
|
11 |
+
class Temando_Installer_Model_Cron extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
protected $_helper;
|
14 |
+
|
15 |
+
public function _construct()
|
16 |
+
{
|
17 |
+
parent::_construct();
|
18 |
+
$this->initialize();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function checkReleases()
|
22 |
+
{
|
23 |
+
$module = Temando_Installer_Helper_Data::TMD_MODULE_NAME;
|
24 |
+
$installer = Mage::getModel('temandoinstaller/installer');
|
25 |
+
/** @var $installer Temando_Installer_Model_Installer */
|
26 |
+
|
27 |
+
//check token
|
28 |
+
$currentService = $installer->getCurrentService();
|
29 |
+
if (!$currentService) {
|
30 |
+
return;
|
31 |
+
}
|
32 |
+
|
33 |
+
//check the latest release
|
34 |
+
if (!isset($currentService->links->software_latest_release->version)) {
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
//compare the current version
|
39 |
+
if ($this->_helper->getTemandoVersionNumber() >= $currentService->links->software_latest_release->version) {
|
40 |
+
//if the release version isn't higher than the current version return as there is no update available
|
41 |
+
return;
|
42 |
+
}
|
43 |
+
|
44 |
+
$versionNumber = $currentService->links->software_latest_release->version;
|
45 |
+
$updateDetails = 'Temando v' . $versionNumber . ' is available.';
|
46 |
+
$installerModules = Mage::getModel('temandoinstaller/installer')->getCollection();
|
47 |
+
$installerModules->addFieldToFilter('module', $module);
|
48 |
+
$installerModules->addFieldToFilter('update_available', false);
|
49 |
+
$installerModules->addFieldToFilter('update_dismissed', false);
|
50 |
+
foreach ($installerModules as $module) {
|
51 |
+
$this->_saveInstaller($installer);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
protected function _saveInstaller($installerModel)
|
56 |
+
{
|
57 |
+
/** @var $installer Temando_Installer_Model_Installer */
|
58 |
+
$installerModel
|
59 |
+
->setUpdateAvailable(true)
|
60 |
+
->setUpdateDetails($updateDetails)
|
61 |
+
->save();
|
62 |
+
}
|
63 |
+
protected function initialize()
|
64 |
+
{
|
65 |
+
if (!$this->_helper) {
|
66 |
+
$this->_helper = Mage::helper('temandoinstaller');
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
app/code/community/Temando/Installer/Model/Installer.php
CHANGED
@@ -1,210 +1,225 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Installer
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
*
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
$request
|
26 |
-
$
|
27 |
-
|
28 |
-
$
|
29 |
-
|
30 |
-
$
|
31 |
-
$
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
return false;
|
82 |
-
}
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
$
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
$
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
$serviceResponse
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Installer
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Model_Installer extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
const TEMANDO_FINANCE_API = 'https://finance.temando.com/api/v1/user/subscriptions';
|
12 |
+
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('temandoinstaller/installer');
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Gets the highest available service and returns it
|
21 |
+
* @return boolean|object
|
22 |
+
*/
|
23 |
+
public function getCurrentService()
|
24 |
+
{
|
25 |
+
$request = array();
|
26 |
+
$request['uri'] = self::TEMANDO_FINANCE_API;
|
27 |
+
$helper = Mage::helper('temandoinstaller');
|
28 |
+
/** @var $helper Temando_Installer_Helper_Data */
|
29 |
+
$api = Mage::getModel('temandoinstaller/api_rest_client');
|
30 |
+
/** @var $api Temando_Installer_Model_Api_Rest_Client */
|
31 |
+
$versions = $helper->getVersions();
|
32 |
+
$response = $api->getService($request);
|
33 |
+
if (!isset($response->subscriptions)) {
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
|
37 |
+
$services = array();
|
38 |
+
foreach ($response->subscriptions as $subscription) {
|
39 |
+
if (!isset($subscription->links->service->href)) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
+
if (!$subscription->active) {
|
44 |
+
continue;
|
45 |
+
}
|
46 |
+
|
47 |
+
//collect available services
|
48 |
+
$services[] = $this->getService($subscription->links->service->href);
|
49 |
+
}
|
50 |
+
|
51 |
+
$currentService = null;
|
52 |
+
foreach ($versions as $version) {
|
53 |
+
foreach ($services as $service) {
|
54 |
+
if (substr($service->slug, 0, -3) == $version) {
|
55 |
+
$currentService = $service;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
return $currentService;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Downloads the package
|
65 |
+
* @param object $service
|
66 |
+
* @return string|boolean
|
67 |
+
*/
|
68 |
+
public function downloadPackage($service)
|
69 |
+
{
|
70 |
+
if (!isset($service->links->software_latest_release->href)) {
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
$rawUrl = $this->getLatestRelease($service->links->software_latest_release->href)->raw_url;
|
75 |
+
if (!isset($rawUrl)) {
|
76 |
+
return false;
|
77 |
+
}
|
78 |
+
|
79 |
+
$package = $this->getPackage($rawUrl);
|
80 |
+
if (!$package) {
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
|
84 |
+
$file = 'Temando_Temando.tgz';
|
85 |
+
$fileTemp = Mage::getBaseDir() . DS . "var/" . uniqid() . $file;
|
86 |
+
// @codingStandardsIgnoreStart
|
87 |
+
if (!file_put_contents($fileTemp, $package)) {
|
88 |
+
// @codingStandardsIgnoreEnd
|
89 |
+
//there is an error saving the file on disk
|
90 |
+
return false;
|
91 |
+
} else {
|
92 |
+
//everything is awesome
|
93 |
+
return $fileTemp;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Gets the package
|
99 |
+
* @param string $uri
|
100 |
+
*/
|
101 |
+
public function getPackage($uri)
|
102 |
+
{
|
103 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
104 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
105 |
+
$packageRequest = array();
|
106 |
+
$packageRequest['uri'] = $uri;
|
107 |
+
$packageResponse = $serviceApi->getService($packageRequest, false);
|
108 |
+
//validate the download here
|
109 |
+
return $packageResponse;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Gets the service object
|
114 |
+
* @param string $uri
|
115 |
+
* @return object
|
116 |
+
*/
|
117 |
+
public function getService($uri)
|
118 |
+
{
|
119 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
120 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
121 |
+
$serviceRequest = array();
|
122 |
+
$serviceRequest['uri'] = $uri;
|
123 |
+
$serviceResponse = $serviceApi->getService($serviceRequest);
|
124 |
+
if (!isset($serviceResponse->services)) {
|
125 |
+
return;
|
126 |
+
}
|
127 |
+
|
128 |
+
return $serviceResponse->services;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Returns the product object
|
133 |
+
* @param string $uri
|
134 |
+
* @return object
|
135 |
+
*/
|
136 |
+
public function getProduct($uri)
|
137 |
+
{
|
138 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
139 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
140 |
+
$productRequest = array();
|
141 |
+
$productRequest['uri'] = $uri;
|
142 |
+
$productResponse = $serviceApi->getService($productRequest);
|
143 |
+
if (!isset($productResponse->softwares->software)) {
|
144 |
+
return;
|
145 |
+
}
|
146 |
+
|
147 |
+
return $productResponse->softwares->software;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Returns the latest release object
|
152 |
+
* @param string $uri
|
153 |
+
* @return object
|
154 |
+
*/
|
155 |
+
public function getLatestRelease($uri)
|
156 |
+
{
|
157 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
158 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
159 |
+
$releaseRequest = array();
|
160 |
+
$releaseRequest['uri'] = $uri;
|
161 |
+
$releaseResponse = $serviceApi->getService($releaseRequest);
|
162 |
+
if (!isset($releaseResponse->release)) {
|
163 |
+
return;
|
164 |
+
}
|
165 |
+
|
166 |
+
return $releaseResponse->release;
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Returns the service slug name
|
171 |
+
* @param string $uri
|
172 |
+
* @return string
|
173 |
+
*/
|
174 |
+
public function getServiceSlug($uri)
|
175 |
+
{
|
176 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
177 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
178 |
+
$serviceRequest = array();
|
179 |
+
$serviceRequest['uri'] = $uri;
|
180 |
+
$serviceResponse = $serviceApi->getService($serviceRequest);
|
181 |
+
if (!isset($serviceResponse->services->slug)) {
|
182 |
+
return;
|
183 |
+
}
|
184 |
+
|
185 |
+
return $serviceResponse->services->slug;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Gets the latest version of the service
|
190 |
+
* @param string $uri
|
191 |
+
* @return string
|
192 |
+
*/
|
193 |
+
public function getServiceLatestVersion($uri)
|
194 |
+
{
|
195 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
196 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
197 |
+
$serviceRequest = array();
|
198 |
+
$serviceRequest['uri'] = $uri;
|
199 |
+
$serviceResponse = $serviceApi->getService($serviceRequest);
|
200 |
+
if (!isset($serviceResponse->services->links->software_latest_release->version)) {
|
201 |
+
return;
|
202 |
+
}
|
203 |
+
|
204 |
+
return $serviceResponse->services->links->software_latest_release->version;
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Returns the latest version uri
|
209 |
+
* @param string $uri
|
210 |
+
* @return string
|
211 |
+
*/
|
212 |
+
public function getServiceLatestVersionUri($uri)
|
213 |
+
{
|
214 |
+
$serviceApi = Mage::getModel('temandoinstaller/api_rest_client');
|
215 |
+
/** @var $serviceApi Temando_Installer_Model_Api_Rest_Client */
|
216 |
+
$serviceRequest = array();
|
217 |
+
$serviceRequest['uri'] = $uri;
|
218 |
+
$serviceResponse = $serviceApi->getService($serviceRequest);
|
219 |
+
if (!isset($serviceResponse->services->links->software_latest_release->href)) {
|
220 |
+
return;
|
221 |
+
}
|
222 |
+
|
223 |
+
return $serviceResponse->services->links->software_latest_release->href;
|
224 |
+
}
|
225 |
+
}
|
app/code/community/Temando/Installer/Model/{Mysql4 → Resource}/Installer.php
RENAMED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Mysql4 Installer
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
class
|
9 |
-
{
|
10 |
-
public function _construct()
|
11 |
-
{
|
12 |
-
$this->_init('temandoinstaller/installer', 'id');
|
13 |
-
}
|
14 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Mysql4 Installer
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
class Temando_Installer_Model_Resource_Installer extends Mage_Core_Model_Resource_Db_Abstract
|
9 |
+
{
|
10 |
+
public function _construct()
|
11 |
+
{
|
12 |
+
$this->_init('temandoinstaller/installer', 'id');
|
13 |
+
}
|
14 |
+
}
|
app/code/community/Temando/Installer/Model/{Mysql4 → Resource}/Installer/Collection.php
RENAMED
@@ -1,16 +1,16 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Mysql4 Installer Collection
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Mysql4 Installer Collection
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Model_Resource_Installer_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
10 |
+
{
|
11 |
+
public function _construct()
|
12 |
+
{
|
13 |
+
parent::_construct();
|
14 |
+
$this->_init('temandoinstaller/installer');
|
15 |
+
}
|
16 |
+
}
|
app/code/community/Temando/Installer/Model/Tester.php
CHANGED
@@ -1,122 +1,130 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Tester
|
4 |
-
*
|
5 |
-
* @package Temando_Installer
|
6 |
-
* @author Temando Magento Team <marketing@temando.com>
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
$
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
)
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
)
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
}
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Tester
|
4 |
+
*
|
5 |
+
* @package Temando_Installer
|
6 |
+
* @author Temando Magento Team <marketing@temando.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Temando_Installer_Model_Tester extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
protected $_helper;
|
12 |
+
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->initialize();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function testSettings()
|
20 |
+
{
|
21 |
+
$tables = $this->checkTemandoSchema();
|
22 |
+
$details = $this->testClientDetails();
|
23 |
+
|
24 |
+
if (!$tables || !$details) {
|
25 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
26 |
+
Mage::helper('temandoinstaller')->__('Could not complete get quotes test.')
|
27 |
+
);
|
28 |
+
} else {
|
29 |
+
$quotes = $this->testGetQuotes();
|
30 |
+
}
|
31 |
+
|
32 |
+
/** return; */
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function testGetQuotes()
|
36 |
+
{
|
37 |
+
try {
|
38 |
+
$result = $this->_helper->loadCheapestQuote();
|
39 |
+
if ($result) {
|
40 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
41 |
+
Mage::helper('temandoinstaller')->__('Cheapest quote: %s', $result->getDescription())
|
42 |
+
);
|
43 |
+
}
|
44 |
+
} catch (Exception $e) {
|
45 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
46 |
+
Mage::helper('temandoinstaller')->__('Error connecting to the api: %s', $e->getMessage())
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
/** return; */
|
51 |
+
}
|
52 |
+
|
53 |
+
public function testClientDetails()
|
54 |
+
{
|
55 |
+
$result = $this->_helper->testAccountDetails();
|
56 |
+
if (!$result) {
|
57 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
58 |
+
Mage::helper('temandoinstaller')->__('API Connection successful!')
|
59 |
+
);
|
60 |
+
return true;
|
61 |
+
} else {
|
62 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
63 |
+
Mage::helper('temandoinstaller')->__('Error connecting to the api: %s', $result)
|
64 |
+
);
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
public function checkTemandoSchema()
|
70 |
+
{
|
71 |
+
$tableError = 0;
|
72 |
+
if (!$this->checkTemandoWarehouse()) {
|
73 |
+
Mage::getSingleton('adminhtml/session')->addNotice(
|
74 |
+
Mage::helper('temandoinstaller')->__('Please add a warehouse to locations.')
|
75 |
+
);
|
76 |
+
$tableError++;
|
77 |
+
} else {
|
78 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
79 |
+
Mage::helper('temandoinstaller')->__('Warehouses: %s', $this->checkTemandoWarehouse())
|
80 |
+
);
|
81 |
+
}
|
82 |
+
|
83 |
+
if (!$this->checkTemandoRule()) {
|
84 |
+
Mage::getSingleton('adminhtml/session')->addNotice(
|
85 |
+
Mage::helper('temandoinstaller')->__('Please add a rule to the rule engine.')
|
86 |
+
);
|
87 |
+
$tableError++;
|
88 |
+
} else {
|
89 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
90 |
+
Mage::helper('temandoinstaller')->__('Rules: %s', $this->checkTemandoRule())
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
if ($tableError == 0) {
|
95 |
+
return true;
|
96 |
+
} else {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
public function checkTemandoWarehouse()
|
102 |
+
{
|
103 |
+
$warehouses = 0;
|
104 |
+
$warehouseCollection = $this->_helper->getTemandoWarehouses();
|
105 |
+
foreach ($warehouseCollection as $warehouse) {
|
106 |
+
$warehouses++;
|
107 |
+
}
|
108 |
+
|
109 |
+
return $warehouses;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function checkTemandoRule()
|
113 |
+
{
|
114 |
+
$rules = 0;
|
115 |
+
$ruleCollection = $this->_helper->getTemandoRules();
|
116 |
+
foreach ($ruleCollection as $rule) {
|
117 |
+
$rules++;
|
118 |
+
}
|
119 |
+
|
120 |
+
return $rules;
|
121 |
+
}
|
122 |
+
|
123 |
+
protected function initialize()
|
124 |
+
{
|
125 |
+
if (!$this->_helper) {
|
126 |
+
$this->_helper = Mage::helper('temandoinstaller');
|
127 |
+
}
|
128 |
+
|
129 |
+
}
|
130 |
+
}
|
app/code/community/Temando/Installer/controllers/Adminhtml/Temandoinstaller/InstallerController.php
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
* @package Temando_Installer
|
6 |
* @author Temando Magento Team <marketing@temando.com>
|
7 |
*/
|
|
|
8 |
class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends Mage_Adminhtml_Controller_Action
|
9 |
{
|
10 |
// @codingStandardsIgnoreStart
|
@@ -14,6 +15,17 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
14 |
const NOTICE_ATTRIBUTES = 'Note: if upgrading from the Starter Extension to a Business Extension, please re-index your products.';
|
15 |
// @codingStandardsIgnoreEnd
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
public function indexAction()
|
18 |
{
|
19 |
$communityChannel = Mage::getModel('temandoinstaller/connect')->getSingleConfig()->isChannel('community');
|
@@ -22,6 +34,7 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
22 |
Mage::helper('temandoinstaller')->__(self::NOTICE_NO_COMMUNITY)
|
23 |
);
|
24 |
}
|
|
|
25 |
if ($this->checkSoap()) {
|
26 |
Mage::getSingleton('adminhtml/session')->addError(
|
27 |
Mage::helper('temandoinstaller')->__(self::ERR_NO_SOAP)
|
@@ -47,11 +60,11 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
47 |
|
48 |
public function installAction()
|
49 |
{
|
|
|
50 |
$helper = Mage::helper('temandoinstaller');
|
51 |
-
/* @var $helper Temando_Installer_Helper_Data */
|
52 |
|
|
|
53 |
$installer = Mage::getModel('temandoinstaller/installer');
|
54 |
-
/* @var $installer Temando_Installer_Model_Installer */
|
55 |
|
56 |
if ($helper->getTemandoVersion()) {
|
57 |
Mage::getSingleton('adminhtml/session')->addError(
|
@@ -70,6 +83,7 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
70 |
$this->_redirect('*/*/');
|
71 |
return;
|
72 |
}
|
|
|
73 |
//check the latest release
|
74 |
if (!isset($currentService->links->software_latest_release->version)) {
|
75 |
Mage::getSingleton('adminhtml/session')->addError(
|
@@ -99,8 +113,8 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
99 |
->setToken($helper->getTemandoToken())
|
100 |
->setVersion($currentService->links->software_latest_release->version)
|
101 |
->setModule(Temando_Installer_Helper_Data::TMD_MODULE_NAME)
|
102 |
-
->setInstallDate(
|
103 |
-
->setUpdateDate(
|
104 |
->setUpdateAvailable(false)
|
105 |
->setUpdateDismissed(false)
|
106 |
->setUpdateDetails(null)
|
@@ -109,7 +123,9 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
109 |
}
|
110 |
|
111 |
//delete file
|
|
|
112 |
@unlink($file);
|
|
|
113 |
|
114 |
if (Mage::registry('temandoinstaller_errors')) {
|
115 |
foreach (Mage::registry('temandoinstaller_errors') as $error) {
|
@@ -122,16 +138,16 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
122 |
}
|
123 |
|
124 |
$this->_redirect('*/*/');
|
125 |
-
return;
|
126 |
}
|
127 |
|
128 |
public function updateAction()
|
129 |
{
|
130 |
$helper = Mage::helper('temandoinstaller');
|
131 |
-
|
132 |
|
133 |
$installer = Mage::getModel('temandoinstaller/installer');
|
134 |
-
|
135 |
|
136 |
$params = $this->getRequest()->getParams();
|
137 |
if (!isset($params['massaction']) || !is_array($params['massaction']) || empty($params['massaction'])) {
|
@@ -151,6 +167,7 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
151 |
$this->_redirect('*/*/');
|
152 |
return;
|
153 |
}
|
|
|
154 |
//check the latest release
|
155 |
if (!isset($currentService->links->software_latest_release->version)) {
|
156 |
Mage::getSingleton('adminhtml/session')->addError(
|
@@ -159,8 +176,13 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
159 |
$this->_redirect('*/*/');
|
160 |
return;
|
161 |
}
|
|
|
162 |
//compare the current version
|
163 |
-
|
|
|
|
|
|
|
|
|
164 |
Mage::getSingleton('adminhtml/session')->addError(
|
165 |
Mage::helper('temandoinstaller')->__('Current version is greater than or equal to the latest release.')
|
166 |
);
|
@@ -172,46 +194,7 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
172 |
|
173 |
//at the moment only one product will be on the grid - the mass action has been added for future use
|
174 |
foreach ($installerIds as $id) {
|
175 |
-
|
176 |
-
$file = $installer->downloadPackage($currentService);
|
177 |
-
|
178 |
-
if (!$file) {
|
179 |
-
Mage::getSingleton('adminhtml/session')->addError(
|
180 |
-
Mage::helper('temandoinstaller')->__('Error downloading file.')
|
181 |
-
);
|
182 |
-
$this->_redirect('*/*/');
|
183 |
-
return;
|
184 |
-
}
|
185 |
-
|
186 |
-
$installer->load($id);
|
187 |
-
$command = Mage::getModel('temandoinstaller/connect');
|
188 |
-
if (!$command->uninstall($installer->getModule())) {
|
189 |
-
Mage::getSingleton('adminhtml/session')->addError(
|
190 |
-
Mage::helper('temandoinstaller')->__('There was an error uninstalling the current module.')
|
191 |
-
);
|
192 |
-
$this->_redirect('*/*/');
|
193 |
-
return;
|
194 |
-
}
|
195 |
-
//clean cache before installing new module
|
196 |
-
Mage::app()->cleanCache(array('CONFIG'));
|
197 |
-
if ($command->install($file)) {
|
198 |
-
//clean the cache after installing new module
|
199 |
-
Mage::app()->cleanCache(array('CONFIG'));
|
200 |
-
$installer
|
201 |
-
->setName('Temando')
|
202 |
-
->setToken($helper->getTemandoToken())
|
203 |
-
->setVersion($currentService->links->software_latest_release->version)
|
204 |
-
->setModule(Temando_Installer_Helper_Data::TMD_MODULE_NAME)
|
205 |
-
->setUpdateDate(date('Y-m-d H:i:s'))
|
206 |
-
->setUpdateAvailable(false)
|
207 |
-
->setUpdateDismissed(false)
|
208 |
-
->setUpdateDetails(null)
|
209 |
-
->setStatus(1)
|
210 |
-
->save();
|
211 |
-
}
|
212 |
-
|
213 |
-
//delete file
|
214 |
-
@unlink($file);
|
215 |
}
|
216 |
|
217 |
if (Mage::registry('temandoinstaller_errors')) {
|
@@ -223,13 +206,60 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
223 |
Mage::helper('temandoinstaller')->__('Package successfully updated.')
|
224 |
);
|
225 |
}
|
|
|
226 |
$this->_redirect('*/*/');
|
227 |
}
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
public function uninstallAction()
|
230 |
{
|
231 |
$helper = Mage::helper('temandoinstaller');
|
232 |
-
|
233 |
|
234 |
$params = $this->getRequest()->getParams();
|
235 |
if (!isset($params['massaction']) || !is_array($params['massaction']) ||
|
@@ -245,11 +275,7 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
245 |
$installerIds = $params['massaction'];
|
246 |
|
247 |
foreach ($installerIds as $id) {
|
248 |
-
$
|
249 |
-
$command = Mage::getModel('temandoinstaller/connect');
|
250 |
-
if ($command->uninstall($installer->getModule())) {
|
251 |
-
$installer->delete();
|
252 |
-
}
|
253 |
}
|
254 |
|
255 |
if (Mage::registry('temandoinstaller_errors')) {
|
@@ -264,7 +290,16 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
264 |
|
265 |
Mage::app()->cleanCache(array('CONFIG'));
|
266 |
$this->_redirect('*/*/');
|
267 |
-
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
}
|
269 |
|
270 |
public function testConnectionSettingsAction()
|
@@ -275,9 +310,9 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
275 |
|
276 |
public function dismissUpdateAction()
|
277 |
{
|
278 |
-
$
|
279 |
-
$module = Mage::getModel('temandoinstaller/installer')->load($
|
280 |
-
|
281 |
|
282 |
if (!$module->getId()) {
|
283 |
Mage::getSingleton('adminhtml/session')->addError(
|
@@ -291,6 +326,7 @@ class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends M
|
|
291 |
Mage::helper('temandoinstaller')->__('Temando update has been dismissed.')
|
292 |
);
|
293 |
}
|
|
|
294 |
return $this->getResponse()->setRedirect($this->getRequest()->getServer('HTTP_REFERER'));
|
295 |
}
|
296 |
|
5 |
* @package Temando_Installer
|
6 |
* @author Temando Magento Team <marketing@temando.com>
|
7 |
*/
|
8 |
+
|
9 |
class Temando_Installer_Adminhtml_Temandoinstaller_InstallerController extends Mage_Adminhtml_Controller_Action
|
10 |
{
|
11 |
// @codingStandardsIgnoreStart
|
15 |
const NOTICE_ATTRIBUTES = 'Note: if upgrading from the Starter Extension to a Business Extension, please re-index your products.';
|
16 |
// @codingStandardsIgnoreEnd
|
17 |
|
18 |
+
/**
|
19 |
+
* Check admin permissions for this controller
|
20 |
+
*
|
21 |
+
* @return boolean
|
22 |
+
*/
|
23 |
+
protected function _isAllowed()
|
24 |
+
{
|
25 |
+
return Mage::getSingleton('admin/session')
|
26 |
+
->isAllowed('temando');
|
27 |
+
}
|
28 |
+
|
29 |
public function indexAction()
|
30 |
{
|
31 |
$communityChannel = Mage::getModel('temandoinstaller/connect')->getSingleConfig()->isChannel('community');
|
34 |
Mage::helper('temandoinstaller')->__(self::NOTICE_NO_COMMUNITY)
|
35 |
);
|
36 |
}
|
37 |
+
|
38 |
if ($this->checkSoap()) {
|
39 |
Mage::getSingleton('adminhtml/session')->addError(
|
40 |
Mage::helper('temandoinstaller')->__(self::ERR_NO_SOAP)
|
60 |
|
61 |
public function installAction()
|
62 |
{
|
63 |
+
/** @var $helper Temando_Installer_Helper_Data */
|
64 |
$helper = Mage::helper('temandoinstaller');
|
|
|
65 |
|
66 |
+
/** @var $installer Temando_Installer_Model_Installer */
|
67 |
$installer = Mage::getModel('temandoinstaller/installer');
|
|
|
68 |
|
69 |
if ($helper->getTemandoVersion()) {
|
70 |
Mage::getSingleton('adminhtml/session')->addError(
|
83 |
$this->_redirect('*/*/');
|
84 |
return;
|
85 |
}
|
86 |
+
|
87 |
//check the latest release
|
88 |
if (!isset($currentService->links->software_latest_release->version)) {
|
89 |
Mage::getSingleton('adminhtml/session')->addError(
|
113 |
->setToken($helper->getTemandoToken())
|
114 |
->setVersion($currentService->links->software_latest_release->version)
|
115 |
->setModule(Temando_Installer_Helper_Data::TMD_MODULE_NAME)
|
116 |
+
->setInstallDate(Mage::getSingleton('core/date')->gmtDate())
|
117 |
+
->setUpdateDate(Mage::getSingleton('core/date')->gmtDate())
|
118 |
->setUpdateAvailable(false)
|
119 |
->setUpdateDismissed(false)
|
120 |
->setUpdateDetails(null)
|
123 |
}
|
124 |
|
125 |
//delete file
|
126 |
+
// @codingStandardsIgnoreStart
|
127 |
@unlink($file);
|
128 |
+
// @codingStandardsIgnoreEnd
|
129 |
|
130 |
if (Mage::registry('temandoinstaller_errors')) {
|
131 |
foreach (Mage::registry('temandoinstaller_errors') as $error) {
|
138 |
}
|
139 |
|
140 |
$this->_redirect('*/*/');
|
141 |
+
/** return; */
|
142 |
}
|
143 |
|
144 |
public function updateAction()
|
145 |
{
|
146 |
$helper = Mage::helper('temandoinstaller');
|
147 |
+
/** @var $helper Temando_Installer_Helper_Data */
|
148 |
|
149 |
$installer = Mage::getModel('temandoinstaller/installer');
|
150 |
+
/** @var $installer Temando_Installer_Model_Installer */
|
151 |
|
152 |
$params = $this->getRequest()->getParams();
|
153 |
if (!isset($params['massaction']) || !is_array($params['massaction']) || empty($params['massaction'])) {
|
167 |
$this->_redirect('*/*/');
|
168 |
return;
|
169 |
}
|
170 |
+
|
171 |
//check the latest release
|
172 |
if (!isset($currentService->links->software_latest_release->version)) {
|
173 |
Mage::getSingleton('adminhtml/session')->addError(
|
176 |
$this->_redirect('*/*/');
|
177 |
return;
|
178 |
}
|
179 |
+
|
180 |
//compare the current version
|
181 |
+
$versionCompare = version_compare(
|
182 |
+
$helper->getTemandoVersionNumber(),
|
183 |
+
$currentService->links->software_latest_release->version
|
184 |
+
);
|
185 |
+
if ($versionCompare > 0) {
|
186 |
Mage::getSingleton('adminhtml/session')->addError(
|
187 |
Mage::helper('temandoinstaller')->__('Current version is greater than or equal to the latest release.')
|
188 |
);
|
194 |
|
195 |
//at the moment only one product will be on the grid - the mass action has been added for future use
|
196 |
foreach ($installerIds as $id) {
|
197 |
+
$this->_installPackage($installer, $id, $currentService, $helper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
}
|
199 |
|
200 |
if (Mage::registry('temandoinstaller_errors')) {
|
206 |
Mage::helper('temandoinstaller')->__('Package successfully updated.')
|
207 |
);
|
208 |
}
|
209 |
+
|
210 |
$this->_redirect('*/*/');
|
211 |
}
|
212 |
|
213 |
+
protected function _installPackage($installer, $installerId, $currentService, $helper)
|
214 |
+
{
|
215 |
+
//check file
|
216 |
+
$file = $installer->downloadPackage($currentService);
|
217 |
+
|
218 |
+
if (!$file) {
|
219 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
220 |
+
Mage::helper('temandoinstaller')->__('Error downloading file.')
|
221 |
+
);
|
222 |
+
$this->_redirect('*/*/');
|
223 |
+
return;
|
224 |
+
}
|
225 |
+
|
226 |
+
$installer->load($installerId);
|
227 |
+
$command = Mage::getModel('temandoinstaller/connect');
|
228 |
+
if (!$command->uninstall($installer->getModule())) {
|
229 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
230 |
+
Mage::helper('temandoinstaller')->__('There was an error uninstalling the current module.')
|
231 |
+
);
|
232 |
+
$this->_redirect('*/*/');
|
233 |
+
return;
|
234 |
+
}
|
235 |
+
|
236 |
+
//clean cache before installing new module
|
237 |
+
Mage::app()->cleanCache(array('CONFIG'));
|
238 |
+
if ($command->install($file)) {
|
239 |
+
//clean the cache after installing new module
|
240 |
+
Mage::app()->cleanCache(array('CONFIG'));
|
241 |
+
$installer
|
242 |
+
->setName('Temando')
|
243 |
+
->setToken($helper->getTemandoToken())
|
244 |
+
->setVersion($currentService->links->software_latest_release->version)
|
245 |
+
->setModule(Temando_Installer_Helper_Data::TMD_MODULE_NAME)
|
246 |
+
->setUpdateDate(Mage::getSingleton('core/date')->gmtDate())
|
247 |
+
->setUpdateAvailable(false)
|
248 |
+
->setUpdateDismissed(false)
|
249 |
+
->setUpdateDetails(null)
|
250 |
+
->setStatus(1)
|
251 |
+
->save();
|
252 |
+
}
|
253 |
+
|
254 |
+
//delete file
|
255 |
+
// @codingStandardsIgnoreStart
|
256 |
+
@unlink($file);
|
257 |
+
// @codingStandardsIgnoreEnd
|
258 |
+
}
|
259 |
public function uninstallAction()
|
260 |
{
|
261 |
$helper = Mage::helper('temandoinstaller');
|
262 |
+
/** @var $helper Temando_Installer_Helper_Data */
|
263 |
|
264 |
$params = $this->getRequest()->getParams();
|
265 |
if (!isset($params['massaction']) || !is_array($params['massaction']) ||
|
275 |
$installerIds = $params['massaction'];
|
276 |
|
277 |
foreach ($installerIds as $id) {
|
278 |
+
$this->_deletePackage($id);
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
|
281 |
if (Mage::registry('temandoinstaller_errors')) {
|
290 |
|
291 |
Mage::app()->cleanCache(array('CONFIG'));
|
292 |
$this->_redirect('*/*/');
|
293 |
+
/** return; */
|
294 |
+
}
|
295 |
+
|
296 |
+
protected function _deletePackage($installerId)
|
297 |
+
{
|
298 |
+
$installer = Mage::getModel('temandoinstaller/installer')->load($installerId);
|
299 |
+
$command = Mage::getModel('temandoinstaller/connect');
|
300 |
+
if ($command->uninstall($installer->getModule())) {
|
301 |
+
$installer->delete();
|
302 |
+
}
|
303 |
}
|
304 |
|
305 |
public function testConnectionSettingsAction()
|
310 |
|
311 |
public function dismissUpdateAction()
|
312 |
{
|
313 |
+
$moduleId = $this->getRequest()->getParam('id');
|
314 |
+
$module = Mage::getModel('temandoinstaller/installer')->load($moduleId);
|
315 |
+
/** @var $module Temando_Installer_Model_Installer */
|
316 |
|
317 |
if (!$module->getId()) {
|
318 |
Mage::getSingleton('adminhtml/session')->addError(
|
326 |
Mage::helper('temandoinstaller')->__('Temando update has been dismissed.')
|
327 |
);
|
328 |
}
|
329 |
+
|
330 |
return $this->getResponse()->setRedirect($this->getRequest()->getServer('HTTP_REFERER'));
|
331 |
}
|
332 |
|
app/code/community/Temando/Installer/data/temandoinstaller_setup/data-install-1.0.0.php
CHANGED
@@ -1,31 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
set_time_limit(0);
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
$
|
9 |
-
$
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
$
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
// @
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
);
|
28 |
-
// @codingStandardsIgnoreEnd
|
29 |
-
}
|
30 |
-
|
31 |
-
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/** set_time_limit(0); */
|
4 |
+
|
5 |
+
$installer = $this;
|
6 |
+
$installer->startSetup();
|
7 |
+
|
8 |
+
/** @var $helper Temando_Installer_Helper_Data */
|
9 |
+
$helper = Mage::helper('temandoinstaller');
|
10 |
+
|
11 |
+
//check if Temando is already installed and add a record of the current module if it is
|
12 |
+
if ($helper->getTemandoVersion()) {
|
13 |
+
$versionNumber = (string) Mage::getConfig()->getNode()->modules->Temando_Temando->version;
|
14 |
+
$versionName = 'Temando ' . ucfirst($helper->getTemandoVersionName());
|
15 |
+
//because there is no record of when it was originally installed/updated we will enter todays date
|
16 |
+
$installDate = Mage::getSingleton('core/date')->gmtDate();
|
17 |
+
$updateDate = Mage::getSingleton('core/date')->gmtDate();
|
18 |
+
// @codingStandardsIgnoreStart
|
19 |
+
$installer->run(
|
20 |
+
"INSERT INTO {$this->getTable('temando_installer')} (`name`, `token`, `version`, `module`, `install_date`, `update_date`, `update_available`, `update_dismissed`, `update_details`, `status`) VALUES
|
21 |
+
('{$versionName}','Token not set','{$versionNumber}','Temando_Temando','{$installDate}','{$updateDate}',0,0,NULL,1);"
|
22 |
+
);
|
23 |
+
// @codingStandardsIgnoreEnd
|
24 |
+
}
|
25 |
+
|
26 |
+
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Temando/Installer/data/temandoinstaller_setup/data-upgrade-1.0.2-1.0.3.php
CHANGED
@@ -1,27 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
*
|
10 |
-
*
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
)
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
$filename
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
@unlink($filename);
|
25 |
-
|
26 |
-
|
27 |
-
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Remove unused files from the Adminhtml controller directory
|
8 |
+
*
|
9 |
+
* This is because of Magento security patch SUPEE-6788
|
10 |
+
* Supresses errors when trying to delete.
|
11 |
+
*/
|
12 |
+
$temandoFiles = array (
|
13 |
+
'InstallerController',
|
14 |
+
);
|
15 |
+
|
16 |
+
foreach ($temandoFiles as $temandoFile) {
|
17 |
+
$directory = Mage::getModuleDir('controllers', 'Temando_Installer').DS.'Adminhtml';
|
18 |
+
$filename = $directory.DS.$temandoFile.'.php';
|
19 |
+
// @codingStandardsIgnoreStart
|
20 |
+
if (!file_exists($filename)) {
|
21 |
+
continue;
|
22 |
+
}
|
23 |
+
|
24 |
+
@unlink($filename);
|
25 |
+
// @codingStandardsIgnoreEnd
|
26 |
+
}
|
27 |
+
|
28 |
+
$installer->endSetup();
|
app/code/community/Temando/Installer/etc/adminhtml.xml
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<menu>
|
4 |
-
<system>
|
5 |
-
<children>
|
6 |
-
<extensions translate="title" module="connect">
|
7 |
-
<children>
|
8 |
-
<return translate="title" module="connect">
|
9 |
-
<title>Temando Installer Manager</title>
|
10 |
-
<sort_order>998</sort_order>
|
11 |
-
<action>adminhtml/temandoinstaller_installer</action>
|
12 |
-
</return>
|
13 |
-
</children>
|
14 |
-
</extensions>
|
15 |
-
</children>
|
16 |
-
</system>
|
17 |
-
</menu>
|
18 |
-
<acl>
|
19 |
-
<resources>
|
20 |
-
<all>
|
21 |
-
<title>Allow Everything</title>
|
22 |
-
</all>
|
23 |
-
<admin>
|
24 |
-
<children>
|
25 |
-
<system>
|
26 |
-
<children>
|
27 |
-
<config>
|
28 |
-
<children>
|
29 |
-
<temandoinstaller>
|
30 |
-
<title>Temando Installer</title>
|
31 |
-
</temandoinstaller>
|
32 |
-
</children>
|
33 |
-
</config>
|
34 |
-
</children>
|
35 |
-
</system>
|
36 |
-
</children>
|
37 |
-
</admin>
|
38 |
-
</resources>
|
39 |
-
</acl>
|
40 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<system>
|
5 |
+
<children>
|
6 |
+
<extensions translate="title" module="connect">
|
7 |
+
<children>
|
8 |
+
<return translate="title" module="connect">
|
9 |
+
<title>Temando Installer Manager</title>
|
10 |
+
<sort_order>998</sort_order>
|
11 |
+
<action>adminhtml/temandoinstaller_installer</action>
|
12 |
+
</return>
|
13 |
+
</children>
|
14 |
+
</extensions>
|
15 |
+
</children>
|
16 |
+
</system>
|
17 |
+
</menu>
|
18 |
+
<acl>
|
19 |
+
<resources>
|
20 |
+
<all>
|
21 |
+
<title>Allow Everything</title>
|
22 |
+
</all>
|
23 |
+
<admin>
|
24 |
+
<children>
|
25 |
+
<system>
|
26 |
+
<children>
|
27 |
+
<config>
|
28 |
+
<children>
|
29 |
+
<temandoinstaller>
|
30 |
+
<title>Temando Installer</title>
|
31 |
+
</temandoinstaller>
|
32 |
+
</children>
|
33 |
+
</config>
|
34 |
+
</children>
|
35 |
+
</system>
|
36 |
+
</children>
|
37 |
+
</admin>
|
38 |
+
</resources>
|
39 |
+
</acl>
|
40 |
+
</config>
|
app/code/community/Temando/Installer/etc/config.xml
CHANGED
@@ -2,21 +2,21 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Temando_Installer>
|
5 |
-
<version>1.0.
|
6 |
</Temando_Installer>
|
7 |
</modules>
|
8 |
<global>
|
9 |
<models>
|
10 |
<temandoinstaller>
|
11 |
<class>Temando_Installer_Model</class>
|
12 |
-
<resourceModel>
|
13 |
</temandoinstaller>
|
14 |
-
<
|
15 |
-
<class>
|
16 |
<entities>
|
17 |
<installer><table>temando_installer</table></installer>
|
18 |
</entities>
|
19 |
-
</
|
20 |
</models>
|
21 |
<blocks>
|
22 |
<temandoinstaller>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Temando_Installer>
|
5 |
+
<version>1.0.5</version>
|
6 |
</Temando_Installer>
|
7 |
</modules>
|
8 |
<global>
|
9 |
<models>
|
10 |
<temandoinstaller>
|
11 |
<class>Temando_Installer_Model</class>
|
12 |
+
<resourceModel>temandoinstaller_resource</resourceModel>
|
13 |
</temandoinstaller>
|
14 |
+
<temandoinstaller_resource>
|
15 |
+
<class>Temando_Installer_Model_resource</class>
|
16 |
<entities>
|
17 |
<installer><table>temando_installer</table></installer>
|
18 |
</entities>
|
19 |
+
</temandoinstaller_resource>
|
20 |
</models>
|
21 |
<blocks>
|
22 |
<temandoinstaller>
|
app/code/community/Temando/Installer/etc/system.xml
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<sections>
|
4 |
-
<temandoinstaller>
|
5 |
-
<label>Temando Installer</label>
|
6 |
-
<tab>sales</tab>
|
7 |
-
<frontend_type>text</frontend_type>
|
8 |
-
<sort_order>322</sort_order>
|
9 |
-
<show_in_default>1</show_in_default>
|
10 |
-
<show_in_website>0</show_in_website>
|
11 |
-
<show_in_store>0</show_in_store>
|
12 |
-
<groups>
|
13 |
-
<general translate="label">
|
14 |
-
<label>General</label>
|
15 |
-
<sort_order>10</sort_order>
|
16 |
-
<show_in_default>1</show_in_default>
|
17 |
-
<show_in_website>1</show_in_website>
|
18 |
-
<show_in_store>1</show_in_store>
|
19 |
-
<comment><![CDATA[<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">If you don't have a Temando account, you can <a href="https://sso.temando.com/signup/" target="_blank">Sign Up</a> immediately.</div>]]></comment>
|
20 |
-
<fields>
|
21 |
-
<token>
|
22 |
-
<label>Access Token</label>
|
23 |
-
<frontend_type>text</frontend_type>
|
24 |
-
<sort_order>10</sort_order>
|
25 |
-
<show_in_default>1</show_in_default>
|
26 |
-
<show_in_website>1</show_in_website>
|
27 |
-
<show_in_store>1</show_in_store>
|
28 |
-
</token>
|
29 |
-
<manage_button translate="label">
|
30 |
-
<label></label>
|
31 |
-
<frontend_model>temandoinstaller/adminhtml_system_config_form_button_manage</frontend_model>
|
32 |
-
<frontend_type>button</frontend_type>
|
33 |
-
<sort_order>20</sort_order>
|
34 |
-
<show_in_default>1</show_in_default>
|
35 |
-
<show_in_website>1</show_in_website>
|
36 |
-
<show_in_store>1</show_in_store>
|
37 |
-
</manage_button>
|
38 |
-
</fields>
|
39 |
-
</general>
|
40 |
-
</groups>
|
41 |
-
</temandoinstaller>
|
42 |
-
</sections>
|
43 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<temandoinstaller>
|
5 |
+
<label>Temando Installer</label>
|
6 |
+
<tab>sales</tab>
|
7 |
+
<frontend_type>text</frontend_type>
|
8 |
+
<sort_order>322</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>0</show_in_website>
|
11 |
+
<show_in_store>0</show_in_store>
|
12 |
+
<groups>
|
13 |
+
<general translate="label">
|
14 |
+
<label>General</label>
|
15 |
+
<sort_order>10</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<comment><![CDATA[<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">If you don't have a Temando account, you can <a href="https://sso.temando.com/signup/" target="_blank">Sign Up</a> immediately.</div>]]></comment>
|
20 |
+
<fields>
|
21 |
+
<token>
|
22 |
+
<label>Access Token</label>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>10</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
</token>
|
29 |
+
<manage_button translate="label">
|
30 |
+
<label></label>
|
31 |
+
<frontend_model>temandoinstaller/adminhtml_system_config_form_button_manage</frontend_model>
|
32 |
+
<frontend_type>button</frontend_type>
|
33 |
+
<sort_order>20</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</manage_button>
|
38 |
+
</fields>
|
39 |
+
</general>
|
40 |
+
</groups>
|
41 |
+
</temandoinstaller>
|
42 |
+
</sections>
|
43 |
+
</config>
|
app/code/community/Temando/Installer/sql/temandoinstaller_setup/mysql4-install-1.0.0.php
CHANGED
@@ -1,30 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
$installer->
|
10 |
-
|
11 |
-
$
|
12 |
-
|
13 |
-
|
14 |
-
`
|
15 |
-
`
|
16 |
-
`
|
17 |
-
`
|
18 |
-
`
|
19 |
-
`
|
20 |
-
`
|
21 |
-
`
|
22 |
-
`
|
23 |
-
`
|
24 |
-
`
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
);
|
29 |
-
|
30 |
-
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/** @var $this Mage_Eav_Model_Entity_Setup */
|
4 |
+
/** @var $installer Mage_Eav_Model_Entity_Setup */
|
5 |
+
|
6 |
+
$installer = $this;
|
7 |
+
$installer->startSetup();
|
8 |
+
|
9 |
+
$installer->run(
|
10 |
+
"DROP TABLE IF EXISTS {$this->getTable('temando_installer')};
|
11 |
+
CREATE TABLE {$this->getTable('temando_installer')} (
|
12 |
+
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
13 |
+
`name` TEXT NOT NULL,
|
14 |
+
`token` TEXT NOT NULL,
|
15 |
+
`version` TEXT NOT NULL,
|
16 |
+
`module` varchar(50) NOT NULL,
|
17 |
+
`install_date` DATETIME NULL DEFAULT NULL,
|
18 |
+
`update_date` DATETIME NULL DEFAULT NULL,
|
19 |
+
`update_available` tinyint(1) NOT NULL DEFAULT '0',
|
20 |
+
`update_dismissed` tinyint(1) NOT NULL DEFAULT '0',
|
21 |
+
`update_details` TEXT,
|
22 |
+
`status` int(2) NOT NULL DEFAULT '0',
|
23 |
+
PRIMARY KEY (`id`),
|
24 |
+
UNIQUE `module` (`module`)
|
25 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
|
26 |
+
);
|
27 |
+
|
28 |
+
$installer->endSetup();
|
|
|
|
app/design/adminhtml/default/default/layout/temandoinstaller.xml
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout>
|
3 |
-
<default>
|
4 |
-
<reference name="notifications">
|
5 |
-
<block type="temandoinstaller/adminhtml_notifications" name="temando_installer_notifications" template="temando/installer/notifications.phtml"/>
|
6 |
-
</reference>
|
7 |
-
</default>
|
8 |
-
<adminhtml_temandoinstaller_installer_index>
|
9 |
-
<reference name="content">
|
10 |
-
<block type="temandoinstaller/adminhtml_installer" name="temando_installer">
|
11 |
-
<block type="temandoinstaller/adminhtml_installer_grid" name="temando_installer_grid" />
|
12 |
-
</block>
|
13 |
-
</reference>
|
14 |
-
</adminhtml_temandoinstaller_installer_index>
|
15 |
-
</layout>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<default>
|
4 |
+
<reference name="notifications">
|
5 |
+
<block type="temandoinstaller/adminhtml_notifications" name="temando_installer_notifications" template="temando/installer/notifications.phtml"/>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<adminhtml_temandoinstaller_installer_index>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="temandoinstaller/adminhtml_installer" name="temando_installer">
|
11 |
+
<block type="temandoinstaller/adminhtml_installer_grid" name="temando_installer_grid" />
|
12 |
+
</block>
|
13 |
+
</reference>
|
14 |
+
</adminhtml_temandoinstaller_installer_index>
|
15 |
+
</layout>
|
app/design/adminhtml/default/default/template/temando/installer/notifications.phtml
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/* @var $this Temando_Installer_Block_Adminhtml_Notifications */
|
4 |
-
?>
|
5 |
-
<?php foreach ($this->getModuleNotifications() as $module):
|
6 |
-
/* @var $module Temando_Installer_Model_Installer */ ?>
|
7 |
-
<div class="notification-global notification-global-notice">
|
8 |
-
|
9 |
-
<span class="f-right">
|
10 |
-
<a href="<?php echo $this->getUrl('adminhtml/temandoinstaller_installer', array('_secure' => Mage::app()->getStore()->isCurrentlySecure())); ?>">Update</a> |
|
11 |
-
<a href="<?php echo $this->getUrl('adminhtml/temandoinstaller_installer/dismissUpdate', array('id' => $module->getId(), '_secure' => Mage::app()->getStore()->isCurrentlySecure())); ?>">Dismiss</a>
|
12 |
-
</span>
|
13 |
-
|
14 |
-
<strong class="label"><?php echo Mage::helper('temandoinstaller')->__('Temando Message:'); ?></strong> <?php echo $module->getUpdateDetails(); ?>
|
15 |
-
</div>
|
16 |
-
<?php endforeach; ?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* @var $this Temando_Installer_Block_Adminhtml_Notifications */
|
4 |
+
?>
|
5 |
+
<?php foreach ($this->getModuleNotifications() as $module):
|
6 |
+
/* @var $module Temando_Installer_Model_Installer */ ?>
|
7 |
+
<div class="notification-global notification-global-notice">
|
8 |
+
|
9 |
+
<span class="f-right">
|
10 |
+
<a href="<?php echo $this->getUrl('adminhtml/temandoinstaller_installer', array('_secure' => Mage::app()->getStore()->isCurrentlySecure())); ?>">Update</a> |
|
11 |
+
<a href="<?php echo $this->getUrl('adminhtml/temandoinstaller_installer/dismissUpdate', array('id' => $module->getId(), '_secure' => Mage::app()->getStore()->isCurrentlySecure())); ?>">Dismiss</a>
|
12 |
+
</span>
|
13 |
+
|
14 |
+
<strong class="label"><?php echo Mage::helper('temandoinstaller')->__('Temando Message:'); ?></strong> <?php echo $module->getUpdateDetails(); ?>
|
15 |
+
</div>
|
16 |
+
<?php endforeach; ?>
|
app/etc/modules/Temando_Installer.xml
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Temando_Installer>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
</Temando_Installer>
|
8 |
-
</modules>
|
9 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Temando_Installer>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Temando_Installer>
|
8 |
+
</modules>
|
9 |
</config>
|
app/locale/fr_FR/Temando_Installer.csv
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
"Manage Temando","Gérer Temando"
|
2 |
-
"Install Temando","Installer Temando"
|
3 |
-
"Test Connection Settings","Test des paramètres de connexion"
|
4 |
-
"Name","Nom"
|
5 |
-
"Version","Version"
|
6 |
-
"Token","Ticket"
|
7 |
-
"Install date","Date d'installation"
|
8 |
-
"Update","Mise à jour"
|
9 |
-
"Update date","Date de mise à jour"
|
10 |
-
"Update available","Mise à jour disponible"
|
11 |
-
"Uninstall","Désinstaller"
|
12 |
-
"Are you sure you want to uninstall the Temando module?","Voulez-vous vraiment désinstaller le module Temando ?"
|
13 |
-
"Are you sure you want to update the Temando module?","Voulez-vous vraiment mettre à jour le module Temando ?"
|
14 |
-
"Could not find latest release.","Impossible de trouver la dernière version."
|
15 |
-
"Package successfully installed.","Le module a été installé avec succès."
|
16 |
-
"No modules selected for update.","Vous n'avez sélectionné aucun module à mettre à jour."
|
17 |
-
"Could not find valid service.","Impossible de trouver un service valide."
|
18 |
-
"Current version is greater than or equal to the latest release.","La version actuelle est plus récente ou similaire à la dernière version disponible."
|
19 |
-
"Package successfully updated.","Le module a été mis à jour avec succès."
|
20 |
-
"No modules selected for removal.","Vous n'avez sélectionné aucun module à supprimer."
|
21 |
-
"Package successfully uninstalled.","Le module a été désinstallé."
|
22 |
-
"Modules does not exist.","Le module n'existe pas."
|
23 |
-
"Temando update has been dismissed.","La mise à jour Temando a été rejetée."
|
24 |
-
"Manage Temando Installation","Gérer l'installation de Temando"
|
25 |
-
"SOAP is not enabled on this server. Please enable SOAP to use the Temando plugin.","SOAP n'est pas activé sur ce serveur. Il est nécessaire de l'activer pour utiliser le plugin Temando"
|
26 |
-
"The community channel cannot be found. Please install the community channel for Magento Connect.","Impossible d'accéder au "community channel". Veuillez installer le "community channel" dans Magento Connect."
|
27 |
-
"Note: if you have any customisations relating to your Temando extension, upgrading your Temando extension will remove these. Contact your Temando representative for guidance.","Attention, si vous avez des modifications sur votre extension Temando, le changement de version les supprimera. Contactez votre responsable Temando si vous avez besoin d'aide."
|
28 |
-
"Note: if upgrading from the Starter Extension to a Business Extension, please re-index your products.","Note : Si vous passez de la version Starter à la version Business, vous devez réindexer votre base produit"
|
29 |
-
"Temando is already installed.","Temando est déjà installé. "
|
30 |
-
"Could not find valid subscription.","Impossible de trouver un abonnement valide."
|
31 |
-
"Error downloading file.","Erreur lors du téléchargement du fichier."
|
32 |
-
"There was an error uninstalling the current module.","Une erreur s'est produite lors de la désinstallation du module actuel."
|
33 |
-
"Could not complete get quotes test.","Le test de requête d'offres de transport (GetQuote) a échoué."
|
34 |
-
"Cheapest quote: %s","Offre la moins chère : %s"
|
35 |
-
"Error connecting to the api: %s","Erreur lors de la connexion à l'API : %s"
|
36 |
-
"API Connection successful!","La connection à l'API a réussi."
|
37 |
-
"Please add a warehouse to locations.","Veuillez ajouter un entrepôt aux lieux"
|
38 |
-
"Warehouses: %s","Entrepôts : %s"
|
39 |
-
"Please add a rule to the rule engine.","Veuillez ajouter une règle au moteur de règles"
|
40 |
-
"Rules: %s","Règles : %s"
|
41 |
-
"<div style=""padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;"">If you don't have a Temando account, you can <a href=""https://sso.temando.com/signup/"" target=""_blank"">Sign Up</a> immediately.</div>","<div style=""padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;"">Si vous n'avez pas de compte Temando, vous pouvez <a href=""https://sso.temando.com/signup/"" target=""_blank"">vous inscrire</a>.</div>"
|
42 |
-
"General","Générales"
|
43 |
-
"Access Token","Accéder au ticket d'accés"
|
44 |
-
"Temando Installer","Programme d'installation Temando"
|
1 |
+
"Manage Temando","Gérer Temando"
|
2 |
+
"Install Temando","Installer Temando"
|
3 |
+
"Test Connection Settings","Test des paramètres de connexion"
|
4 |
+
"Name","Nom"
|
5 |
+
"Version","Version"
|
6 |
+
"Token","Ticket"
|
7 |
+
"Install date","Date d'installation"
|
8 |
+
"Update","Mise à jour"
|
9 |
+
"Update date","Date de mise à jour"
|
10 |
+
"Update available","Mise à jour disponible"
|
11 |
+
"Uninstall","Désinstaller"
|
12 |
+
"Are you sure you want to uninstall the Temando module?","Voulez-vous vraiment désinstaller le module Temando ?"
|
13 |
+
"Are you sure you want to update the Temando module?","Voulez-vous vraiment mettre à jour le module Temando ?"
|
14 |
+
"Could not find latest release.","Impossible de trouver la dernière version."
|
15 |
+
"Package successfully installed.","Le module a été installé avec succès."
|
16 |
+
"No modules selected for update.","Vous n'avez sélectionné aucun module à mettre à jour."
|
17 |
+
"Could not find valid service.","Impossible de trouver un service valide."
|
18 |
+
"Current version is greater than or equal to the latest release.","La version actuelle est plus récente ou similaire à la dernière version disponible."
|
19 |
+
"Package successfully updated.","Le module a été mis à jour avec succès."
|
20 |
+
"No modules selected for removal.","Vous n'avez sélectionné aucun module à supprimer."
|
21 |
+
"Package successfully uninstalled.","Le module a été désinstallé."
|
22 |
+
"Modules does not exist.","Le module n'existe pas."
|
23 |
+
"Temando update has been dismissed.","La mise à jour Temando a été rejetée."
|
24 |
+
"Manage Temando Installation","Gérer l'installation de Temando"
|
25 |
+
"SOAP is not enabled on this server. Please enable SOAP to use the Temando plugin.","SOAP n'est pas activé sur ce serveur. Il est nécessaire de l'activer pour utiliser le plugin Temando"
|
26 |
+
"The community channel cannot be found. Please install the community channel for Magento Connect.","Impossible d'accéder au "community channel". Veuillez installer le "community channel" dans Magento Connect."
|
27 |
+
"Note: if you have any customisations relating to your Temando extension, upgrading your Temando extension will remove these. Contact your Temando representative for guidance.","Attention, si vous avez des modifications sur votre extension Temando, le changement de version les supprimera. Contactez votre responsable Temando si vous avez besoin d'aide."
|
28 |
+
"Note: if upgrading from the Starter Extension to a Business Extension, please re-index your products.","Note : Si vous passez de la version Starter à la version Business, vous devez réindexer votre base produit"
|
29 |
+
"Temando is already installed.","Temando est déjà installé. "
|
30 |
+
"Could not find valid subscription.","Impossible de trouver un abonnement valide."
|
31 |
+
"Error downloading file.","Erreur lors du téléchargement du fichier."
|
32 |
+
"There was an error uninstalling the current module.","Une erreur s'est produite lors de la désinstallation du module actuel."
|
33 |
+
"Could not complete get quotes test.","Le test de requête d'offres de transport (GetQuote) a échoué."
|
34 |
+
"Cheapest quote: %s","Offre la moins chère : %s"
|
35 |
+
"Error connecting to the api: %s","Erreur lors de la connexion à l'API : %s"
|
36 |
+
"API Connection successful!","La connection à l'API a réussi."
|
37 |
+
"Please add a warehouse to locations.","Veuillez ajouter un entrepôt aux lieux"
|
38 |
+
"Warehouses: %s","Entrepôts : %s"
|
39 |
+
"Please add a rule to the rule engine.","Veuillez ajouter une règle au moteur de règles"
|
40 |
+
"Rules: %s","Règles : %s"
|
41 |
+
"<div style=""padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;"">If you don't have a Temando account, you can <a href=""https://sso.temando.com/signup/"" target=""_blank"">Sign Up</a> immediately.</div>","<div style=""padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;"">Si vous n'avez pas de compte Temando, vous pouvez <a href=""https://sso.temando.com/signup/"" target=""_blank"">vous inscrire</a>.</div>"
|
42 |
+
"General","Générales"
|
43 |
+
"Access Token","Accéder au ticket d'accés"
|
44 |
+
"Temando Installer","Programme d'installation Temando"
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Temando_Installer</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software Licence</license>
|
7 |
<channel>community</channel>
|
@@ -11,11 +11,11 @@
|
|
11 |

|
12 |
Download the installer and enter your Temando Unique Access Token when prompted. From there, the extension will install the correct version you have signed up for.
|
13 |
</description>
|
14 |
-
<notes>-
|
15 |
<authors><author><name>Temando</name><user>Temando</user><email>marketing@temando.com</email></author></authors>
|
16 |
-
<date>2016-
|
17 |
-
<time>
|
18 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Temando_Installer.xml" hash="
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Temando_Installer</name>
|
4 |
+
<version>1.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software Licence</license>
|
7 |
<channel>community</channel>
|
11 |

|
12 |
Download the installer and enter your Temando Unique Access Token when prompted. From there, the extension will install the correct version you have signed up for.
|
13 |
</description>
|
14 |
+
<notes>- Coding stardard</notes>
|
15 |
<authors><author><name>Temando</name><user>Temando</user><email>marketing@temando.com</email></author></authors>
|
16 |
+
<date>2016-11-28</date>
|
17 |
+
<time>03:03:56</time>
|
18 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Temando_Installer.xml" hash="bdf389a38f64f2ada05e2f13fd98dcc3"/></dir></target><target name="magecommunity"><dir name="Temando"><dir name="Installer"><dir name="Block"><dir name="Adminhtml"><dir name="Installer"><file name="Grid.php" hash="dc99d115165dfcb087a2d048552ddefb"/></dir><file name="Installer.php" hash="14efc5fd9267a7b0c2550e2e2053b110"/><file name="Notifications.php" hash="a3e1b28a7d47cd03e6d4e1fa72882b33"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Button"><file name="Manage.php" hash="e3784b3b93ce9c0e58ee158a174f9393"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="28aac743b56bfcfde7ddf51f2587bb0e"/></dir><dir name="Model"><dir name="Api"><dir name="Rest"><file name="Client.php" hash="e9fee305a26b0f9002fa084da902e275"/></dir></dir><file name="Connect.php" hash="35a03c59b4bd1520adc10027a6037f4f"/><file name="Cron.php" hash="4f2c90ee0bdbbf3ee8dae62d825c376f"/><file name="Installer.php" hash="28ed83c3bec0b694353a1518238ee8b4"/><dir name="Resource"><dir name="Installer"><file name="Collection.php" hash="d6191d1b7760831b5df985e8e8fdf0ed"/></dir><file name="Installer.php" hash="95c1e4ccbfb50ccd66e2b692c04044ad"/></dir><file name="Tester.php" hash="ca760b63cc58be60d980976294d04dec"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Temandoinstaller"><file name="InstallerController.php" hash="fd532114bcc6625a8d53b098f7c1f198"/></dir></dir></dir><dir name="data"><dir name="temandoinstaller_setup"><file name="data-install-1.0.0.php" hash="abf993cdbb3048b0598ba0709b5367a1"/><file name="data-upgrade-1.0.2-1.0.3.php" hash="fdb38ba141e40be2b566a2450c043687"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="a100164be19194e830c4ab3ab989819e"/><file name="config.xml" hash="c4b2ed8ee04cfb74afd8fff8ca3c3b8a"/><file name="system.xml" hash="f47225f411184969c7504a9628656b61"/></dir><dir name="sql"><dir name="temandoinstaller_setup"><file name="mysql4-install-1.0.0.php" hash="e02d3066232d78576c0bf2ffb0dc7ddf"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="temandoinstaller.xml" hash="7623f7ecb0921288b57af88220582246"/></dir><dir name="template"><dir name="temando"><dir name="installer"><file name="notifications.phtml" hash="c2de260c2d458cdfd478f7cfe74d4f9d"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Temando_Installer.csv" hash="75ee73d99f36b766b010947dd8e22fa7"/></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|