Version Notes
Bug fix release
Download this release
Release Info
Developer | Chris |
Extension | straker-translations-easy-translation-platform |
Version | 1.3.4 |
Comparing to | |
See all releases |
Code changes from version 1.3.3 to 1.3.4
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Cms/Block/Grid.php +3 -3
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Cms/Page/Grid.php +3 -3
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Attribute/Grid.php +12 -11
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Category/Grid.php +36 -28
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Cms/Block/Grid.php +1 -1
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Cms/Page/Grid.php +1 -1
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Grid.php +9 -2
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Product/Grid.php +36 -28
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute/Grid.php +38 -11
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Category/Confirm/Grid.php +32 -3
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Cms/Page/Grid.php +3 -1
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Confirm.php +42 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Confirm/Grid.php +150 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Products/Grid.php +34 -10
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Helper/Data.php +28 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Api.php +7 -1
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Attribute/Translate.php +106 -45
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Cms/Block/Translate.php +22 -14
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Cms/Page/Translate.php +24 -13
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Job.php +470 -304
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job.php +4 -3
- app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/System/Config/Source/SiteMode.php +59 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/AttributeController.php +11 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/CategoryController.php +10 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/JobController.php +13 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/NewController.php +61 -49
- app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/ProductController.php +10 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/data/strakertranslations_easytranslationplatform_setup/data-install-1.2.0.php +22 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/data/strakertranslations_easytranslationplatform_setup/data-upgrade-1.2.0-1.3.0.php +11 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/config.xml +9 -9
- app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/system.xml +117 -100
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/install-1.2.0.php +752 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-install-1.0.0.php +0 -179
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.0.0-1.1.0.php +0 -53
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.1.0-1.2.0.php +0 -218
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.3.0-1.3.1.php +0 -127
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/upgrade-1.2.0-1.3.0.php +358 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/upgrade-1.3.0-1.3.1.php +91 -0
- app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/upgrade-1.3.3-1.3.4.php +80 -0
- app/design/adminhtml/default/straker/template/straker/new/attribute/confirm.phtml +1 -1
- app/design/adminhtml/default/straker/template/straker/new/attributes.phtml +31 -0
- app/design/adminhtml/default/straker/template/straker/new/products/confirm.phtml +1 -1
- js/straker/translations.js +7 -3
- package.xml +7 -7
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Cms/Block/Grid.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Cms_Block_Grid extends Mage_Adminhtml_Block_Cms_Block_Grid {
|
3 |
protected function _prepareCollection()
|
4 |
{
|
|
|
5 |
$collection = Mage::getModel('cms/block')->getCollection();
|
6 |
-
|
7 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
8 |
$collection->getSelect()->joinLeft(
|
9 |
-
array('straker' => $
|
10 |
'straker.new_entity_id = main_table.block_id',
|
11 |
array('straker_translated' => 'straker.version')
|
12 |
);
|
2 |
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Cms_Block_Grid extends Mage_Adminhtml_Block_Cms_Block_Grid {
|
3 |
protected function _prepareCollection()
|
4 |
{
|
5 |
+
/* @var $collection Mage_Cms_Model_Resource_Block_Collection */
|
6 |
$collection = Mage::getModel('cms/block')->getCollection();
|
7 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
|
|
8 |
$collection->getSelect()->joinLeft(
|
9 |
+
array('straker' => $collection->getTable('strakertranslations_easytranslationplatform/job_cmsblock')),
|
10 |
'straker.new_entity_id = main_table.block_id',
|
11 |
array('straker_translated' => 'straker.version')
|
12 |
);
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Cms/Page/Grid.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Cms_Page_Grid extends Mage_Adminhtml_Block_Cms_Page_Grid {
|
3 |
protected function _prepareCollection()
|
4 |
{
|
|
|
5 |
$collection = Mage::getModel('cms/page')->getCollection();
|
6 |
-
|
7 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
8 |
$collection->getSelect()->joinLeft(
|
9 |
-
array('straker' => $
|
10 |
'straker.new_entity_id = main_table.page_id',
|
11 |
array('straker_translated' => 'straker.version')
|
12 |
);
|
2 |
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Cms_Page_Grid extends Mage_Adminhtml_Block_Cms_Page_Grid {
|
3 |
protected function _prepareCollection()
|
4 |
{
|
5 |
+
/* @var $collection Mage_Cms_Model_Resource_Page_Collection */
|
6 |
$collection = Mage::getModel('cms/page')->getCollection();
|
7 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
|
|
8 |
$collection->getSelect()->joinLeft(
|
9 |
+
array('straker' => $collection->getTable('strakertranslations_easytranslationplatform/job_cmspage')),
|
10 |
'straker.new_entity_id = main_table.page_id',
|
11 |
array('straker_translated' => 'straker.version')
|
12 |
);
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Attribute/Grid.php
CHANGED
@@ -23,22 +23,23 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Attribute_
|
|
23 |
}
|
24 |
|
25 |
protected function _prepareCollection() {
|
26 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
27 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
28 |
|
|
|
29 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection()
|
30 |
->addFieldToFilter('main_table.job_id', $job->getId());
|
31 |
|
32 |
-
$collection->getSelect()
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
43 |
|
44 |
//echo $collection->getSelect();
|
23 |
}
|
24 |
|
25 |
protected function _prepareCollection() {
|
26 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
27 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
28 |
|
29 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $collection */
|
30 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection()
|
31 |
->addFieldToFilter('main_table.job_id', $job->getId());
|
32 |
|
33 |
+
$collection->getSelect()
|
34 |
+
->joinLeft(
|
35 |
+
array('ea' => $collection->getTable('eav/attribute')),
|
36 |
+
'ea.attribute_id = main_table.attribute_id',
|
37 |
+
array('attribute_code' => 'attribute_code')
|
38 |
+
)->joinLeft(
|
39 |
+
array('translate' => $collection->getTable('strakertranslations_easytranslationplatform/straker_attribute_translate')),
|
40 |
+
'translate.attribute_id = main_table.attribute_id AND translate.job_id = '.$job->getId(),
|
41 |
+
array('original' => 'original', 'translate' => 'translate')
|
42 |
+
);
|
43 |
|
44 |
|
45 |
//echo $collection->getSelect();
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Category/Grid.php
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
|
|
4 |
|
5 |
-
public function __construct()
|
|
|
6 |
parent::__construct();
|
7 |
$this->setId('strakerJobCategoryGrid');
|
8 |
$this->setSaveParametersInSession(true);
|
@@ -13,9 +15,9 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
13 |
$this->setChild('dispute_button',
|
14 |
$this->getLayout()->createBlock('adminhtml/widget_button')
|
15 |
->setData(array(
|
16 |
-
'label'
|
17 |
-
'onclick' => 'disputeForm.show(\''
|
18 |
-
'class'
|
19 |
))
|
20 |
);
|
21 |
|
@@ -23,20 +25,24 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
23 |
return parent::_prepareLayout();
|
24 |
}
|
25 |
|
26 |
-
protected function _prepareCollection()
|
27 |
-
|
|
|
28 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
29 |
-
$jobAttributes =
|
|
|
|
|
30 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_category')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
|
31 |
|
32 |
//loop through this job's attributes and join them to the collection
|
33 |
-
foreach($jobAttributes as $jobAttribute){
|
34 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
35 |
$collection->getSelect()->joinLeft(
|
36 |
-
array($attributeCode => $
|
37 |
-
$attributeCode.'.category_id = main_table.category_id
|
38 |
-
|
39 |
-
|
|
|
40 |
);
|
41 |
}
|
42 |
//echo $collection->getSelect()->__toString();
|
@@ -45,7 +51,8 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
45 |
return parent::_prepareCollection();
|
46 |
}
|
47 |
|
48 |
-
protected function _prepareColumns()
|
|
|
49 |
// $this->addColumn('id', array(
|
50 |
// 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('ID'),
|
51 |
// 'align' => 'right',
|
@@ -66,32 +73,32 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
66 |
// ));
|
67 |
|
68 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
69 |
-
$jobAttributes =
|
70 |
|
71 |
//loop through this job's attributes and add columns to the grid
|
72 |
-
foreach($jobAttributes as $jobAttribute){
|
73 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
74 |
$attrModel = Mage::getModel('eav/entity_attribute')->loadByCode(3, $attributeCode);
|
75 |
-
$this->addColumn($attributeCode.'_original', array(
|
76 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Source', $attrModel->getFrontendLabel()),
|
77 |
'align' => 'left',
|
78 |
-
'index' => $attributeCode.'_original',
|
79 |
));
|
80 |
|
81 |
-
$this->addColumn($attributeCode.'_translate', array(
|
82 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Target', $attrModel->getFrontendLabel()),
|
83 |
'align' => 'left',
|
84 |
-
'index' => $attributeCode.'_translate',
|
85 |
));
|
86 |
}
|
87 |
|
88 |
-
if ($this->getStatusId() == '4'){
|
89 |
$this->addColumn('version', array(
|
90 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Published'),
|
91 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Version',
|
92 |
'align' => 'center',
|
93 |
'index' => false,
|
94 |
-
'filter'
|
95 |
));
|
96 |
}
|
97 |
|
@@ -100,7 +107,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
100 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Frontend',
|
101 |
'align' => 'center',
|
102 |
'index' => false,
|
103 |
-
'filter'
|
104 |
));
|
105 |
|
106 |
$this->addColumn('view_backend', array(
|
@@ -108,13 +115,14 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
108 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Backend',
|
109 |
'align' => 'center',
|
110 |
'index' => false,
|
111 |
-
'filter'
|
112 |
));
|
113 |
|
114 |
return parent::_prepareColumns();
|
115 |
}
|
116 |
|
117 |
-
public function getRowUrl($row)
|
|
|
118 |
// return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
119 |
return '';
|
120 |
}
|
@@ -179,9 +187,9 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
|
|
179 |
if ($this->getStatusId() == '4') {
|
180 |
$html .= $this->getChildHtml('dispute_button');
|
181 |
}
|
182 |
-
if($this->getFilterVisibility()){
|
183 |
-
$html.= $this->getResetFilterButtonHtml();
|
184 |
-
$html.= $this->getSearchButtonHtml();
|
185 |
}
|
186 |
return $html;
|
187 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
parent::__construct();
|
9 |
$this->setId('strakerJobCategoryGrid');
|
10 |
$this->setSaveParametersInSession(true);
|
15 |
$this->setChild('dispute_button',
|
16 |
$this->getLayout()->createBlock('adminhtml/widget_button')
|
17 |
->setData(array(
|
18 |
+
'label' => Mage::helper('catalog')->__('Feedback'),
|
19 |
+
'onclick' => 'disputeForm.show(\'' . $this->getRequest()->getParam('job_id') . '\')',
|
20 |
+
'class' => 'feedback'
|
21 |
))
|
22 |
);
|
23 |
|
25 |
return parent::_prepareLayout();
|
26 |
}
|
27 |
|
28 |
+
protected function _prepareCollection()
|
29 |
+
{
|
30 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
31 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
32 |
+
$jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
|
33 |
+
|
34 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Category_Collection $collection */
|
35 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_category')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
|
36 |
|
37 |
//loop through this job's attributes and join them to the collection
|
38 |
+
foreach ($jobAttributes as $jobAttribute) {
|
39 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
40 |
$collection->getSelect()->joinLeft(
|
41 |
+
array($attributeCode => $collection->getTable('strakertranslations_easytranslationplatform/category_translate')),
|
42 |
+
$attributeCode . '.category_id = main_table.category_id
|
43 |
+
AND ' . $attributeCode . '.attribute_id = ' . $jobAttribute->getAttributeId() . '
|
44 |
+
AND ' . $attributeCode . '.job_id = ' . $job->getId(),
|
45 |
+
array($attributeCode . '_original' => 'original', $attributeCode . '_translate' => 'translate')
|
46 |
);
|
47 |
}
|
48 |
//echo $collection->getSelect()->__toString();
|
51 |
return parent::_prepareCollection();
|
52 |
}
|
53 |
|
54 |
+
protected function _prepareColumns()
|
55 |
+
{
|
56 |
// $this->addColumn('id', array(
|
57 |
// 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('ID'),
|
58 |
// 'align' => 'right',
|
73 |
// ));
|
74 |
|
75 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
76 |
+
$jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
|
77 |
|
78 |
//loop through this job's attributes and add columns to the grid
|
79 |
+
foreach ($jobAttributes as $jobAttribute) {
|
80 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
81 |
$attrModel = Mage::getModel('eav/entity_attribute')->loadByCode(3, $attributeCode);
|
82 |
+
$this->addColumn($attributeCode . '_original', array(
|
83 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Source', $attrModel->getFrontendLabel()),
|
84 |
'align' => 'left',
|
85 |
+
'index' => $attributeCode . '_original',
|
86 |
));
|
87 |
|
88 |
+
$this->addColumn($attributeCode . '_translate', array(
|
89 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Target', $attrModel->getFrontendLabel()),
|
90 |
'align' => 'left',
|
91 |
+
'index' => $attributeCode . '_translate',
|
92 |
));
|
93 |
}
|
94 |
|
95 |
+
if ($this->getStatusId() == '4') {
|
96 |
$this->addColumn('version', array(
|
97 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Published'),
|
98 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Version',
|
99 |
'align' => 'center',
|
100 |
'index' => false,
|
101 |
+
'filter' => false,
|
102 |
));
|
103 |
}
|
104 |
|
107 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Frontend',
|
108 |
'align' => 'center',
|
109 |
'index' => false,
|
110 |
+
'filter' => false,
|
111 |
));
|
112 |
|
113 |
$this->addColumn('view_backend', array(
|
115 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Backend',
|
116 |
'align' => 'center',
|
117 |
'index' => false,
|
118 |
+
'filter' => false,
|
119 |
));
|
120 |
|
121 |
return parent::_prepareColumns();
|
122 |
}
|
123 |
|
124 |
+
public function getRowUrl($row)
|
125 |
+
{
|
126 |
// return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
127 |
return '';
|
128 |
}
|
187 |
if ($this->getStatusId() == '4') {
|
188 |
$html .= $this->getChildHtml('dispute_button');
|
189 |
}
|
190 |
+
if ($this->getFilterVisibility()) {
|
191 |
+
$html .= $this->getResetFilterButtonHtml();
|
192 |
+
$html .= $this->getSearchButtonHtml();
|
193 |
}
|
194 |
return $html;
|
195 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Cms/Block/Grid.php
CHANGED
@@ -25,7 +25,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Cms_Block_
|
|
25 |
}
|
26 |
|
27 |
protected function _prepareCollection() {
|
28 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
29 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
30 |
|
31 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_cms_block')->getCollection()
|
25 |
}
|
26 |
|
27 |
protected function _prepareCollection() {
|
28 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
29 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
30 |
|
31 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_cms_block')->getCollection()
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Cms/Page/Grid.php
CHANGED
@@ -25,7 +25,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Cms_Page_G
|
|
25 |
}
|
26 |
|
27 |
protected function _prepareCollection() {
|
28 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
29 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
30 |
|
31 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_cms_page')->getCollection()
|
25 |
}
|
26 |
|
27 |
protected function _prepareCollection() {
|
28 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
29 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
30 |
|
31 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_cms_page')->getCollection()
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Grid.php
CHANGED
@@ -11,6 +11,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Grid exten
|
|
11 |
}
|
12 |
|
13 |
protected function _prepareCollection() {
|
|
|
14 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job')->getCollection();
|
15 |
|
16 |
foreach($collection as $jobModel){
|
@@ -19,9 +20,16 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Grid exten
|
|
19 |
}
|
20 |
}
|
21 |
|
22 |
-
|
23 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job')->getCollection();
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
$collection->getSelect()->joinLeft(
|
26 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_type'),
|
27 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_type').'.type_id = main_table.type_id',
|
@@ -31,7 +39,6 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Grid exten
|
|
31 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_status'),
|
32 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_status').'.status_id = main_table.status_id',
|
33 |
'status_name'
|
34 |
-
|
35 |
);
|
36 |
$collection->getSelect()->joinLeft(
|
37 |
Mage::getSingleton('core/resource')->getTableName('core/store'),
|
11 |
}
|
12 |
|
13 |
protected function _prepareCollection() {
|
14 |
+
/** @var $collection StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Collection*/
|
15 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job')->getCollection();
|
16 |
|
17 |
foreach($collection as $jobModel){
|
20 |
}
|
21 |
}
|
22 |
|
|
|
23 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job')->getCollection();
|
24 |
|
25 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
26 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
27 |
+
if($helper->isSandboxMode()){
|
28 |
+
$collection->addFieldToFilter('is_test_job', ['eq' => true]);
|
29 |
+
}else{
|
30 |
+
$collection->addFieldToFilter('is_test_job', ['eq' => false]);
|
31 |
+
}
|
32 |
+
|
33 |
$collection->getSelect()->joinLeft(
|
34 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_type'),
|
35 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_type').'.type_id = main_table.type_id',
|
39 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_status'),
|
40 |
Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_status').'.status_id = main_table.status_id',
|
41 |
'status_name'
|
|
|
42 |
);
|
43 |
$collection->getSelect()->joinLeft(
|
44 |
Mage::getSingleton('core/resource')->getTableName('core/store'),
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Product/Grid.php
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
|
|
4 |
|
5 |
-
public function __construct()
|
|
|
6 |
parent::__construct();
|
7 |
$this->setId('strakerJobProductGrid');
|
8 |
$this->setSaveParametersInSession(true);
|
@@ -13,9 +15,9 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
13 |
$this->setChild('dispute_button',
|
14 |
$this->getLayout()->createBlock('adminhtml/widget_button')
|
15 |
->setData(array(
|
16 |
-
'label'
|
17 |
-
'onclick' => 'disputeForm.show(\''
|
18 |
-
'class'
|
19 |
))
|
20 |
);
|
21 |
|
@@ -23,20 +25,24 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
23 |
return parent::_prepareLayout();
|
24 |
}
|
25 |
|
26 |
-
protected function _prepareCollection()
|
27 |
-
|
|
|
28 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
29 |
-
$jobAttributes =
|
|
|
|
|
30 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_product')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
|
31 |
|
32 |
//loop through this job's attributes and join them to the collection
|
33 |
-
foreach($jobAttributes as $jobAttribute){
|
34 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
35 |
$collection->getSelect()->joinLeft(
|
36 |
-
array($attributeCode => $
|
37 |
-
$attributeCode.'.product_id = main_table.product_id
|
38 |
-
|
39 |
-
|
|
|
40 |
);
|
41 |
}
|
42 |
//echo $collection->getSelect()->__toString();
|
@@ -45,7 +51,8 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
45 |
return parent::_prepareCollection();
|
46 |
}
|
47 |
|
48 |
-
protected function _prepareColumns()
|
|
|
49 |
$this->addColumn('id', array(
|
50 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('ID'),
|
51 |
'align' => 'right',
|
@@ -66,32 +73,32 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
66 |
// ));
|
67 |
|
68 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
69 |
-
$jobAttributes =
|
70 |
|
71 |
//loop through this job's attributes and add columns to the grid
|
72 |
-
foreach($jobAttributes as $jobAttribute){
|
73 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
74 |
$attrModel = Mage::getModel('eav/entity_attribute')->loadByCode(4, $attributeCode);
|
75 |
-
$this->addColumn($attributeCode.'_original', array(
|
76 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Source', $attrModel->getFrontendLabel()),
|
77 |
'align' => 'left',
|
78 |
-
'index' => $attributeCode.'_original',
|
79 |
));
|
80 |
|
81 |
-
$this->addColumn($attributeCode.'_translate', array(
|
82 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Target', $attrModel->getFrontendLabel()),
|
83 |
'align' => 'left',
|
84 |
-
'index' => $attributeCode.'_translate',
|
85 |
));
|
86 |
}
|
87 |
|
88 |
-
if ($this->getStatusId() == '4'){
|
89 |
$this->addColumn('version', array(
|
90 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Published'),
|
91 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Version',
|
92 |
'align' => 'center',
|
93 |
'index' => false,
|
94 |
-
'filter'
|
95 |
));
|
96 |
}
|
97 |
|
@@ -100,7 +107,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
100 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Frontend',
|
101 |
'align' => 'center',
|
102 |
'index' => false,
|
103 |
-
'filter'
|
104 |
));
|
105 |
|
106 |
$this->addColumn('view_backend', array(
|
@@ -108,13 +115,14 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
108 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Backend',
|
109 |
'align' => 'center',
|
110 |
'index' => false,
|
111 |
-
'filter'
|
112 |
));
|
113 |
|
114 |
return parent::_prepareColumns();
|
115 |
}
|
116 |
|
117 |
-
public function getRowUrl($row)
|
|
|
118 |
// return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
119 |
return '';
|
120 |
}
|
@@ -179,9 +187,9 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
|
|
179 |
if ($this->getStatusId() == '4') {
|
180 |
$html .= $this->getChildHtml('dispute_button');
|
181 |
}
|
182 |
-
if($this->getFilterVisibility()){
|
183 |
-
$html.= $this->getResetFilterButtonHtml();
|
184 |
-
$html.= $this->getSearchButtonHtml();
|
185 |
}
|
186 |
return $html;
|
187 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
parent::__construct();
|
9 |
$this->setId('strakerJobProductGrid');
|
10 |
$this->setSaveParametersInSession(true);
|
15 |
$this->setChild('dispute_button',
|
16 |
$this->getLayout()->createBlock('adminhtml/widget_button')
|
17 |
->setData(array(
|
18 |
+
'label' => Mage::helper('catalog')->__('Feedback'),
|
19 |
+
'onclick' => 'disputeForm.show(\'' . $this->getRequest()->getParam('job_id') . '\')',
|
20 |
+
'class' => 'feedback'
|
21 |
))
|
22 |
);
|
23 |
|
25 |
return parent::_prepareLayout();
|
26 |
}
|
27 |
|
28 |
+
protected function _prepareCollection()
|
29 |
+
{
|
30 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
31 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
32 |
+
$jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
|
33 |
+
|
34 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Product_Collection $collection */
|
35 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_product')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
|
36 |
|
37 |
//loop through this job's attributes and join them to the collection
|
38 |
+
foreach ($jobAttributes as $jobAttribute) {
|
39 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
40 |
$collection->getSelect()->joinLeft(
|
41 |
+
array($attributeCode => $collection->getTable('strakertranslations_easytranslationplatform/product_translate')),
|
42 |
+
$attributeCode . '.product_id = main_table.product_id
|
43 |
+
AND ' . $attributeCode . '.attribute_id = ' . $jobAttribute->getAttributeId() . '
|
44 |
+
AND ' . $attributeCode . '.job_id = ' . $job->getId(),
|
45 |
+
array($attributeCode . '_original' => 'original', $attributeCode . '_translate' => 'translate')
|
46 |
);
|
47 |
}
|
48 |
//echo $collection->getSelect()->__toString();
|
51 |
return parent::_prepareCollection();
|
52 |
}
|
53 |
|
54 |
+
protected function _prepareColumns()
|
55 |
+
{
|
56 |
$this->addColumn('id', array(
|
57 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('ID'),
|
58 |
'align' => 'right',
|
73 |
// ));
|
74 |
|
75 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
|
76 |
+
$jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
|
77 |
|
78 |
//loop through this job's attributes and add columns to the grid
|
79 |
+
foreach ($jobAttributes as $jobAttribute) {
|
80 |
$attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
|
81 |
$attrModel = Mage::getModel('eav/entity_attribute')->loadByCode(4, $attributeCode);
|
82 |
+
$this->addColumn($attributeCode . '_original', array(
|
83 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Source', $attrModel->getFrontendLabel()),
|
84 |
'align' => 'left',
|
85 |
+
'index' => $attributeCode . '_original',
|
86 |
));
|
87 |
|
88 |
+
$this->addColumn($attributeCode . '_translate', array(
|
89 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s - Target', $attrModel->getFrontendLabel()),
|
90 |
'align' => 'left',
|
91 |
+
'index' => $attributeCode . '_translate',
|
92 |
));
|
93 |
}
|
94 |
|
95 |
+
if ($this->getStatusId() == '4') {
|
96 |
$this->addColumn('version', array(
|
97 |
'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Published'),
|
98 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Version',
|
99 |
'align' => 'center',
|
100 |
'index' => false,
|
101 |
+
'filter' => false,
|
102 |
));
|
103 |
}
|
104 |
|
107 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Frontend',
|
108 |
'align' => 'center',
|
109 |
'index' => false,
|
110 |
+
'filter' => false,
|
111 |
));
|
112 |
|
113 |
$this->addColumn('view_backend', array(
|
115 |
'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Backend',
|
116 |
'align' => 'center',
|
117 |
'index' => false,
|
118 |
+
'filter' => false,
|
119 |
));
|
120 |
|
121 |
return parent::_prepareColumns();
|
122 |
}
|
123 |
|
124 |
+
public function getRowUrl($row)
|
125 |
+
{
|
126 |
// return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
127 |
return '';
|
128 |
}
|
187 |
if ($this->getStatusId() == '4') {
|
188 |
$html .= $this->getChildHtml('dispute_button');
|
189 |
}
|
190 |
+
if ($this->getFilterVisibility()) {
|
191 |
+
$html .= $this->getResetFilterButtonHtml();
|
192 |
+
$html .= $this->getSearchButtonHtml();
|
193 |
}
|
194 |
return $html;
|
195 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute/Grid.php
CHANGED
@@ -22,24 +22,51 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Attribute_
|
|
22 |
*/
|
23 |
protected function _prepareCollection()
|
24 |
{
|
|
|
25 |
$collection = Mage::getResourceModel('catalog/product_attribute_collection')
|
26 |
->addVisibleFilter();
|
27 |
|
28 |
$store = $this->_getStore();
|
29 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
30 |
-
$jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a
|
31 |
-
left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`
|
32 |
-
where b.`store_id` ='.$store->getId().' and a.`version` =1
|
33 |
-
GROUP BY a.`attribute_id`';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
//join straker job product table to get version for each product
|
36 |
$collection->getSelect()->joinLeft(
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
array('version')
|
41 |
-
|
42 |
);
|
|
|
43 |
$this->setCollection($collection);
|
44 |
|
45 |
return parent::_prepareCollection();
|
22 |
*/
|
23 |
protected function _prepareCollection()
|
24 |
{
|
25 |
+
/** @var \Mage_Catalog_Model_Resource_Product_Attribute_Collection $collection */
|
26 |
$collection = Mage::getResourceModel('catalog/product_attribute_collection')
|
27 |
->addVisibleFilter();
|
28 |
|
29 |
$store = $this->_getStore();
|
30 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
31 |
+
// $jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a
|
32 |
+
// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`
|
33 |
+
// where b.`store_id` ='.$store->getId().' and a.`version` =1
|
34 |
+
// GROUP BY a.`attribute_id`';
|
35 |
+
//
|
36 |
+
// //join straker job product table to get version for each product
|
37 |
+
// $collection->getSelect()->joinLeft(
|
38 |
+
//
|
39 |
+
// new Zend_Db_Expr('('.$jobAttributeQuery.')'),
|
40 |
+
// 'main_table.attribute_id = t.attribute_id',
|
41 |
+
// array('version')
|
42 |
+
//
|
43 |
+
// );
|
44 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $strakerJobProductCollection */
|
45 |
+
$strakerJobAttributeCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection();
|
46 |
+
$strakerJobAttributeCollection->getSelect()
|
47 |
+
->reset(Zend_Db_Select::COLUMNS)
|
48 |
+
->joinLeft(
|
49 |
+
['b' => $strakerJobAttributeCollection->getTable('strakertranslations_easytranslationplatform/job')],
|
50 |
+
'`main_table`.`job_id` = `b`.`id`',
|
51 |
+
[]
|
52 |
+
)->where(
|
53 |
+
'`b`.`store_id` = ?', $store->getId()
|
54 |
+
)->where(
|
55 |
+
'`main_table`.`version` = ?', 1
|
56 |
+
)->group(
|
57 |
+
'main_table.attribute_id'
|
58 |
+
)->columns(
|
59 |
+
['version' => 'version', 'attribute_id' => 'attribute_id']
|
60 |
+
);
|
61 |
+
|
62 |
+
$jobAttributeQuery = $strakerJobAttributeCollection->getSelect();
|
63 |
|
|
|
64 |
$collection->getSelect()->joinLeft(
|
65 |
+
$jobAttributeQuery,
|
66 |
+
'main_table.attribute_id = t.attribute_id',
|
67 |
+
array('version')
|
|
|
|
|
68 |
);
|
69 |
+
|
70 |
$this->setCollection($collection);
|
71 |
|
72 |
return parent::_prepareCollection();
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Category/Confirm/Grid.php
CHANGED
@@ -23,8 +23,35 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Category_C
|
|
23 |
{
|
24 |
return $this;
|
25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
protected function _prepareCollection()
|
27 |
{
|
|
|
28 |
$collection = Mage::getModel('catalog/category')->getCollection()
|
29 |
->addAttributeToSelect('path')
|
30 |
->addAttributeToSelect('name');
|
@@ -34,11 +61,13 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Category_C
|
|
34 |
$collection->addAttributeToSelect($attr);
|
35 |
}
|
36 |
|
|
|
|
|
37 |
//join straker job product table to get version for each product
|
38 |
-
|
39 |
$collection->getSelect()->joinLeft(
|
40 |
-
|
41 |
-
|
42 |
'version'
|
43 |
);
|
44 |
|
23 |
{
|
24 |
return $this;
|
25 |
}
|
26 |
+
// protected function _prepareCollection()
|
27 |
+
// {
|
28 |
+
// $collection = Mage::getModel('catalog/category')->getCollection()
|
29 |
+
// ->addAttributeToSelect('path')
|
30 |
+
// ->addAttributeToSelect('name');
|
31 |
+
// $collection->addAttributeToFilter('entity_id', array('in' => $this->getCategory()));
|
32 |
+
//
|
33 |
+
// foreach ($this->getAttrArray() as $attr){
|
34 |
+
// $collection->addAttributeToSelect($attr);
|
35 |
+
// }
|
36 |
+
//
|
37 |
+
// //join straker job product table to get version for each product
|
38 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
39 |
+
// $collection->getSelect()->joinLeft(
|
40 |
+
// $prefix.'straker_job_category',
|
41 |
+
// $prefix.'straker_job_category.category_id = e.entity_id',
|
42 |
+
// 'version'
|
43 |
+
// );
|
44 |
+
//
|
45 |
+
// $this->setCollection($collection);
|
46 |
+
//
|
47 |
+
// parent::_prepareCollection();
|
48 |
+
//// $this->getCollection()->addWebsiteNamesToResult();
|
49 |
+
// return $this;
|
50 |
+
// }
|
51 |
+
|
52 |
protected function _prepareCollection()
|
53 |
{
|
54 |
+
/** @var Mage_Catalog_Model_Resource_Category_Collection $collection */
|
55 |
$collection = Mage::getModel('catalog/category')->getCollection()
|
56 |
->addAttributeToSelect('path')
|
57 |
->addAttributeToSelect('name');
|
61 |
$collection->addAttributeToSelect($attr);
|
62 |
}
|
63 |
|
64 |
+
$strakerJobCategoryTable = $collection->getResource()->getTable('strakertranslations_easytranslationplatform/job_category');
|
65 |
+
|
66 |
//join straker job product table to get version for each product
|
67 |
+
|
68 |
$collection->getSelect()->joinLeft(
|
69 |
+
['a' => $strakerJobCategoryTable ],
|
70 |
+
'a.category_id = e.entity_id AND a.version = 1',
|
71 |
'version'
|
72 |
);
|
73 |
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Cms/Page/Grid.php
CHANGED
@@ -14,9 +14,11 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Cms_Page_G
|
|
14 |
|
15 |
protected function _prepareCollection()
|
16 |
{
|
17 |
-
$collection = Mage::getModel('cms/page')->getCollection();
|
18 |
/* @var $collection Mage_Cms_Model_Mysql4_Page_Collection */
|
|
|
|
|
19 |
$collection->setFirstStoreFlag(true);
|
|
|
20 |
$this->setCollection($collection);
|
21 |
|
22 |
return parent::_prepareCollection();
|
14 |
|
15 |
protected function _prepareCollection()
|
16 |
{
|
|
|
17 |
/* @var $collection Mage_Cms_Model_Mysql4_Page_Collection */
|
18 |
+
$collection = Mage::getModel('cms/page')->getCollection();
|
19 |
+
//todo: should add $collection->addStoreFilter(sourceStoreId);
|
20 |
$collection->setFirstStoreFlag(true);
|
21 |
+
//var_dump($collection->getSelect()->__toString());exit;
|
22 |
$this->setCollection($collection);
|
23 |
|
24 |
return parent::_prepareCollection();
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Confirm.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Confirm extends Mage_Adminhtml_Block_Widget_Container
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Set template
|
6 |
+
*/
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
parent::__construct();
|
10 |
+
$this->setTemplate('straker/new/confirm.phtml');
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Prepare button and grid
|
15 |
+
*
|
16 |
+
* @return Mage_Adminhtml_Block_Catalog_Product
|
17 |
+
*/
|
18 |
+
protected function _prepareLayout()
|
19 |
+
{
|
20 |
+
$this->_addButton('submit', array(
|
21 |
+
'label' => Mage::helper('catalog')->__('Submit'),
|
22 |
+
'onclick' => "$('submit-new-job-form').submit();",
|
23 |
+
// 'onclick' => "setLocation('{$this->getUrl('*/*/submit')}')",
|
24 |
+
'class' => 'task'
|
25 |
+
));
|
26 |
+
|
27 |
+
$this->setChild('grid', $this->getLayout()->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_confirm_grid', 'product.grid', array('store' => $this->getStore(), 'attr' => $this->getAttr(), 'product' => $this->getProduct())));
|
28 |
+
return parent::_prepareLayout();
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Render grid
|
34 |
+
*
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
public function getGridHtml()
|
38 |
+
{
|
39 |
+
return $this->getChildHtml('grid');
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Confirm/Grid.php
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Confirm_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('strakerProducts');
|
9 |
+
$this->setDefaultSort('entity_id');
|
10 |
+
$this->setDefaultDir('DESC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
$this->setUseAjax(false);
|
13 |
+
$this->setVarNameFilter('product_filter');
|
14 |
+
}
|
15 |
+
|
16 |
+
protected function _getStore()
|
17 |
+
{
|
18 |
+
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
19 |
+
return Mage::app()->getStore($storeId);
|
20 |
+
}
|
21 |
+
protected function _prepareLayout()
|
22 |
+
{
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
protected function _prepareCollection()
|
26 |
+
{
|
27 |
+
$store = $this->_getStore();
|
28 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
29 |
+
->addAttributeToSelect('sku')
|
30 |
+
->addAttributeToSelect('name')
|
31 |
+
->addAttributeToSelect('type_id');
|
32 |
+
$collection->addAttributeToFilter('entity_id', array('in' => $this->getProduct()));
|
33 |
+
|
34 |
+
foreach ($this->getAttrArray() as $attr){
|
35 |
+
$collection->addAttributeToSelect($attr);
|
36 |
+
}
|
37 |
+
if ($store->getId()) {
|
38 |
+
//$collection->setStoreId($store->getId());
|
39 |
+
$adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
|
40 |
+
$collection->addStoreFilter($store);
|
41 |
+
$collection->joinAttribute(
|
42 |
+
'name',
|
43 |
+
'catalog_product/name',
|
44 |
+
'entity_id',
|
45 |
+
null,
|
46 |
+
'inner',
|
47 |
+
$adminStore
|
48 |
+
);
|
49 |
+
$collection->joinAttribute(
|
50 |
+
'status',
|
51 |
+
'catalog_product/status',
|
52 |
+
'entity_id',
|
53 |
+
null,
|
54 |
+
'inner',
|
55 |
+
$store->getId()
|
56 |
+
);
|
57 |
+
$collection->joinAttribute(
|
58 |
+
'visibility',
|
59 |
+
'catalog_product/visibility',
|
60 |
+
'entity_id',
|
61 |
+
null,
|
62 |
+
'inner',
|
63 |
+
$store->getId()
|
64 |
+
);
|
65 |
+
}
|
66 |
+
else {
|
67 |
+
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
|
68 |
+
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
|
69 |
+
}
|
70 |
+
|
71 |
+
$this->setCollection($collection);
|
72 |
+
|
73 |
+
parent::_prepareCollection();
|
74 |
+
$this->getCollection()->addWebsiteNamesToResult();
|
75 |
+
return $this;
|
76 |
+
}
|
77 |
+
|
78 |
+
protected function _addColumnFilterToCollection($column)
|
79 |
+
{
|
80 |
+
if ($this->getCollection()) {
|
81 |
+
if ($column->getId() == 'websites') {
|
82 |
+
$this->getCollection()->joinField('websites',
|
83 |
+
'catalog/product_website',
|
84 |
+
'website_id',
|
85 |
+
'product_id=entity_id',
|
86 |
+
null,
|
87 |
+
'left');
|
88 |
+
}
|
89 |
+
}
|
90 |
+
return parent::_addColumnFilterToCollection($column);
|
91 |
+
}
|
92 |
+
|
93 |
+
protected function _prepareColumns()
|
94 |
+
{
|
95 |
+
|
96 |
+
$this->addColumn('entity_id',
|
97 |
+
array(
|
98 |
+
'header'=> Mage::helper('catalog')->__('ID'),
|
99 |
+
'width' => '50px',
|
100 |
+
'type' => 'number',
|
101 |
+
'index' => 'entity_id',
|
102 |
+
'filter' => false,
|
103 |
+
));
|
104 |
+
|
105 |
+
if (in_array('name',$this->getAttrArray())) {
|
106 |
+
$this->addColumn('name',
|
107 |
+
array(
|
108 |
+
'header' => Mage::helper('catalog')->__('Name to translate'),
|
109 |
+
'index' => 'name',
|
110 |
+
'filter' => false,
|
111 |
+
));
|
112 |
+
}
|
113 |
+
else{
|
114 |
+
$this->addColumn('name',
|
115 |
+
array(
|
116 |
+
'header' => Mage::helper('catalog')->__('Name'),
|
117 |
+
'index' => 'name',
|
118 |
+
'filter' => false,
|
119 |
+
));
|
120 |
+
}
|
121 |
+
|
122 |
+
foreach ($this->getAttrArray() as $attr){
|
123 |
+
if ($attr!='name') {
|
124 |
+
$attrModel = Mage::getModel('eav/entity_attribute')->loadByCode(4, $attr);
|
125 |
+
$this->addColumn($attr,
|
126 |
+
array(
|
127 |
+
'header' => Mage::helper('catalog')->__($attrModel->getFrontendLabel()) .' to Translate',
|
128 |
+
'index' => $attr,
|
129 |
+
'filter' => false,
|
130 |
+
));
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
return parent::_prepareColumns();
|
135 |
+
}
|
136 |
+
|
137 |
+
public function getGridUrl()
|
138 |
+
{
|
139 |
+
return $this->getUrl('*/*/addtoconfirm', array('_current'=>true));
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getRowUrl($row)
|
143 |
+
{
|
144 |
+
return '';
|
145 |
+
}
|
146 |
+
|
147 |
+
public function getAttrArray(){
|
148 |
+
return explode(',', $this->getAttr());
|
149 |
+
}
|
150 |
+
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Products/Grid.php
CHANGED
@@ -22,6 +22,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products_G
|
|
22 |
protected function _prepareCollection()
|
23 |
{
|
24 |
$store = $this->_getStore();
|
|
|
25 |
$collection = Mage::getModel('catalog/product')->getCollection()
|
26 |
->addAttributeToSelect('sku')
|
27 |
->addAttributeToSelect('name')
|
@@ -63,19 +64,42 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products_G
|
|
63 |
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
|
64 |
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
|
65 |
}
|
66 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
67 |
-
$jobProductQuery = 'select a.`version`, a.`product_id` from `'.$prefix.'straker_job_product` as a
|
68 |
-
left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`
|
69 |
-
where b.`store_id` = '.$store->getId().' and a.`version` =1
|
70 |
-
GROUP BY a.`product_id`';
|
71 |
|
72 |
//join straker job product table to get version for each product
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
$collection->getSelect()->joinLeft(
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
array('version')
|
78 |
-
|
79 |
);
|
80 |
|
81 |
$this->setCollection($collection);
|
22 |
protected function _prepareCollection()
|
23 |
{
|
24 |
$store = $this->_getStore();
|
25 |
+
/** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
|
26 |
$collection = Mage::getModel('catalog/product')->getCollection()
|
27 |
->addAttributeToSelect('sku')
|
28 |
->addAttributeToSelect('name')
|
64 |
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
|
65 |
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
|
66 |
}
|
67 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
68 |
+
// $jobProductQuery = 'select a.`version`, a.`product_id` from `'.$prefix.'straker_job_product` as a
|
69 |
+
// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`
|
70 |
+
// where b.`store_id` = '.$store->getId().' and a.`version` =1
|
71 |
+
// GROUP BY a.`product_id`';
|
72 |
|
73 |
//join straker job product table to get version for each product
|
74 |
+
// $collection->getSelect()->joinLeft(
|
75 |
+
//
|
76 |
+
// new Zend_Db_Expr('('.$jobProductQuery.')'),
|
77 |
+
// 'e.entity_id = t.product_id',
|
78 |
+
// array('version')
|
79 |
+
//
|
80 |
+
// );
|
81 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Product_Collection $strakerJobProductCollection */
|
82 |
+
$strakerJobProductCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_product')->getCollection();
|
83 |
+
$strakerJobProductCollection->getSelect()
|
84 |
+
->reset(Zend_Db_Select::COLUMNS)
|
85 |
+
->joinLeft(
|
86 |
+
['b' => $collection->getTable('strakertranslations_easytranslationplatform/job')],
|
87 |
+
'`main_table`.`job_id` = `b`.`id`',
|
88 |
+
[]
|
89 |
+
)->where(
|
90 |
+
'`b`.`store_id` = ?', $store->getId()
|
91 |
+
)->where(
|
92 |
+
'`main_table`.`version` = ?', 1
|
93 |
+
)->group(
|
94 |
+
'main_table.product_id'
|
95 |
+
)->columns(
|
96 |
+
['version' => 'version', 'product_id' => 'product_id']
|
97 |
+
);
|
98 |
+
$jobProductQuery = $strakerJobProductCollection->getSelect();
|
99 |
$collection->getSelect()->joinLeft(
|
100 |
+
$jobProductQuery,
|
101 |
+
'e.entity_id = t.product_id',
|
102 |
+
array('version')
|
|
|
|
|
103 |
);
|
104 |
|
105 |
$this->setCollection($collection);
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Helper/Data.php
CHANGED
@@ -58,4 +58,32 @@ class StrakerTranslations_EasyTranslationPlatform_Helper_Data extends Mage_Core_
|
|
58 |
}
|
59 |
return $message;
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
58 |
}
|
59 |
return $message;
|
60 |
}
|
61 |
+
|
62 |
+
public function isSandboxMode(){
|
63 |
+
// return (Mage::getStoreConfig('straker/general/site_mode') == 0);
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function getSandboxMessage(){
|
68 |
+
return
|
69 |
+
'<p>
|
70 |
+
<h1>Sandbox Mode Enabled.</h1>
|
71 |
+
</p>
|
72 |
+
<p>
|
73 |
+
Thank you for installing our plugin. We have enabled the Sandbox testing mode for you. Jobs you create while this is enabled
|
74 |
+
will not be received by Straker Translations, and content will not be translated by a human - rather it will only be sample
|
75 |
+
text. To change the Sandbox Mode, go to
|
76 |
+
<a href="'. Mage::helper('adminhtml')->getUrl('adminhtml/system_config/edit', ['section' => 'straker']).'">Straker Configuration</a>
|
77 |
+
</p>';
|
78 |
+
}
|
79 |
+
|
80 |
+
public function checkSiteMode(){
|
81 |
+
if($this->isSandboxMode()){
|
82 |
+
Mage::getSingleton('adminhtml/session')->addNotice($this->getSandboxMessage());
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
public function clearSiteMode(){
|
87 |
+
return Mage::getModel('core/config')->deleteConfig('straker/general/site_mode', 'default', 0);
|
88 |
+
}
|
89 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Api.php
CHANGED
@@ -161,7 +161,13 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Api extends Mage_Core_Mo
|
|
161 |
}
|
162 |
|
163 |
protected function _getTranslateUrl(){
|
164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
|
167 |
protected function _getQuoteUrl(){
|
161 |
}
|
162 |
|
163 |
protected function _getTranslateUrl(){
|
164 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
165 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
166 |
+
if( $helper->isSandboxMode() ){
|
167 |
+
return Mage::getStoreConfig('straker/api_url/translate_sandbox');
|
168 |
+
}else{
|
169 |
+
return Mage::getStoreConfig('straker/api_url/translate');
|
170 |
+
}
|
171 |
}
|
172 |
|
173 |
protected function _getQuoteUrl(){
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Attribute/Translate.php
CHANGED
@@ -14,72 +14,133 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Attribute_Translate exte
|
|
14 |
}
|
15 |
|
16 |
public function importTranslation(){
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
if ($this->getTranslate()){
|
20 |
-
|
21 |
$dataInJson = json_encode(simplexml_load_string($this->getTranslate()));
|
22 |
$data = json_decode($dataInJson,true);
|
23 |
-
|
24 |
-
$writeConnection = $this->_getConnection();
|
25 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
26 |
$storeId = (int) $this->getStoreId();
|
27 |
-
|
|
|
28 |
foreach ($data as $k => $attribute ){
|
29 |
if ($k == 'title' && $attribute){
|
30 |
-
|
31 |
$attributeId = (int) $this->getAttributeId();
|
32 |
-
|
33 |
-
$
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
}
|
47 |
|
48 |
-
if ($k
|
49 |
-
|
50 |
|
51 |
-
|
|
|
|
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
WHERE NOT EXISTS(
|
58 |
-
select `value_id`
|
59 |
-
from `" . $prefix . "eav_attribute_option_value`
|
60 |
-
where `option_id`={$optionId} and `store_id` ={$storeId});");
|
61 |
|
|
|
|
|
|
|
62 |
|
63 |
-
|
64 |
-
UPDATE `" . $prefix . "eav_attribute_option_value` SET `value` = '{$optionValue}'
|
65 |
-
where `option_id`={$optionId} and `store_id` ={$storeId} limit 1;");
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
-
|
69 |
}
|
70 |
-
|
71 |
}
|
72 |
-
|
73 |
-
|
74 |
}
|
75 |
-
|
76 |
-
|
77 |
$this->setIsImported(1)->save();
|
78 |
-
|
79 |
}
|
80 |
|
81 |
-
private function _getConnection() {
|
82 |
-
return Mage::getSingleton('core/resource')->getConnection('core_write');
|
83 |
-
}
|
84 |
|
85 |
}
|
14 |
}
|
15 |
|
16 |
public function importTranslation(){
|
17 |
+
// if ($this->getTranslate()){
|
18 |
+
//
|
19 |
+
// $dataInJson = json_encode(simplexml_load_string($this->getTranslate()));
|
20 |
+
// $data = json_decode($dataInJson,true);
|
21 |
+
//
|
22 |
+
// $writeConnection = $this->_getConnection();
|
23 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
24 |
+
// $storeId = (int) $this->getStoreId();
|
25 |
+
//
|
26 |
+
// foreach ($data as $k => $attribute ){
|
27 |
+
// if ($k == 'title' && $attribute){
|
28 |
+
//
|
29 |
+
// $attributeId = (int) $this->getAttributeId();
|
30 |
+
//
|
31 |
+
// $writeConnection->query("
|
32 |
+
// INSERT INTO `" . $prefix . "eav_attribute_label` ( `attribute_id`, `store_id`, `value`)
|
33 |
+
// SELECT {$attributeId}, {$storeId}, '{$attribute}'
|
34 |
+
// FROM (select 1) as a
|
35 |
+
// WHERE NOT EXISTS(
|
36 |
+
// select `attribute_label_id`
|
37 |
+
// from `" . $prefix . "eav_attribute_label`
|
38 |
+
// where `attribute_id`={$attributeId} and `store_id` ={$storeId});");
|
39 |
+
//
|
40 |
+
// $writeConnection->query("
|
41 |
+
// UPDATE `" . $prefix . "eav_attribute_label` SET `value` = '{$attribute}'
|
42 |
+
// where `attribute_id`={$attributeId} and `store_id` ={$storeId} limit 1;");
|
43 |
+
//
|
44 |
+
// }
|
45 |
+
//
|
46 |
+
// if ($k = 'option'){
|
47 |
+
// foreach ($attribute as $optionId => $optionValue) {
|
48 |
+
//
|
49 |
+
// $optionId = str_replace('id_', '',$optionId);
|
50 |
+
//
|
51 |
+
// $writeConnection->query("
|
52 |
+
// INSERT INTO `" . $prefix . "eav_attribute_option_value` ( `option_id`, `store_id`, `value`)
|
53 |
+
// SELECT {$optionId}, {$storeId}, '{$optionValue}'
|
54 |
+
// FROM (select 1) as a
|
55 |
+
// WHERE NOT EXISTS(
|
56 |
+
// select `value_id`
|
57 |
+
// from `" . $prefix . "eav_attribute_option_value`
|
58 |
+
// where `option_id`={$optionId} and `store_id` ={$storeId});");
|
59 |
+
//
|
60 |
+
//
|
61 |
+
// $writeConnection->query("
|
62 |
+
// UPDATE `" . $prefix . "eav_attribute_option_value` SET `value` = '{$optionValue}'
|
63 |
+
// where `option_id`={$optionId} and `store_id` ={$storeId} limit 1;");
|
64 |
+
//
|
65 |
+
// }
|
66 |
+
//
|
67 |
+
// }
|
68 |
+
//
|
69 |
+
// }
|
70 |
+
//
|
71 |
+
//
|
72 |
+
// }
|
73 |
|
74 |
if ($this->getTranslate()){
|
|
|
75 |
$dataInJson = json_encode(simplexml_load_string($this->getTranslate()));
|
76 |
$data = json_decode($dataInJson,true);
|
|
|
|
|
|
|
77 |
$storeId = (int) $this->getStoreId();
|
78 |
+
/** @var Mage_Eav_Model_Attribute $eavAttributeModel */
|
79 |
+
$eavAttributeModel = Mage::getModel('eav/entity_attribute');
|
80 |
foreach ($data as $k => $attribute ){
|
81 |
if ($k == 'title' && $attribute){
|
|
|
82 |
$attributeId = (int) $this->getAttributeId();
|
83 |
+
$newLabel = [$storeId => $attribute];
|
84 |
+
$eavAttributeModel->load($attributeId);
|
85 |
+
if(!empty($eavAttributeModel->getId())){
|
86 |
+
$storeLabels = $eavAttributeModel->getStoreLabels();
|
87 |
+
if(is_array($storeLabels)){
|
88 |
+
//get all current stores
|
89 |
+
$stores = array_keys($storeLabels);
|
90 |
+
if(!in_array($storeId, $stores)){
|
91 |
+
array_push($storeLabels, $newLabel);
|
92 |
+
$eavAttributeModel->setData('store_labels', $storeLabels)->save();
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
|
|
96 |
}
|
97 |
|
98 |
+
if ($k == 'option' && $attribute){
|
99 |
+
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
100 |
|
101 |
+
/* @var $model Mage_Catalog_Model_Entity_Attribute */
|
102 |
+
$attrModel = Mage::getModel('catalog/resource_eav_attribute');
|
103 |
+
$attrModel->load($this->getAttributeId());
|
104 |
|
105 |
+
/** @var $valuesCollection Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection */
|
106 |
+
$valuesCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
107 |
+
->setStoreFilter(4, false)
|
108 |
+
->setAttributeFilter($attrModel->getId());
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
//0 => ['option_id' => '20', 'attribute_id' => '92', 'sort_order' => '0', 'value' => 'Black' ]
|
111 |
+
$optionData = $valuesCollection->getData();
|
112 |
+
$optionIds = array_column($optionData, 'option_id');
|
113 |
|
114 |
+
$optionValueTable = $setup->getTable('eav/attribute_option_value');
|
|
|
|
|
115 |
|
116 |
+
$newOptionData = [];
|
117 |
+
foreach ($attribute as $optionId => $optionValue) {
|
118 |
+
$optionId = str_replace('id_', '',$optionId);
|
119 |
+
/** @var Mage_Eav_Model_Entity_Attribute_Option $optionModel */
|
120 |
+
$optionModel = Mage::getModel('eav/entity_attribute_option');
|
121 |
+
$optionModel->load($optionId);
|
122 |
+
if( !in_array($optionId, $optionIds)){
|
123 |
+
array_push(
|
124 |
+
$newOptionData,
|
125 |
+
[
|
126 |
+
'option_id' => $optionId,
|
127 |
+
'store_id' => $storeId,
|
128 |
+
'value' => $optionValue
|
129 |
+
]
|
130 |
+
);
|
131 |
+
}
|
132 |
+
}
|
133 |
+
if($newOptionData){
|
134 |
+
$setup->getConnection()->insertMultiple($optionValueTable, $newOptionData);
|
135 |
}
|
|
|
136 |
}
|
|
|
137 |
}
|
|
|
|
|
138 |
}
|
|
|
|
|
139 |
$this->setIsImported(1)->save();
|
|
|
140 |
}
|
141 |
|
142 |
+
// private function _getConnection() {
|
143 |
+
// return Mage::getSingleton('core/resource')->getConnection('core_write');
|
144 |
+
// }
|
145 |
|
146 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Cms/Block/Translate.php
CHANGED
@@ -19,25 +19,33 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Cms_Block_Translate exte
|
|
19 |
->getNewEntityId();
|
20 |
|
21 |
|
22 |
-
if ($this->getTranslate()){
|
23 |
-
|
24 |
-
$writeConnection = $this->_getConnection();
|
25 |
-
|
26 |
-
$query = 'UPDATE `'.Mage::getSingleton('core/resource')->getTableName('cms/block')
|
27 |
-
. '` SET '.$this->getColumnName() .' = \''.addslashes($this->getTranslate()).' \' WHERE block_id = '.$newEntityId;
|
28 |
-
|
29 |
-
|
30 |
-
$writeConnection->query($query);
|
31 |
-
|
|
|
|
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
$this->setIsImported(1)->save();
|
36 |
|
37 |
}
|
38 |
-
|
39 |
-
private function _getConnection() {
|
40 |
-
return Mage::getSingleton('core/resource')->getConnection('core_write');
|
41 |
-
}
|
42 |
|
43 |
}
|
19 |
->getNewEntityId();
|
20 |
|
21 |
|
22 |
+
// if ($this->getTranslate()){
|
23 |
+
//
|
24 |
+
// $writeConnection = $this->_getConnection();
|
25 |
+
//
|
26 |
+
// $query = 'UPDATE `'.Mage::getSingleton('core/resource')->getTableName('cms/block')
|
27 |
+
// . '` SET '.$this->getColumnName() .' = \''.addslashes($this->getTranslate()).' \' WHERE block_id = '.$newEntityId;
|
28 |
+
//
|
29 |
+
//
|
30 |
+
// $writeConnection->query($query);
|
31 |
+
//
|
32 |
+
//
|
33 |
+
// }
|
34 |
|
35 |
+
if ($this->getTranslate()){
|
36 |
+
$model = Mage::getModel('cms/block')->load($newEntityId);
|
37 |
+
if($model->getId()){
|
38 |
+
$model->setData($this->getColumnName(), $this->getTranslate());
|
39 |
+
$model->save();
|
40 |
+
}
|
41 |
}
|
42 |
|
43 |
$this->setIsImported(1)->save();
|
44 |
|
45 |
}
|
46 |
+
//
|
47 |
+
// private function _getConnection() {
|
48 |
+
// return Mage::getSingleton('core/resource')->getConnection('core_write');
|
49 |
+
// }
|
50 |
|
51 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Cms/Page/Translate.php
CHANGED
@@ -19,25 +19,36 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Cms_Page_Translate exten
|
|
19 |
->getNewEntityId();
|
20 |
|
21 |
|
22 |
-
if ($this->getTranslate()){
|
23 |
-
|
24 |
-
$writeConnection = $this->_getConnection();
|
25 |
-
|
26 |
-
$query = 'UPDATE `'.Mage::getSingleton('core/resource')->getTableName('cms/page')
|
27 |
-
. '` SET '.$this->getColumnName() .' = \''.addslashes($this->getTranslate()).' \' WHERE page_id = '.$newEntityId;
|
28 |
-
|
29 |
-
|
30 |
-
$writeConnection->query($query);
|
|
|
|
|
|
|
|
|
|
|
31 |
|
|
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
$this->setIsImported(1)->save();
|
36 |
|
37 |
}
|
38 |
-
|
39 |
-
private function _getConnection() {
|
40 |
-
return Mage::getSingleton('core/resource')->getConnection('core_write');
|
41 |
-
}
|
42 |
|
43 |
}
|
19 |
->getNewEntityId();
|
20 |
|
21 |
|
22 |
+
// if ($this->getTranslate()){
|
23 |
+
//
|
24 |
+
// $writeConnection = $this->_getConnection();
|
25 |
+
//
|
26 |
+
// $query = 'UPDATE `'.Mage::getSingleton('core/resource')->getTableName('cms/page')
|
27 |
+
// . '` SET '.$this->getColumnName() .' = \''.addslashes($this->getTranslate()).' \' WHERE page_id = '.$newEntityId;
|
28 |
+
//
|
29 |
+
//
|
30 |
+
// $writeConnection->query($query);
|
31 |
+
//
|
32 |
+
//
|
33 |
+
// }
|
34 |
+
//
|
35 |
+
// $this->setIsImported(1)->save();
|
36 |
|
37 |
+
if ($this->getTranslate()){
|
38 |
|
39 |
+
$model = Mage::getModel('cms/page')->load($newEntityId);
|
40 |
+
if($model->getId()){
|
41 |
+
$model->setData($this->getColumnName(), $this->getTranslate());
|
42 |
+
$model->save();
|
43 |
+
}
|
44 |
}
|
45 |
|
46 |
$this->setIsImported(1)->save();
|
47 |
|
48 |
}
|
49 |
+
//
|
50 |
+
// private function _getConnection() {
|
51 |
+
// return Mage::getSingleton('core/resource')->getConnection('core_write');
|
52 |
+
// }
|
53 |
|
54 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Job.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Created by PhpStorm.
|
4 |
* User: WlliamZhao
|
@@ -16,209 +17,257 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
16 |
$this->_init('strakertranslations_easytranslationplatform/job');
|
17 |
}
|
18 |
|
19 |
-
protected function addProductAttributes($productAttributeIds)
|
20 |
-
|
21 |
foreach ($productAttributeIds as $productAttributeId) {
|
22 |
$this->_attributes[] =
|
23 |
Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')
|
24 |
->setJobId($this->getId())
|
25 |
-
->setAttributeId((int)
|
26 |
->save();
|
27 |
}
|
28 |
return $this;
|
29 |
}
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
$writeConnection = $this->getWriteAdapter();
|
35 |
-
|
36 |
-
$query = 'INSERT INTO `'.Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_product').'` (`product_id`, `job_id`) VALUES ';
|
37 |
-
$queryVals = array();
|
38 |
foreach ($productIds as $productId) {
|
39 |
-
$
|
|
|
|
|
|
|
40 |
}
|
41 |
-
|
42 |
-
$writeConnection->query( $query . implode(',', $queryVals));
|
43 |
-
|
44 |
return $this;
|
45 |
-
|
46 |
}
|
47 |
|
48 |
-
protected function addProductTranslateOriginal($productAttributeId, $productCollection)
|
49 |
-
|
50 |
-
|
51 |
-
$writeConnection = $this->getWriteAdapter();
|
52 |
-
|
53 |
-
$query = 'INSERT INTO `'.Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/product_translate').'` (`job_id`, `product_id`, `attribute_id`, `original`) VALUES ';
|
54 |
-
$queryVals = array();
|
55 |
$productAttributeCode = Mage::getModel('eav/entity_attribute')->load($productAttributeId)->getAttributeCode();
|
56 |
foreach ($productCollection as $product) {
|
57 |
-
$
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
-
|
60 |
-
$writeConnection->query( $query . implode(',', $queryVals));
|
61 |
-
|
62 |
return $this;
|
63 |
}
|
64 |
|
65 |
-
protected function addCategoryAttributes($categoryAttributeIds)
|
66 |
-
|
67 |
foreach ($categoryAttributeIds as $categoryAttributeId) {
|
68 |
$this->_attributes[] =
|
69 |
Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')
|
70 |
->setJobId($this->getId())
|
71 |
-
->setAttributeId((int)
|
72 |
->save();
|
73 |
}
|
74 |
return $this;
|
75 |
}
|
76 |
|
77 |
|
78 |
-
protected function addCategoryIds($categoryIds)
|
79 |
-
|
80 |
-
$
|
81 |
-
|
82 |
-
$query = 'INSERT INTO `'.Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_category').'` (`category_id`, `job_id`) VALUES ';
|
83 |
-
$queryVals = array();
|
84 |
foreach ($categoryIds as $categoryId) {
|
85 |
-
$
|
|
|
|
|
|
|
86 |
}
|
87 |
-
|
88 |
-
$writeConnection->query( $query . implode(',', $queryVals));
|
89 |
-
|
90 |
return $this;
|
91 |
-
|
92 |
}
|
93 |
|
94 |
-
protected function addCategoryTranslateOriginal($categoryAttributeId, $categoryCollection)
|
95 |
-
|
96 |
-
|
97 |
-
$writeConnection = $this->getWriteAdapter();
|
98 |
-
|
99 |
-
$query = 'INSERT INTO `'.Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/category_translate').'` (`job_id`, `category_id`, `attribute_id`, `original`) VALUES ';
|
100 |
-
$queryVals = array();
|
101 |
$categoryAttributeCode = Mage::getModel('eav/entity_attribute')->load($categoryAttributeId)->getAttributeCode();
|
102 |
foreach ($categoryCollection as $category) {
|
103 |
-
$
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
-
|
106 |
-
$writeConnection->query( $query . implode(',', $queryVals));
|
107 |
-
|
108 |
return $this;
|
109 |
}
|
110 |
|
111 |
-
protected function addCmsTranslateOriginal($Column, $cmsDataCollection, $type='page'
|
112 |
-
|
113 |
-
$writeConnection = $this->getWriteAdapter();
|
114 |
|
115 |
-
$
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
foreach ($cmsDataCollection as $cmsData) {
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
$jobCmsId = $k;
|
122 |
break;
|
123 |
}
|
124 |
}
|
125 |
-
|
126 |
-
$
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
|
129 |
-
$writeConnection->query( $query . implode(',', $queryVals));
|
130 |
-
|
131 |
return $this;
|
132 |
}
|
133 |
|
134 |
-
public function array_to_xml(
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
139 |
}
|
140 |
$subnode = $xml_data->addChild($key);
|
141 |
$this->array_to_xml($value, $subnode);
|
142 |
} else {
|
143 |
-
$xml_data->addChild("$key",htmlspecialchars("$value"));
|
144 |
}
|
145 |
}
|
146 |
}
|
147 |
|
148 |
-
protected function addAttributeTranslateOriginal($attributeData)
|
149 |
-
|
150 |
-
$writeConnection = $this->getWriteAdapter();
|
151 |
|
152 |
-
$
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
foreach ($attributeData as $attributeId => $translate) {
|
156 |
-
|
157 |
$original = array();
|
158 |
-
|
159 |
$original['title'] = $translate['label'] ? Mage::getModel('catalog/resource_eav_attribute')->load($attributeId)->getStoreLabel($this->getSourceStore()) : '';
|
160 |
-
|
161 |
-
|
162 |
-
if ($translate['option'] ){
|
163 |
$attributeOptioinCollection = Mage::getModel('eav/entity_attribute_option')
|
164 |
->getCollection()
|
165 |
->setStoreFilter($this->getSourceStore())
|
166 |
->setAttributeFilter($attributeId);
|
167 |
-
|
168 |
foreach ($attributeOptioinCollection as $attributeOptioin) {
|
169 |
-
$original['option']['id_'
|
170 |
}
|
171 |
}
|
172 |
-
|
173 |
$xml = new SimpleXMLElement('<attribute/>');
|
174 |
-
|
175 |
$this->array_to_xml($original, $xml);
|
176 |
-
|
177 |
-
|
178 |
-
$
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
}
|
183 |
|
184 |
-
$writeConnection->query(
|
185 |
|
186 |
return $this;
|
187 |
|
188 |
|
189 |
-
|
190 |
}
|
191 |
|
192 |
|
|
|
|
|
193 |
|
194 |
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
-
$writeConnection = $this->getWriteAdapter();
|
199 |
|
200 |
-
$
|
201 |
-
|
202 |
|
203 |
foreach ($attributeData as $attributeId => $translate) {
|
204 |
-
|
205 |
-
$
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
|
208 |
-
$writeConnection->query( $query . implode(',', $queryVals));
|
209 |
-
|
210 |
return $this;
|
211 |
|
212 |
}
|
213 |
|
214 |
|
215 |
-
public function addProducts($productAttributeIds
|
|
|
216 |
|
217 |
-
if (!$this->getId()){
|
218 |
-
if (!$this->getStoreId()){
|
219 |
Mage::throwException('Error: Missing Store Id');
|
220 |
}
|
221 |
-
$this->setSourceStore(Mage::getStoreConfig('straker/general/source'
|
222 |
$this->save();
|
223 |
}
|
224 |
|
@@ -227,8 +276,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
227 |
$countProducts = sizeof($productIds);
|
228 |
$buffer = 1000;
|
229 |
$_productIdSet = array();
|
230 |
-
for ($i = 0; $i < $countProducts; $i = $i + $buffer){
|
231 |
-
$_productIdSet[] = array_slice($productIds
|
232 |
}
|
233 |
|
234 |
foreach ($_productIdSet as $_productIds) {
|
@@ -245,22 +294,23 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
245 |
$productCollection->addAttributeToSelect($productAttributeCode);
|
246 |
}
|
247 |
|
248 |
-
$productCollection->addFieldToFilter('entity_id', array('in'=> $_productIds));
|
249 |
|
250 |
-
foreach (
|
251 |
$this->addProductTranslateOriginal($productAttributeId, $productCollection);
|
252 |
}
|
253 |
}
|
254 |
return $this;
|
255 |
}
|
256 |
|
257 |
-
public function addCategories($categoryAttributeIds
|
|
|
258 |
|
259 |
-
if (!$this->getId()){
|
260 |
-
if (!$this->getStoreId()){
|
261 |
Mage::throwException('Error: Missing Store Id');
|
262 |
}
|
263 |
-
$this->setSourceStore(Mage::getStoreConfig('straker/general/source'
|
264 |
$this->save();
|
265 |
}
|
266 |
|
@@ -269,8 +319,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
269 |
$countCategories = sizeof($categoryIds);
|
270 |
$buffer = 1000;
|
271 |
$_categoryIdSet = array();
|
272 |
-
for ($i = 0; $i < $countCategories; $i = $i + $buffer){
|
273 |
-
$_categoryIdSet[] = array_slice($categoryIds
|
274 |
}
|
275 |
|
276 |
foreach ($_categoryIdSet as $_categoryIds) {
|
@@ -287,22 +337,23 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
287 |
$categoryCollection->addAttributeToSelect($categoryAttributeCode);
|
288 |
}
|
289 |
|
290 |
-
$categoryCollection->addFieldToFilter('entity_id', array('in'=> $_categoryIds));
|
291 |
|
292 |
-
foreach (
|
293 |
$this->addCategoryTranslateOriginal($categoryAttributeId, $categoryCollection);
|
294 |
}
|
295 |
}
|
296 |
return $this;
|
297 |
}
|
298 |
|
299 |
-
public function addAttributes($attributeData)
|
|
|
300 |
|
301 |
-
if (!$this->getId()){
|
302 |
-
if (!$this->getStoreId()){
|
303 |
Mage::throwException('Error: Missing Store Id');
|
304 |
}
|
305 |
-
$this->setSourceStore(Mage::getStoreConfig('straker/general/source'
|
306 |
$this->save();
|
307 |
}
|
308 |
|
@@ -314,228 +365,330 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
314 |
}
|
315 |
|
316 |
|
317 |
-
public function addCmsEntities($ids, $Columns = array(), $type = 'page')
|
|
|
318 |
|
319 |
-
if (!$this->getId()){
|
320 |
-
if (!$this->getStoreId()){
|
321 |
Mage::throwException('Error: Missing Store Id');
|
322 |
}
|
323 |
-
$this->setSourceStore(Mage::getStoreConfig('straker/general/source'
|
324 |
$this->save();
|
325 |
}
|
326 |
|
327 |
foreach ($Columns as $Column) {
|
328 |
$this->_attributes[] =
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
}
|
334 |
|
335 |
-
$writeConnection = $this->getWriteAdapter();
|
336 |
-
|
337 |
-
$searchQuery = 'SELECT * FROM ' .Mage::getSingleton('core/resource')->getTableName('cms/'
|
338 |
-
|
339 |
-
|
340 |
-
$cmsDataCollection = $writeConnection->fetchAll($searchQuery);
|
341 |
-
|
342 |
-
$
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
|
348 |
foreach ($cmsDataCollection as $cmsData) {
|
349 |
-
$id = $cmsData[$type.'_id'];
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
$
|
|
|
355 |
}
|
356 |
|
357 |
-
$writeConnection
|
358 |
|
359 |
-
$query =
|
360 |
-
|
|
|
|
|
361 |
|
362 |
-
$jobCmsIds =
|
|
|
|
|
|
|
|
|
363 |
|
364 |
foreach ($Columns as $Column) {
|
365 |
-
$this->addCmsTranslateOriginal($Column, $cmsDataCollection, $type
|
366 |
}
|
367 |
|
368 |
-
|
369 |
$this->_createCMSTranslateFile($type);
|
370 |
-
|
371 |
-
|
372 |
-
return $this;
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
}
|
377 |
|
378 |
-
protected function _createCMSTranslateFile($type)
|
|
|
379 |
|
380 |
-
$_xml = '
|
|
|
381 |
|
382 |
-
$
|
383 |
-
$cmsTranslateCollection->addFieldToFilter('job_id',$this->getId());
|
384 |
|
385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
|
387 |
-
$
|
388 |
-
$
|
389 |
-
$
|
390 |
-
$_xml .= '<value><![CDATA['.$cmsTranslate->getOriginal().']]></value></data>';
|
391 |
-
}
|
392 |
-
$_xml .='</root>';
|
393 |
|
394 |
-
|
395 |
-
|
|
|
|
|
|
|
|
|
396 |
|
397 |
return $this;
|
398 |
|
399 |
|
400 |
}
|
401 |
|
402 |
-
protected function _createProductTranslateFile() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
-
$
|
405 |
|
406 |
$productTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/product_translate')->getCollection($this->getWriteAdapter());
|
407 |
-
$productTranslateCollection->addFieldToFilter('job_id'
|
408 |
|
409 |
$attributeFrontLabel = array();
|
410 |
|
411 |
-
foreach ($productTranslateCollection as $productTranslate
|
412 |
-
if (!isset($attributeFrontLabel[$productTranslate->getAttributeId()])){
|
413 |
$attributeFrontLabel[$productTranslate->getAttributeId()] =
|
414 |
Mage::getModel('eav/entity_attribute')->load($productTranslate->getAttributeId())->getFrontendLabel();
|
415 |
}
|
416 |
|
417 |
-
$
|
418 |
-
$
|
419 |
-
$
|
420 |
-
$
|
421 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
}
|
423 |
-
$_xml .='</root>';
|
424 |
|
425 |
-
|
426 |
-
$this->
|
|
|
427 |
|
428 |
return $this;
|
429 |
}
|
430 |
|
431 |
-
protected function _createCategoryTranslateFile()
|
|
|
|
|
|
|
|
|
432 |
|
433 |
-
$
|
434 |
|
435 |
$categoryTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/category_translate')->getCollection();
|
436 |
-
$categoryTranslateCollection->addFieldToFilter('job_id'
|
437 |
|
438 |
$attributeFrontLabel = array();
|
439 |
|
440 |
-
foreach ($categoryTranslateCollection as $categoryTranslate
|
441 |
-
if (!isset($attributeFrontLabel[$categoryTranslate->getAttributeId()])){
|
442 |
$attributeFrontLabel[$categoryTranslate->getAttributeId()] =
|
443 |
Mage::getModel('eav/entity_attribute')->load($categoryTranslate->getAttributeId())->getFrontendLabel();
|
444 |
}
|
445 |
|
446 |
-
$
|
447 |
-
$
|
448 |
-
$
|
449 |
-
$
|
450 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
}
|
452 |
-
$_xml .='</root>';
|
453 |
|
454 |
-
|
455 |
-
$this->
|
|
|
456 |
|
457 |
return $this;
|
458 |
}
|
459 |
|
460 |
-
protected function _createAttributeTranslateFile()
|
|
|
|
|
|
|
|
|
461 |
|
462 |
-
$
|
463 |
|
464 |
$attributeTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/attribute_translate')->getCollection();
|
465 |
-
$attributeTranslateCollection->addFieldToFilter('job_id'
|
|
|
|
|
|
|
|
|
|
|
466 |
|
467 |
-
|
|
|
|
|
|
|
|
|
|
|
468 |
|
469 |
-
|
470 |
-
|
|
|
471 |
|
472 |
-
|
473 |
-
|
474 |
-
$_xml .= '<data name="' .$this->getTypeId(). '_' . $this->getStoreId().'_'. $attributeTranslate->getAttributeId().'" ' ;
|
475 |
-
$_xml .= 'content_context="product attribute title" ';
|
476 |
-
$_xml .= 'content_id="'. $attributeTranslate->getId() .'">';
|
477 |
-
$_xml .= '<value><![CDATA['.$attribute.']]></value></data>';
|
478 |
}
|
479 |
|
480 |
-
if ($k = 'option'){
|
481 |
foreach ($attribute as $optionId => $optionValue) {
|
482 |
-
$
|
483 |
-
$
|
484 |
-
$
|
485 |
-
$
|
486 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
}
|
488 |
|
489 |
}
|
490 |
|
491 |
}
|
492 |
}
|
493 |
-
$_xml
|
494 |
-
|
495 |
-
|
496 |
-
$this->setSourceFile('job'.$this->getId().'.xml')->save() ;
|
497 |
|
498 |
return $this;
|
499 |
}
|
500 |
|
501 |
-
protected function _summitJob()
|
|
|
502 |
|
503 |
$request = array();
|
504 |
|
505 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
$store = Mage::getModel('core/store')->load($this->getStoreId());
|
507 |
-
$defaultTitle = $store->getFrontendName().'_'
|
508 |
$this->setTitle($defaultTitle);
|
509 |
}
|
510 |
$request['title'] = $this->getTitle();
|
511 |
-
$request['sl']
|
512 |
-
$request['tl']
|
513 |
-
|
514 |
-
$filePath = MAGENTO_ROOT.$this->_translateFilePath.$this->getSourceFile();
|
515 |
|
516 |
-
$
|
517 |
-
$request['callback_uri'] = Mage::getStoreConfig('web/unsecure/base_link_url',$this->getStoreId()) . 'straker/callback';
|
518 |
-
$request['token'] = $this->getId();
|
519 |
|
|
|
|
|
|
|
|
|
520 |
$api = $this->_getApi();
|
521 |
$response = $api->callTranslate($request);
|
522 |
-
if($response->job_key) {
|
523 |
$this->setStatusId(2)
|
524 |
->setJobKey($response->job_key)
|
525 |
->setTjNumber($response->tj_number)
|
526 |
->save();
|
527 |
$this->setLastStatus(1);
|
528 |
-
}
|
529 |
-
else{
|
530 |
$this->setLastStatus(0);
|
531 |
-
$message = $response->magentoMessage
|
532 |
$this->setLastMessage($message);
|
533 |
}
|
534 |
return $this;
|
535 |
|
536 |
}
|
537 |
|
538 |
-
public function submitProducts($productAttributeIds
|
|
|
539 |
|
540 |
//product
|
541 |
$this->setTypeId(1);
|
@@ -545,7 +698,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
545 |
return $this;
|
546 |
}
|
547 |
|
548 |
-
public function submitCategories($categoryAttributeIds
|
|
|
549 |
|
550 |
//category
|
551 |
$this->setTypeId(3);
|
@@ -555,7 +709,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
555 |
return $this;
|
556 |
}
|
557 |
|
558 |
-
public function submitAttributes($attributeData)
|
|
|
559 |
|
560 |
//category
|
561 |
$this->setTypeId(4);
|
@@ -565,32 +720,35 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
565 |
return $this;
|
566 |
}
|
567 |
|
568 |
-
public function submitCmsPage($cmsIds
|
|
|
569 |
|
570 |
$this->setTypeId(5);
|
571 |
-
$this->addCmsEntities($cmsIds
|
572 |
-
|
573 |
return $this;
|
574 |
}
|
575 |
|
576 |
-
public function submitCmsblock($cmsIds
|
|
|
577 |
|
578 |
$this->setTypeId(6);
|
579 |
-
$this->addCmsEntities($cmsIds
|
580 |
-
|
581 |
return $this;
|
582 |
}
|
583 |
|
584 |
-
public function updateQuote()
|
|
|
585 |
|
586 |
-
if ($this->getJobKey()){
|
587 |
$request = array();
|
588 |
$request['job_key'] = $this->getJobKey();
|
589 |
$api = $this->_getApi();
|
590 |
$response = $api->getTranslation($request);
|
591 |
|
592 |
if ($response->job) {
|
593 |
-
foreach ($response->job as $job){
|
594 |
if ($job->token == $this->getId()) {
|
595 |
$quote = $job->quotation;
|
596 |
if ($quote && $quote != $this->getQuote()) {
|
@@ -605,9 +763,10 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
605 |
|
606 |
}
|
607 |
|
608 |
-
public function updateTranslation()
|
|
|
609 |
$updateFlag = false;
|
610 |
-
if ($this->getJobKey()){
|
611 |
$request = array();
|
612 |
$request['job_key'] = $this->getJobKey();
|
613 |
$api = $this->_getApi();
|
@@ -667,22 +826,24 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
667 |
}
|
668 |
return $updateFlag;
|
669 |
}
|
670 |
-
|
671 |
protected function _getApi(){
|
672 |
|
673 |
return Mage::getModel('strakertranslations_easytranslationplatform/api',array('store'=>$this->getStoreId()));
|
674 |
}
|
675 |
|
676 |
-
protected function _getStatusId($statusName)
|
|
|
677 |
|
678 |
-
return Mage::getModel('strakertranslations_easytranslationplatform/job_status')->load($statusName,'status_name')->getId();
|
679 |
}
|
680 |
|
681 |
-
protected function _importTranslation()
|
|
|
682 |
|
683 |
$xml = $this->_getApi()->getTranslatedFile($this->getDownloadUrl());
|
684 |
|
685 |
-
file_put_contents(Mage::getBaseDir()
|
686 |
|
687 |
$data = simplexml_load_string($xml);
|
688 |
|
@@ -690,35 +851,34 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
690 |
|
691 |
foreach ($data->children() as $_translation) {
|
692 |
|
693 |
-
$_entityTranslationId = (string)
|
694 |
-
if ($this->_getType() == 'attribute'){
|
695 |
-
if ($_translation->attributes()->content_context =="product attribute title"){
|
696 |
-
$_translationValueGroup[$_entityTranslationId]['title'] = (string)
|
697 |
}
|
698 |
|
699 |
-
if ($_translation->attributes()->content_context =="product attribute option"){
|
700 |
-
$_translationValueGroup[$_entityTranslationId]['option']['id_'. $_translation->attributes()->option_id] = (string)
|
701 |
}
|
702 |
|
703 |
-
}
|
704 |
-
else {
|
705 |
$_translationValueGroup[$_entityTranslationId] = (string)$_translation->value;
|
706 |
}
|
707 |
|
708 |
}
|
709 |
|
710 |
-
foreach ($_translationValueGroup as $content_id => $_translationValue
|
711 |
|
712 |
$value = $_translationValue;
|
713 |
|
714 |
-
if (is_array($_translationValue)){
|
715 |
$xml = new SimpleXMLElement('<attribute/>');
|
716 |
-
$this->array_to_xml($_translationValue
|
717 |
-
$value = (string)
|
718 |
}
|
719 |
|
720 |
|
721 |
-
$_entityTranslation = Mage::getModel('strakertranslations_easytranslationplatform/'
|
722 |
$_entityTranslation->setTranslate($value);
|
723 |
$_entityTranslation->save();
|
724 |
$_entityTranslation->clearInstance();
|
@@ -728,19 +888,21 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
728 |
|
729 |
}
|
730 |
|
731 |
-
protected function _getType()
|
|
|
732 |
return str_replace(' ', '_', strtolower($this->getTypeName()));
|
733 |
}
|
734 |
|
735 |
-
public function updatePayment()
|
|
|
736 |
|
737 |
-
if ($this->getJobKey()){
|
738 |
$request = array();
|
739 |
$request['job_key'] = $this->getJobKey();
|
740 |
$api = $this->_getApi();
|
741 |
$response = $api->getPayment($request);
|
742 |
|
743 |
-
if(!empty($response) && $response->status == "Paid"){ ///////waiting for payment api
|
744 |
$this->setPaymentStatus(1)->save();
|
745 |
return true;
|
746 |
}
|
@@ -748,36 +910,37 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
748 |
return false;
|
749 |
}
|
750 |
|
751 |
-
public function applyTranslation(
|
|
|
752 |
|
753 |
-
$collection = Mage::getModel('strakertranslations_easytranslationplatform/'
|
754 |
|
755 |
if ($entityIds) {
|
756 |
-
$collection->addFieldToFilter($this->_getType().'_id', array('in' => $entityIds));
|
757 |
}
|
758 |
|
759 |
$updatedIds = array();
|
760 |
$writeConnection = $this->getWriteAdapter();
|
761 |
|
762 |
-
if (in_array($this->_getType()
|
763 |
$this->createNewCms($entityIds);
|
764 |
}
|
765 |
|
766 |
foreach ($collection as $translation) {
|
767 |
$translation->setStoreId($this->getStoreId())->importTranslation();
|
768 |
|
769 |
-
$entityId= call_user_func(array($translation, 'getData'),strtolower(str_replace(' ','_'
|
770 |
|
771 |
-
if (empty($updatedIds[$entityId])){
|
772 |
$updatedIds[$entityId] = true;
|
773 |
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
774 |
-
if (in_array($this->_getType()
|
775 |
-
$cmstableName = str_replace('_',''
|
776 |
$cmsColumnName = str_replace('cms_', '', $this->_getType());
|
777 |
-
$entityId = $translation->getData($this->_getType().'_id');
|
778 |
-
$writeConnection->update($prefix.'straker_job_'
|
779 |
-
}else{
|
780 |
-
$writeConnection->update($prefix.'straker_job_'
|
781 |
}
|
782 |
}
|
783 |
}
|
@@ -785,7 +948,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
785 |
return true;
|
786 |
}
|
787 |
|
788 |
-
protected function createNewCms($entityIds)
|
|
|
789 |
|
790 |
|
791 |
$cmsType = str_replace('cms_', '', $this->_getType());
|
@@ -793,12 +957,12 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
793 |
$cmsModelName = str_replace('_', '/', $this->_getType());
|
794 |
|
795 |
|
796 |
-
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_'
|
797 |
|
798 |
-
$collection->addFieldToFilter('job_id'
|
799 |
|
800 |
if ($entityIds) {
|
801 |
-
$collection->addFieldToFilter($cmsType.'_id', array('in' => $entityIds));
|
802 |
}
|
803 |
|
804 |
foreach ($collection as $jobCms) {
|
@@ -809,13 +973,13 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
809 |
|
810 |
$cmsData = json_decode($jobCms->getOrigin());
|
811 |
|
812 |
-
foreach ($cmsData as $k => $v){
|
813 |
-
$cmsModel->setData($k
|
814 |
}
|
815 |
-
|
816 |
-
$cmsModel->setStores(array())->save();
|
817 |
-
|
818 |
-
$jobCms->setNewEntityId($cmsModel->getId())
|
819 |
|
820 |
}
|
821 |
|
@@ -827,29 +991,30 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
827 |
{
|
828 |
if ($this->getStatusId() == 5) {
|
829 |
return true;
|
830 |
-
} elseif($this->getStatusId() == 4) {
|
831 |
return $this->updatePublishedStatus()->getStatus() == 5;
|
832 |
-
}
|
833 |
-
else{
|
834 |
return false;
|
835 |
}
|
836 |
}
|
837 |
|
838 |
-
protected
|
839 |
-
|
|
|
840 |
$collection->addFieldToFilter('version',
|
841 |
array(
|
842 |
array('neq' => '1'),
|
843 |
array('null' => true)
|
844 |
)
|
845 |
);
|
846 |
-
if(!$collection->getFirstItem()->getId()){
|
847 |
$this->setStatusId(5)->save();
|
848 |
}
|
849 |
return $this;
|
850 |
}
|
851 |
|
852 |
-
public function submitSupport(array $data)
|
|
|
853 |
|
854 |
$res = $this->_getApi()->callSupport($data);
|
855 |
|
@@ -857,13 +1022,13 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
857 |
|
858 |
}
|
859 |
|
860 |
-
public function checkAndCreateFolder()
|
|
|
861 |
|
862 |
$ioAdapter = new Varien_Io_File();
|
863 |
try {
|
864 |
-
$ioAdapter->checkAndCreateFolder(Mage::getBaseDir('var').DS.'straker');
|
865 |
-
}
|
866 |
-
catch (Exception $e) {
|
867 |
Mage::throwException($e->getMessage());
|
868 |
}
|
869 |
|
@@ -871,7 +1036,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
|
|
871 |
|
872 |
}
|
873 |
|
874 |
-
protected function getWriteAdapter()
|
|
|
875 |
return Mage::getSingleton('core/resource')->getConnection('core_write');
|
876 |
}
|
877 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Created by PhpStorm.
|
5 |
* User: WlliamZhao
|
17 |
$this->_init('strakertranslations_easytranslationplatform/job');
|
18 |
}
|
19 |
|
20 |
+
protected function addProductAttributes($productAttributeIds)
|
21 |
+
{
|
22 |
foreach ($productAttributeIds as $productAttributeId) {
|
23 |
$this->_attributes[] =
|
24 |
Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')
|
25 |
->setJobId($this->getId())
|
26 |
+
->setAttributeId((int)$productAttributeId)
|
27 |
->save();
|
28 |
}
|
29 |
return $this;
|
30 |
}
|
31 |
|
32 |
+
protected function addProductIds($productIds)
|
33 |
+
{
|
34 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/job_product');
|
|
|
|
|
|
|
|
|
35 |
foreach ($productIds as $productId) {
|
36 |
+
$model->setProductId($productId);
|
37 |
+
$model->setJobId($this->getId());
|
38 |
+
$model->save();
|
39 |
+
$model->unsetData();
|
40 |
}
|
|
|
|
|
|
|
41 |
return $this;
|
|
|
42 |
}
|
43 |
|
44 |
+
protected function addProductTranslateOriginal($productAttributeId, $productCollection)
|
45 |
+
{
|
46 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/product_translate');
|
|
|
|
|
|
|
|
|
47 |
$productAttributeCode = Mage::getModel('eav/entity_attribute')->load($productAttributeId)->getAttributeCode();
|
48 |
foreach ($productCollection as $product) {
|
49 |
+
$model->setJobId($this->getId());
|
50 |
+
$model->setProductId($product->getId());
|
51 |
+
$model->setAttributeId($productAttributeId);
|
52 |
+
$model->setOriginal($product->getData($productAttributeCode));
|
53 |
+
$model->save();
|
54 |
+
$model->unsetData();
|
55 |
}
|
|
|
|
|
|
|
56 |
return $this;
|
57 |
}
|
58 |
|
59 |
+
protected function addCategoryAttributes($categoryAttributeIds)
|
60 |
+
{
|
61 |
foreach ($categoryAttributeIds as $categoryAttributeId) {
|
62 |
$this->_attributes[] =
|
63 |
Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')
|
64 |
->setJobId($this->getId())
|
65 |
+
->setAttributeId((int)$categoryAttributeId)
|
66 |
->save();
|
67 |
}
|
68 |
return $this;
|
69 |
}
|
70 |
|
71 |
|
72 |
+
protected function addCategoryIds($categoryIds)
|
73 |
+
{
|
74 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/job_category');
|
75 |
+
//. '` (`category_id`, `job_id`) VALUES ';
|
|
|
|
|
76 |
foreach ($categoryIds as $categoryId) {
|
77 |
+
$model->setCategoryId($categoryId);
|
78 |
+
$model->setJobId($this->getId());
|
79 |
+
$model->save();
|
80 |
+
$model->unsetData();
|
81 |
}
|
|
|
|
|
|
|
82 |
return $this;
|
|
|
83 |
}
|
84 |
|
85 |
+
protected function addCategoryTranslateOriginal($categoryAttributeId, $categoryCollection)
|
86 |
+
{
|
87 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/category_translate');
|
|
|
|
|
|
|
|
|
88 |
$categoryAttributeCode = Mage::getModel('eav/entity_attribute')->load($categoryAttributeId)->getAttributeCode();
|
89 |
foreach ($categoryCollection as $category) {
|
90 |
+
$model->setJobId($this->getId());
|
91 |
+
$model->setCategoryId($category->getId());
|
92 |
+
$model->setAttributeId($categoryAttributeId);
|
93 |
+
$model->setOriginal($category->getData($categoryAttributeCode));
|
94 |
+
$model->save();
|
95 |
+
$model->unsetData();
|
96 |
}
|
|
|
|
|
|
|
97 |
return $this;
|
98 |
}
|
99 |
|
100 |
+
protected function addCmsTranslateOriginal($Column, $cmsDataCollection, $type = 'page', $jobCmsIds)
|
101 |
+
{
|
|
|
102 |
|
103 |
+
// $writeConnection = $this->getWriteAdapter();
|
104 |
+
//
|
105 |
+
// $query = 'INSERT INTO `' . Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/cms_' . $type . '_translate') . '` (`job_id`, `cms_' . $type . '_id`, `column_name`, `original` , `job_cms_id`) VALUES ';
|
106 |
+
// $queryVals = array();
|
107 |
+
// foreach ($cmsDataCollection as $cmsData) {
|
108 |
+
//
|
109 |
+
// foreach ($jobCmsIds as $k => $v) {
|
110 |
+
// if ($cmsData[$type . '_id'] == $v) {
|
111 |
+
// $jobCmsId = $k;
|
112 |
+
// break;
|
113 |
+
// }
|
114 |
+
// }
|
115 |
+
//
|
116 |
+
// $queryVals[] = '(' . $this->getId() . ', ' . $cmsData[$type . '_id'] . ', \'' . addslashes($Column) . '\', \'' . addslashes($cmsData[$Column]) . '\', ' . $jobCmsId . ')';
|
117 |
+
// }
|
118 |
+
//
|
119 |
+
// $writeConnection->query($query . implode(',', $queryVals));
|
120 |
+
|
121 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/cms_' . $type . '_translate');
|
122 |
+
//. '` (`job_id`, `cms_' . $type . '_id`, `column_name`, `original` , `job_cms_id`) VALUES ';
|
123 |
+
$jobCmsId = 0;
|
124 |
foreach ($cmsDataCollection as $cmsData) {
|
125 |
+
foreach ($jobCmsIds as $jobCmsIdArray) {
|
126 |
+
if ($cmsData[$type . '_id'] == $jobCmsIdArray[$type.'_id']) {
|
127 |
+
$jobCmsId = $jobCmsIdArray['id'];
|
|
|
128 |
break;
|
129 |
}
|
130 |
}
|
131 |
+
$model->setJobId($this->getId());
|
132 |
+
$model->setData('cms_'.$type.'_id', $cmsData[$type . '_id']);
|
133 |
+
$model->setcolumnName($Column);
|
134 |
+
$model->setOriginal($cmsData[$Column]);
|
135 |
+
$model->setJobCmsId($jobCmsId);
|
136 |
+
$model->save();
|
137 |
+
$model->unsetData();
|
138 |
}
|
139 |
|
|
|
|
|
140 |
return $this;
|
141 |
}
|
142 |
|
143 |
+
public function array_to_xml($data, &$xml_data)
|
144 |
+
{
|
145 |
+
foreach ($data as $key => $value) {
|
146 |
+
if (is_array($value)) {
|
147 |
+
if (is_numeric($key)) {
|
148 |
+
$key = 'item' . $key; //dealing with <0/>..<n/> issues
|
149 |
}
|
150 |
$subnode = $xml_data->addChild($key);
|
151 |
$this->array_to_xml($value, $subnode);
|
152 |
} else {
|
153 |
+
$xml_data->addChild("$key", htmlspecialchars("$value"));
|
154 |
}
|
155 |
}
|
156 |
}
|
157 |
|
158 |
+
protected function addAttributeTranslateOriginal($attributeData)
|
159 |
+
{
|
|
|
160 |
|
161 |
+
// $writeConnection = $this->getWriteAdapter();
|
162 |
+
//
|
163 |
+
// $query = 'INSERT INTO `' . Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/straker_attribute_translate') . '` (`job_id`, `attribute_id`, `original`) VALUES ';
|
164 |
+
// $queryVals = array();
|
165 |
+
//
|
166 |
+
// foreach ($attributeData as $attributeId => $translate) {
|
167 |
+
//
|
168 |
+
// $original = array();
|
169 |
+
//
|
170 |
+
// $original['title'] = $translate['label'] ? Mage::getModel('catalog/resource_eav_attribute')->load($attributeId)->getStoreLabel($this->getSourceStore()) : '';
|
171 |
+
//
|
172 |
+
//
|
173 |
+
// if ($translate['option']) {
|
174 |
+
// $attributeOptioinCollection = Mage::getModel('eav/entity_attribute_option')
|
175 |
+
// ->getCollection()
|
176 |
+
// ->setStoreFilter($this->getSourceStore())
|
177 |
+
// ->setAttributeFilter($attributeId);
|
178 |
+
//
|
179 |
+
// foreach ($attributeOptioinCollection as $attributeOptioin) {
|
180 |
+
// $original['option']['id_' . $attributeOptioin->getoptionId()] = $attributeOptioin->getValue();
|
181 |
+
// }
|
182 |
+
// }
|
183 |
+
//
|
184 |
+
// $xml = new SimpleXMLElement('<attribute/>');
|
185 |
+
//
|
186 |
+
// $this->array_to_xml($original, $xml);
|
187 |
+
//
|
188 |
+
//
|
189 |
+
// $queryVals[] = '(' . $this->getId() . ', ' . $attributeId . ', \'' . addslashes($xml->asXML()) . '\')';
|
190 |
+
//
|
191 |
+
//
|
192 |
+
// }
|
193 |
+
//
|
194 |
+
// $writeConnection->query($query . implode(',', $queryVals));
|
195 |
+
|
196 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/attribute_translate');
|
197 |
+
// . '` (`job_id`, `attribute_id`, `original`) VALUES ';
|
198 |
|
199 |
foreach ($attributeData as $attributeId => $translate) {
|
|
|
200 |
$original = array();
|
|
|
201 |
$original['title'] = $translate['label'] ? Mage::getModel('catalog/resource_eav_attribute')->load($attributeId)->getStoreLabel($this->getSourceStore()) : '';
|
202 |
+
if ($translate['option']) {
|
|
|
|
|
203 |
$attributeOptioinCollection = Mage::getModel('eav/entity_attribute_option')
|
204 |
->getCollection()
|
205 |
->setStoreFilter($this->getSourceStore())
|
206 |
->setAttributeFilter($attributeId);
|
|
|
207 |
foreach ($attributeOptioinCollection as $attributeOptioin) {
|
208 |
+
$original['option']['id_' . $attributeOptioin->getoptionId()] = $attributeOptioin->getValue();
|
209 |
}
|
210 |
}
|
|
|
211 |
$xml = new SimpleXMLElement('<attribute/>');
|
|
|
212 |
$this->array_to_xml($original, $xml);
|
213 |
+
//$queryVals[] = '(' . $this->getId() . ', ' . $attributeId . ', \'' . addslashes($xml->asXML()) . '\')';
|
214 |
+
$model->setJobId($this->getId());
|
215 |
+
$model->setAttributeId($attributeId);
|
216 |
+
$model->setOriginal($xml->asXML());
|
217 |
+
$model->save();
|
218 |
+
$model->unsetData();
|
219 |
}
|
220 |
|
221 |
+
// $writeConnection->query($query . implode(',', $queryVals));
|
222 |
|
223 |
return $this;
|
224 |
|
225 |
|
|
|
226 |
}
|
227 |
|
228 |
|
229 |
+
protected function addAttributeIds($attributeData)
|
230 |
+
{
|
231 |
|
232 |
|
233 |
+
// $writeConnection = $this->getWriteAdapter();
|
234 |
+
//
|
235 |
+
// $query = 'INSERT INTO `' . Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_attribute') . '` (`attribute_id`, `translate_label`, `translate_option`, `job_id` ) VALUES ';
|
236 |
+
// $queryVals = array();
|
237 |
+
//
|
238 |
+
// foreach ($attributeData as $attributeId => $translate) {
|
239 |
+
//
|
240 |
+
// $queryVals[] = '(' . (int)$attributeId . ', ' . $translate['label'] . ', ' . $translate['option'] . ', ' . $this->getId() . ')';
|
241 |
+
// }
|
242 |
+
//
|
243 |
+
// $writeConnection->query($query . implode(',', $queryVals));
|
244 |
|
|
|
245 |
|
246 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute');
|
247 |
+
// . '` (`attribute_id`, `translate_label`, `translate_option`, `job_id` ) VALUES ';
|
248 |
|
249 |
foreach ($attributeData as $attributeId => $translate) {
|
250 |
+
$model->setAttributeId($attributeId);
|
251 |
+
$model->setTranslateLabel($translate['label']);
|
252 |
+
$model->setTranslateOption($translate['option']);
|
253 |
+
$model->setJobId($this->getId());
|
254 |
+
$model->save();
|
255 |
+
$model->unsetData();
|
256 |
}
|
257 |
|
|
|
|
|
258 |
return $this;
|
259 |
|
260 |
}
|
261 |
|
262 |
|
263 |
+
public function addProducts($productAttributeIds, $productIds)
|
264 |
+
{
|
265 |
|
266 |
+
if (!$this->getId()) {
|
267 |
+
if (!$this->getStoreId()) {
|
268 |
Mage::throwException('Error: Missing Store Id');
|
269 |
}
|
270 |
+
$this->setSourceStore(Mage::getStoreConfig('straker/general/source', $this->getStoreId()));
|
271 |
$this->save();
|
272 |
}
|
273 |
|
276 |
$countProducts = sizeof($productIds);
|
277 |
$buffer = 1000;
|
278 |
$_productIdSet = array();
|
279 |
+
for ($i = 0; $i < $countProducts; $i = $i + $buffer) {
|
280 |
+
$_productIdSet[] = array_slice($productIds, $i, $buffer);
|
281 |
}
|
282 |
|
283 |
foreach ($_productIdSet as $_productIds) {
|
294 |
$productCollection->addAttributeToSelect($productAttributeCode);
|
295 |
}
|
296 |
|
297 |
+
$productCollection->addFieldToFilter('entity_id', array('in' => $_productIds));
|
298 |
|
299 |
+
foreach ($productAttributeIds as $productAttributeId) {
|
300 |
$this->addProductTranslateOriginal($productAttributeId, $productCollection);
|
301 |
}
|
302 |
}
|
303 |
return $this;
|
304 |
}
|
305 |
|
306 |
+
public function addCategories($categoryAttributeIds, $categoryIds)
|
307 |
+
{
|
308 |
|
309 |
+
if (!$this->getId()) {
|
310 |
+
if (!$this->getStoreId()) {
|
311 |
Mage::throwException('Error: Missing Store Id');
|
312 |
}
|
313 |
+
$this->setSourceStore(Mage::getStoreConfig('straker/general/source', $this->getStoreId()));
|
314 |
$this->save();
|
315 |
}
|
316 |
|
319 |
$countCategories = sizeof($categoryIds);
|
320 |
$buffer = 1000;
|
321 |
$_categoryIdSet = array();
|
322 |
+
for ($i = 0; $i < $countCategories; $i = $i + $buffer) {
|
323 |
+
$_categoryIdSet[] = array_slice($categoryIds, $i, $buffer);
|
324 |
}
|
325 |
|
326 |
foreach ($_categoryIdSet as $_categoryIds) {
|
337 |
$categoryCollection->addAttributeToSelect($categoryAttributeCode);
|
338 |
}
|
339 |
|
340 |
+
$categoryCollection->addFieldToFilter('entity_id', array('in' => $_categoryIds));
|
341 |
|
342 |
+
foreach ($categoryAttributeIds as $categoryAttributeId) {
|
343 |
$this->addCategoryTranslateOriginal($categoryAttributeId, $categoryCollection);
|
344 |
}
|
345 |
}
|
346 |
return $this;
|
347 |
}
|
348 |
|
349 |
+
public function addAttributes($attributeData)
|
350 |
+
{
|
351 |
|
352 |
+
if (!$this->getId()) {
|
353 |
+
if (!$this->getStoreId()) {
|
354 |
Mage::throwException('Error: Missing Store Id');
|
355 |
}
|
356 |
+
$this->setSourceStore(Mage::getStoreConfig('straker/general/source', $this->getStoreId()));
|
357 |
$this->save();
|
358 |
}
|
359 |
|
365 |
}
|
366 |
|
367 |
|
368 |
+
public function addCmsEntities($ids, $Columns = array(), $type = 'page')
|
369 |
+
{
|
370 |
|
371 |
+
if (!$this->getId()) {
|
372 |
+
if (!$this->getStoreId()) {
|
373 |
Mage::throwException('Error: Missing Store Id');
|
374 |
}
|
375 |
+
$this->setSourceStore(Mage::getStoreConfig('straker/general/source', $this->getStoreId()));
|
376 |
$this->save();
|
377 |
}
|
378 |
|
379 |
foreach ($Columns as $Column) {
|
380 |
$this->_attributes[] =
|
381 |
+
Mage::getModel('strakertranslations_easytranslationplatform/cms_' . $type . '_attributes')
|
382 |
+
->setJobId($this->getId())
|
383 |
+
->setColumnName($Column)
|
384 |
+
->save();
|
385 |
}
|
386 |
|
387 |
+
// $writeConnection = $this->getWriteAdapter();
|
388 |
+
//
|
389 |
+
// $searchQuery = 'SELECT * FROM ' . Mage::getSingleton('core/resource')->getTableName('cms/' . $type)
|
390 |
+
// . ' WHERE ' . $type . '_id IN (' . implode(',', $ids) . ')';
|
391 |
+
//
|
392 |
+
// $cmsDataCollection = $writeConnection->fetchAll($searchQuery);
|
393 |
+
|
394 |
+
$cmsDataCollection = Mage::getResourceModel('cms/' . $type.'_collection')
|
395 |
+
->addFieldToFilter($type.'_id', ['in' => $ids])
|
396 |
+
->getData();
|
397 |
+
|
398 |
+
// $query = 'INSERT INTO `'
|
399 |
+
// . Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_cms' . $type)
|
400 |
+
// . '` (`' . $type . '_id`, `job_id` , `origin`) VALUES ';
|
401 |
+
//
|
402 |
+
// $queryVals = array();
|
403 |
+
//
|
404 |
+
// foreach ($cmsDataCollection as $cmsData) {
|
405 |
+
// $id = $cmsData[$type . '_id'];
|
406 |
+
//
|
407 |
+
// unset($cmsData[$type . '_id']);
|
408 |
+
//
|
409 |
+
//
|
410 |
+
// $queryVals[] = "(" . (int)$id . ", " . $this->getId() . ", '" . addslashes(json_encode($cmsData)) . "')";
|
411 |
+
// }
|
412 |
+
//
|
413 |
+
// $writeConnection->query($query . implode(',', $queryVals));
|
414 |
+
|
415 |
+
$model = Mage::getModel('strakertranslations_easytranslationplatform/job_cms_' . $type);
|
416 |
+
//. '` (`' . $type . '_id`, `job_id` , `origin`) VALUES ';
|
417 |
|
418 |
foreach ($cmsDataCollection as $cmsData) {
|
419 |
+
$id = $cmsData[$type . '_id'];
|
420 |
+
unset($cmsData[$type . '_id']);
|
421 |
+
$model->setData($type.'_id', $id);
|
422 |
+
$model->setJobId($this->getId());
|
423 |
+
$model->setOrigin(json_encode($cmsData));
|
424 |
+
$model->save();
|
425 |
+
$model->unsetData();
|
426 |
}
|
427 |
|
428 |
+
$writeConnection = $this->getWriteAdapter();
|
429 |
|
430 |
+
// $query = 'SELECT id, ' . $type . '_id FROM ' . Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_cms' . $type)
|
431 |
+
// . ' WHERE job_id = ' . $this->getId();
|
432 |
+
//
|
433 |
+
// $jobCmsIds = $writeConnection->fetchPairs($query);
|
434 |
|
435 |
+
$jobCmsIds = Mage::getResourceModel('strakertranslations_easytranslationplatform/job_cms_' . $type . '_collection')
|
436 |
+
->addFieldToSelect('id')
|
437 |
+
->addFieldToSelect($type.'_id')
|
438 |
+
->addFieldToFilter('job_id', ['eq' => $this->getId()])
|
439 |
+
->getData();
|
440 |
|
441 |
foreach ($Columns as $Column) {
|
442 |
+
$this->addCmsTranslateOriginal($Column, $cmsDataCollection, $type, $jobCmsIds);
|
443 |
}
|
444 |
|
|
|
445 |
$this->_createCMSTranslateFile($type);
|
446 |
+
return $this;
|
|
|
|
|
|
|
|
|
|
|
447 |
}
|
448 |
|
449 |
+
protected function _createCMSTranslateFile($type)
|
450 |
+
{
|
451 |
|
452 |
+
$_xml = new DOMDocument('1.0', 'utf-8');
|
453 |
+
$_xml->formatOutput = true;
|
454 |
|
455 |
+
$rootElement = $_xml->createElement('root');
|
|
|
456 |
|
457 |
+
$cmsTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/cms_' . $type . '_translate')->getCollection($this->getWriteAdapter());
|
458 |
+
$cmsTranslateCollection->addFieldToFilter('job_id', $this->getId());
|
459 |
+
foreach ($cmsTranslateCollection as $cmsTranslate) {
|
460 |
+
$dataElement = $_xml->createElement('data');
|
461 |
+
$dataElement->setAttribute('name', 'cms_' . $type . '_' . $cmsTranslate->getJobCmsId() . '_' . $cmsTranslate->getColumnName());
|
462 |
+
$dataElement->setAttribute('content_context', $cmsTranslate->getColumnName());
|
463 |
+
$dataElement->setAttribute('content_id', $cmsTranslate->getId());
|
464 |
|
465 |
+
$valueElement = $_xml->createElement('value');
|
466 |
+
$CDATAValueNode = $_xml->createCDATASection($cmsTranslate->getOriginal());
|
467 |
+
$valueElement->appendChild($CDATAValueNode);
|
|
|
|
|
|
|
468 |
|
469 |
+
$dataElement->appendChild($valueElement);
|
470 |
+
$rootElement->appendChild($dataElement);
|
471 |
+
}
|
472 |
+
$_xml->appendChild($rootElement);
|
473 |
+
file_put_contents(MAGENTO_ROOT . $this->_translateFilePath . 'job' . $this->getId() . '.xml', $_xml->saveXML());
|
474 |
+
$this->setSourceFile('job' . $this->getId() . '.xml')->save();
|
475 |
|
476 |
return $this;
|
477 |
|
478 |
|
479 |
}
|
480 |
|
481 |
+
// protected function _createProductTranslateFile() {
|
482 |
+
//
|
483 |
+
// $_xml = '/</?xml version="1.0" encoding="utf-8"/?/>/<root//>';
|
484 |
+
//
|
485 |
+
// $productTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/product_translate')->getCollection($this->getWriteAdapter());
|
486 |
+
// $productTranslateCollection->addFieldToFilter('job_id',$this->getId());
|
487 |
+
//
|
488 |
+
// $attributeFrontLabel = array();
|
489 |
+
//
|
490 |
+
// foreach ($productTranslateCollection as $productTranslate ){
|
491 |
+
// if (!isset($attributeFrontLabel[$productTranslate->getAttributeId()])){
|
492 |
+
// $attributeFrontLabel[$productTranslate->getAttributeId()] =
|
493 |
+
// Mage::getModel('eav/entity_attribute')->load($productTranslate->getAttributeId())->getFrontendLabel();
|
494 |
+
// }
|
495 |
+
//
|
496 |
+
// $_xml .= '<data name="' .$this->getTypeId(). '_' . $this->getStoreId().'_'. $productTranslate->getAttributeId().'_'. $productTranslate->getProductId().'" ' ;
|
497 |
+
// $_xml .= 'content_context="' . $attributeFrontLabel[$productTranslate->getAttributeId()] . '" ';
|
498 |
+
// $_xml .= 'content_context_url="'.Mage::getStoreConfig('web/unsecure/base_link_url',$this->getStoreId()).'catalog/category/view/id/'.$productTranslate->getProductId().'" ';
|
499 |
+
// $_xml .= 'content_id="'. $productTranslate->getId() .'">';
|
500 |
+
// $_xml .= '<value><![CDATA['.$productTranslate->getOriginal().']]></value></data>';
|
501 |
+
// }
|
502 |
+
// $_xml .='</root>';
|
503 |
+
//
|
504 |
+
// file_put_contents(MAGENTO_ROOT.$this->_translateFilePath.'job'.$this->getId().'.xml',$_xml);
|
505 |
+
// $this->setSourceFile('job'.$this->getId().'.xml')->save() ;
|
506 |
+
//
|
507 |
+
// return $this;
|
508 |
+
// }
|
509 |
+
|
510 |
+
protected function _createProductTranslateFile()
|
511 |
+
{
|
512 |
+
$_xml = new DOMDocument('1.0', 'utf-8');
|
513 |
+
$_xml->formatOutput = true;
|
514 |
|
515 |
+
$rootElement = $_xml->createElement('root');
|
516 |
|
517 |
$productTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/product_translate')->getCollection($this->getWriteAdapter());
|
518 |
+
$productTranslateCollection->addFieldToFilter('job_id', $this->getId());
|
519 |
|
520 |
$attributeFrontLabel = array();
|
521 |
|
522 |
+
foreach ($productTranslateCollection as $productTranslate) {
|
523 |
+
if (!isset($attributeFrontLabel[$productTranslate->getAttributeId()])) {
|
524 |
$attributeFrontLabel[$productTranslate->getAttributeId()] =
|
525 |
Mage::getModel('eav/entity_attribute')->load($productTranslate->getAttributeId())->getFrontendLabel();
|
526 |
}
|
527 |
|
528 |
+
$dataElement = $_xml->createElement('data');
|
529 |
+
$dataElement->setAttribute('name', $this->getTypeId() . '_' . $this->getStoreId() . '_' . $productTranslate->getAttributeId() . '_' . $productTranslate->getProductId());
|
530 |
+
$dataElement->setAttribute('content_context', $attributeFrontLabel[$productTranslate->getAttributeId()]);
|
531 |
+
$dataElement->setAttribute('content_context_url',Mage::getStoreConfig('web/unsecure/base_link_url', $this->getStoreId()) . 'catalog/category/view/id/' . $productTranslate->getProductId());
|
532 |
+
$dataElement->setAttribute('content_id', $productTranslate->getId());
|
533 |
+
|
534 |
+
$valueElement = $_xml->createElement('value');
|
535 |
+
$CDATAValueNode = $_xml->createCDATASection($productTranslate->getOriginal());
|
536 |
+
$valueElement->appendChild($CDATAValueNode);
|
537 |
+
|
538 |
+
$dataElement->appendChild($valueElement);
|
539 |
+
$rootElement->appendChild($dataElement);
|
540 |
}
|
|
|
541 |
|
542 |
+
$_xml->appendChild($rootElement);
|
543 |
+
file_put_contents(Mage::getBaseDir() . $this->_translateFilePath . 'job' . $this->getId() . '.xml', $_xml->saveXML());
|
544 |
+
$this->setSourceFile('job' . $this->getId() . '.xml')->save();
|
545 |
|
546 |
return $this;
|
547 |
}
|
548 |
|
549 |
+
protected function _createCategoryTranslateFile()
|
550 |
+
{
|
551 |
+
|
552 |
+
$_xml = new DOMDocument('1.0', 'utf-8');
|
553 |
+
$_xml->formatOutput = true;
|
554 |
|
555 |
+
$rootElement = $_xml->createElement('root');
|
556 |
|
557 |
$categoryTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/category_translate')->getCollection();
|
558 |
+
$categoryTranslateCollection->addFieldToFilter('job_id', $this->getId());
|
559 |
|
560 |
$attributeFrontLabel = array();
|
561 |
|
562 |
+
foreach ($categoryTranslateCollection as $categoryTranslate) {
|
563 |
+
if (!isset($attributeFrontLabel[$categoryTranslate->getAttributeId()])) {
|
564 |
$attributeFrontLabel[$categoryTranslate->getAttributeId()] =
|
565 |
Mage::getModel('eav/entity_attribute')->load($categoryTranslate->getAttributeId())->getFrontendLabel();
|
566 |
}
|
567 |
|
568 |
+
$dataElement = $_xml->createElement('data');
|
569 |
+
$dataElement->setAttribute('name', $this->getTypeId() . '_' . $this->getStoreId() . '_' . $categoryTranslate->getAttributeId() . '_' . $categoryTranslate->getCategoryId());
|
570 |
+
$dataElement->setAttribute('content_context',$attributeFrontLabel[$categoryTranslate->getAttributeId()]);
|
571 |
+
$dataElement->setAttribute('content_context_url', Mage::getStoreConfig('web/unsecure/base_link_url', $this->getStoreId()) . 'catalog/category/view/id/' . $categoryTranslate->getCategoryId());
|
572 |
+
$dataElement->setAttribute('content_id', $categoryTranslate->getId());
|
573 |
+
|
574 |
+
$valueElement = $_xml->createElement('value');
|
575 |
+
$CDATAValueNode = $_xml->createCDATASection($categoryTranslate->getOriginal());
|
576 |
+
$valueElement->appendChild($CDATAValueNode);
|
577 |
+
|
578 |
+
$dataElement->appendChild($valueElement);
|
579 |
+
$rootElement->appendChild($dataElement);
|
580 |
}
|
|
|
581 |
|
582 |
+
$_xml->appendChild($rootElement);
|
583 |
+
file_put_contents(Mage::getBaseDir() . $this->_translateFilePath . 'job' . $this->getId() . '.xml', $_xml->saveXML());
|
584 |
+
$this->setSourceFile('job' . $this->getId() . '.xml')->save();
|
585 |
|
586 |
return $this;
|
587 |
}
|
588 |
|
589 |
+
protected function _createAttributeTranslateFile()
|
590 |
+
{
|
591 |
+
|
592 |
+
$_xml = new DOMDocument('1.0', 'utf-8');
|
593 |
+
$_xml->formatOutput = true;
|
594 |
|
595 |
+
$rootElement = $_xml->createElement('root');
|
596 |
|
597 |
$attributeTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/attribute_translate')->getCollection();
|
598 |
+
$attributeTranslateCollection->addFieldToFilter('job_id', $this->getId());
|
599 |
+
|
600 |
+
foreach ($attributeTranslateCollection as $attributeTranslate) {
|
601 |
+
|
602 |
+
$dataInJson = json_encode(simplexml_load_string($attributeTranslate->getOriginal()));
|
603 |
+
$data = json_decode($dataInJson, true);
|
604 |
|
605 |
+
foreach ($data as $k => $attribute) {
|
606 |
+
if ($k == 'title' && $attribute) {
|
607 |
+
$dataElement = $_xml->createElement('data');
|
608 |
+
$dataElement->setAttribute('name', $this->getTypeId() . '_' . $this->getStoreId() . '_' . $attributeTranslate->getAttributeId());
|
609 |
+
$dataElement->setAttribute('content_context', 'product attribute title');
|
610 |
+
$dataElement->setAttribute('content_id', $attributeTranslate->getId());
|
611 |
|
612 |
+
$valueElement = $_xml->createElement('value');
|
613 |
+
$CDATAValueNode = $_xml->createCDATASection($attribute);
|
614 |
+
$valueElement->appendChild($CDATAValueNode);
|
615 |
|
616 |
+
$dataElement->appendChild($valueElement);
|
617 |
+
$rootElement->appendChild($dataElement);
|
|
|
|
|
|
|
|
|
618 |
}
|
619 |
|
620 |
+
if ($k = 'option') {
|
621 |
foreach ($attribute as $optionId => $optionValue) {
|
622 |
+
$dataElement = $_xml->createElement('data');
|
623 |
+
$dataElement->setAttribute('name', $this->getTypeId() . '_' . $this->getStoreId() . '_' . $attributeTranslate->getAttributeId());
|
624 |
+
$dataElement->setAttribute('content_context', 'product attribute option');
|
625 |
+
$dataElement->setAttribute('option_id', $optionId);
|
626 |
+
$dataElement->setAttribute('content_id', $attributeTranslate->getId());
|
627 |
+
|
628 |
+
$valueElement = $_xml->createElement('value');
|
629 |
+
$CDATAValueNode = $_xml->createCDATASection($optionValue);
|
630 |
+
$valueElement->appendChild($CDATAValueNode);
|
631 |
+
|
632 |
+
$dataElement->appendChild($valueElement);
|
633 |
+
$rootElement->appendChild($dataElement);
|
634 |
}
|
635 |
|
636 |
}
|
637 |
|
638 |
}
|
639 |
}
|
640 |
+
$_xml->appendChild($rootElement);
|
641 |
+
file_put_contents(Mage::getBaseDir() . $this->_translateFilePath . 'job' . $this->getId() . '.xml', $_xml->saveXML());
|
642 |
+
$this->setSourceFile('job' . $this->getId() . '.xml')->save();
|
|
|
643 |
|
644 |
return $this;
|
645 |
}
|
646 |
|
647 |
+
protected function _summitJob()
|
648 |
+
{
|
649 |
|
650 |
$request = array();
|
651 |
|
652 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
653 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
654 |
+
if ($helper->isSandboxMode()) {
|
655 |
+
$this->setIsTestJob(true);
|
656 |
+
}
|
657 |
+
|
658 |
+
if (!$this->getTitle()) {
|
659 |
$store = Mage::getModel('core/store')->load($this->getStoreId());
|
660 |
+
$defaultTitle = $store->getFrontendName() . '_' . $store->getName() . '_' . Mage::getModel('core/date')->timestamp();
|
661 |
$this->setTitle($defaultTitle);
|
662 |
}
|
663 |
$request['title'] = $this->getTitle();
|
664 |
+
$request['sl'] = $this->getSl();
|
665 |
+
$request['tl'] = $this->getTl();
|
|
|
|
|
666 |
|
667 |
+
$filePath = MAGENTO_ROOT . $this->_translateFilePath . $this->getSourceFile();
|
|
|
|
|
668 |
|
669 |
+
$request['source_file'] = function_exists('curl_file_create') ? curl_file_create($filePath) : '@' . $filePath;
|
670 |
+
$request['callback_uri'] = Mage::getStoreConfig('web/unsecure/base_link_url', $this->getStoreId()) . 'straker/callback';
|
671 |
+
$request['token'] = $this->getId();
|
672 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Api $api */
|
673 |
$api = $this->_getApi();
|
674 |
$response = $api->callTranslate($request);
|
675 |
+
if ($response->job_key) {
|
676 |
$this->setStatusId(2)
|
677 |
->setJobKey($response->job_key)
|
678 |
->setTjNumber($response->tj_number)
|
679 |
->save();
|
680 |
$this->setLastStatus(1);
|
681 |
+
} else {
|
|
|
682 |
$this->setLastStatus(0);
|
683 |
+
$message = $response->magentoMessage ? $response->magentoMessage : 'Unknown Error.';
|
684 |
$this->setLastMessage($message);
|
685 |
}
|
686 |
return $this;
|
687 |
|
688 |
}
|
689 |
|
690 |
+
public function submitProducts($productAttributeIds, $productIds)
|
691 |
+
{
|
692 |
|
693 |
//product
|
694 |
$this->setTypeId(1);
|
698 |
return $this;
|
699 |
}
|
700 |
|
701 |
+
public function submitCategories($categoryAttributeIds, $categoryIds)
|
702 |
+
{
|
703 |
|
704 |
//category
|
705 |
$this->setTypeId(3);
|
709 |
return $this;
|
710 |
}
|
711 |
|
712 |
+
public function submitAttributes($attributeData)
|
713 |
+
{
|
714 |
|
715 |
//category
|
716 |
$this->setTypeId(4);
|
720 |
return $this;
|
721 |
}
|
722 |
|
723 |
+
public function submitCmsPage($cmsIds, $columns = array('title', 'content'))
|
724 |
+
{
|
725 |
|
726 |
$this->setTypeId(5);
|
727 |
+
$this->addCmsEntities($cmsIds, $columns, 'page')
|
728 |
+
->_summitJob();
|
729 |
return $this;
|
730 |
}
|
731 |
|
732 |
+
public function submitCmsblock($cmsIds, $columns = array('title', 'content'))
|
733 |
+
{
|
734 |
|
735 |
$this->setTypeId(6);
|
736 |
+
$this->addCmsEntities($cmsIds, $columns, 'block')
|
737 |
+
->_summitJob();
|
738 |
return $this;
|
739 |
}
|
740 |
|
741 |
+
public function updateQuote()
|
742 |
+
{
|
743 |
|
744 |
+
if ($this->getJobKey()) {
|
745 |
$request = array();
|
746 |
$request['job_key'] = $this->getJobKey();
|
747 |
$api = $this->_getApi();
|
748 |
$response = $api->getTranslation($request);
|
749 |
|
750 |
if ($response->job) {
|
751 |
+
foreach ($response->job as $job) {
|
752 |
if ($job->token == $this->getId()) {
|
753 |
$quote = $job->quotation;
|
754 |
if ($quote && $quote != $this->getQuote()) {
|
763 |
|
764 |
}
|
765 |
|
766 |
+
public function updateTranslation()
|
767 |
+
{
|
768 |
$updateFlag = false;
|
769 |
+
if ($this->getJobKey()) {
|
770 |
$request = array();
|
771 |
$request['job_key'] = $this->getJobKey();
|
772 |
$api = $this->_getApi();
|
826 |
}
|
827 |
return $updateFlag;
|
828 |
}
|
829 |
+
|
830 |
protected function _getApi(){
|
831 |
|
832 |
return Mage::getModel('strakertranslations_easytranslationplatform/api',array('store'=>$this->getStoreId()));
|
833 |
}
|
834 |
|
835 |
+
protected function _getStatusId($statusName)
|
836 |
+
{
|
837 |
|
838 |
+
return Mage::getModel('strakertranslations_easytranslationplatform/job_status')->load($statusName, 'status_name')->getId();
|
839 |
}
|
840 |
|
841 |
+
protected function _importTranslation()
|
842 |
+
{
|
843 |
|
844 |
$xml = $this->_getApi()->getTranslatedFile($this->getDownloadUrl());
|
845 |
|
846 |
+
file_put_contents(Mage::getBaseDir() . $this->_translateFilePath . 'translated_job' . $this->getId() . '.xml', $xml, LOCK_EX);
|
847 |
|
848 |
$data = simplexml_load_string($xml);
|
849 |
|
851 |
|
852 |
foreach ($data->children() as $_translation) {
|
853 |
|
854 |
+
$_entityTranslationId = (string)$_translation->attributes()->content_id;
|
855 |
+
if ($this->_getType() == 'attribute') {
|
856 |
+
if ($_translation->attributes()->content_context == "product attribute title") {
|
857 |
+
$_translationValueGroup[$_entityTranslationId]['title'] = (string)$_translation->value;
|
858 |
}
|
859 |
|
860 |
+
if ($_translation->attributes()->content_context == "product attribute option") {
|
861 |
+
$_translationValueGroup[$_entityTranslationId]['option']['id_' . $_translation->attributes()->option_id] = (string)$_translation->value;
|
862 |
}
|
863 |
|
864 |
+
} else {
|
|
|
865 |
$_translationValueGroup[$_entityTranslationId] = (string)$_translation->value;
|
866 |
}
|
867 |
|
868 |
}
|
869 |
|
870 |
+
foreach ($_translationValueGroup as $content_id => $_translationValue) {
|
871 |
|
872 |
$value = $_translationValue;
|
873 |
|
874 |
+
if (is_array($_translationValue)) {
|
875 |
$xml = new SimpleXMLElement('<attribute/>');
|
876 |
+
$this->array_to_xml($_translationValue, $xml);
|
877 |
+
$value = (string)$xml->asXML();
|
878 |
}
|
879 |
|
880 |
|
881 |
+
$_entityTranslation = Mage::getModel('strakertranslations_easytranslationplatform/' . $this->_getType() . '_translate')->load($content_id);
|
882 |
$_entityTranslation->setTranslate($value);
|
883 |
$_entityTranslation->save();
|
884 |
$_entityTranslation->clearInstance();
|
888 |
|
889 |
}
|
890 |
|
891 |
+
protected function _getType()
|
892 |
+
{
|
893 |
return str_replace(' ', '_', strtolower($this->getTypeName()));
|
894 |
}
|
895 |
|
896 |
+
public function updatePayment()
|
897 |
+
{
|
898 |
|
899 |
+
if ($this->getJobKey()) {
|
900 |
$request = array();
|
901 |
$request['job_key'] = $this->getJobKey();
|
902 |
$api = $this->_getApi();
|
903 |
$response = $api->getPayment($request);
|
904 |
|
905 |
+
if (!empty($response) && $response->status == "Paid") { ///////waiting for payment api
|
906 |
$this->setPaymentStatus(1)->save();
|
907 |
return true;
|
908 |
}
|
910 |
return false;
|
911 |
}
|
912 |
|
913 |
+
public function applyTranslation($entityIds = array())
|
914 |
+
{
|
915 |
|
916 |
+
$collection = Mage::getModel('strakertranslations_easytranslationplatform/' . $this->_getType() . '_translate')->getCollection()->addFieldToFilter('job_id', $this->getId());
|
917 |
|
918 |
if ($entityIds) {
|
919 |
+
$collection->addFieldToFilter($this->_getType() . '_id', array('in' => $entityIds));
|
920 |
}
|
921 |
|
922 |
$updatedIds = array();
|
923 |
$writeConnection = $this->getWriteAdapter();
|
924 |
|
925 |
+
if (in_array($this->_getType(), array('cms_block', 'cms_page'))) {
|
926 |
$this->createNewCms($entityIds);
|
927 |
}
|
928 |
|
929 |
foreach ($collection as $translation) {
|
930 |
$translation->setStoreId($this->getStoreId())->importTranslation();
|
931 |
|
932 |
+
$entityId = call_user_func(array($translation, 'getData'), strtolower(str_replace(' ', '_', $this->getTypeName() . '_id')));
|
933 |
|
934 |
+
if (empty($updatedIds[$entityId])) {
|
935 |
$updatedIds[$entityId] = true;
|
936 |
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
937 |
+
if (in_array($this->_getType(), array('cms_block', 'cms_page'))) {
|
938 |
+
$cmstableName = str_replace('_', '', $this->_getType());
|
939 |
$cmsColumnName = str_replace('cms_', '', $this->_getType());
|
940 |
+
$entityId = $translation->getData($this->_getType() . '_id');
|
941 |
+
$writeConnection->update($prefix . 'straker_job_' . $cmstableName, array('version' => 1), $cmsColumnName . "_id = {$entityId} and job_id ={$this->getId()}");
|
942 |
+
} else {
|
943 |
+
$writeConnection->update($prefix . 'straker_job_' . $this->_getType(), array('version' => 1), $this->_getType() . "_id = {$entityId} and job_id ={$this->getId()}");
|
944 |
}
|
945 |
}
|
946 |
}
|
948 |
return true;
|
949 |
}
|
950 |
|
951 |
+
protected function createNewCms($entityIds)
|
952 |
+
{
|
953 |
|
954 |
|
955 |
$cmsType = str_replace('cms_', '', $this->_getType());
|
957 |
$cmsModelName = str_replace('_', '/', $this->_getType());
|
958 |
|
959 |
|
960 |
+
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_' . $this->_getType())->getCollection();
|
961 |
|
962 |
+
$collection->addFieldToFilter('job_id', $this->getId());
|
963 |
|
964 |
if ($entityIds) {
|
965 |
+
$collection->addFieldToFilter($cmsType . '_id', array('in' => $entityIds));
|
966 |
}
|
967 |
|
968 |
foreach ($collection as $jobCms) {
|
973 |
|
974 |
$cmsData = json_decode($jobCms->getOrigin());
|
975 |
|
976 |
+
foreach ($cmsData as $k => $v) {
|
977 |
+
$cmsModel->setData($k, $v);
|
978 |
}
|
979 |
+
//add target store id
|
980 |
+
// $cmsModel->setStores(array())->save();
|
981 |
+
$cmsModel->setStores([$this->getStoreId()])->save();
|
982 |
+
$jobCms->setNewEntityId($cmsModel->getId())->save();
|
983 |
|
984 |
}
|
985 |
|
991 |
{
|
992 |
if ($this->getStatusId() == 5) {
|
993 |
return true;
|
994 |
+
} elseif ($this->getStatusId() == 4) {
|
995 |
return $this->updatePublishedStatus()->getStatus() == 5;
|
996 |
+
} else {
|
|
|
997 |
return false;
|
998 |
}
|
999 |
}
|
1000 |
|
1001 |
+
protected function updatePublishedStatus()
|
1002 |
+
{
|
1003 |
+
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job_' . $this->_getType())->getCollection()->addFieldToFilter('job_id', $this->getId());
|
1004 |
$collection->addFieldToFilter('version',
|
1005 |
array(
|
1006 |
array('neq' => '1'),
|
1007 |
array('null' => true)
|
1008 |
)
|
1009 |
);
|
1010 |
+
if (!$collection->getFirstItem()->getId()) {
|
1011 |
$this->setStatusId(5)->save();
|
1012 |
}
|
1013 |
return $this;
|
1014 |
}
|
1015 |
|
1016 |
+
public function submitSupport(array $data)
|
1017 |
+
{
|
1018 |
|
1019 |
$res = $this->_getApi()->callSupport($data);
|
1020 |
|
1022 |
|
1023 |
}
|
1024 |
|
1025 |
+
public function checkAndCreateFolder()
|
1026 |
+
{
|
1027 |
|
1028 |
$ioAdapter = new Varien_Io_File();
|
1029 |
try {
|
1030 |
+
$ioAdapter->checkAndCreateFolder(Mage::getBaseDir('var') . DS . 'straker');
|
1031 |
+
} catch (Exception $e) {
|
|
|
1032 |
Mage::throwException($e->getMessage());
|
1033 |
}
|
1034 |
|
1036 |
|
1037 |
}
|
1038 |
|
1039 |
+
protected function getWriteAdapter()
|
1040 |
+
{
|
1041 |
return Mage::getSingleton('core/resource')->getConnection('core_write');
|
1042 |
}
|
1043 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job.php
CHANGED
@@ -13,14 +13,15 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job extends Mag
|
|
13 |
}
|
14 |
|
15 |
protected function _getLoadSelect($field, $value, $object) {
|
16 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
|
|
17 |
$select = parent::_getLoadSelect($field, $value, $object)
|
18 |
->join(array('t' => $this->getTable('strakertranslations_easytranslationplatform/job_type')),
|
19 |
-
|
20 |
array('type_name')
|
21 |
)
|
22 |
->join(array('s' => $this->getTable('strakertranslations_easytranslationplatform/job_status')),
|
23 |
-
|
24 |
array('status_name')
|
25 |
);
|
26 |
|
13 |
}
|
14 |
|
15 |
protected function _getLoadSelect($field, $value, $object) {
|
16 |
+
// $prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
17 |
+
$strakerJobTableName = $this->getTable('strakertranslations_easytranslationplatform/job');
|
18 |
$select = parent::_getLoadSelect($field, $value, $object)
|
19 |
->join(array('t' => $this->getTable('strakertranslations_easytranslationplatform/job_type')),
|
20 |
+
$strakerJobTableName.'.type_id=t.type_id',
|
21 |
array('type_name')
|
22 |
)
|
23 |
->join(array('s' => $this->getTable('strakertranslations_easytranslationplatform/job_status')),
|
24 |
+
$strakerJobTableName.'.status_id=s.status_id',
|
25 |
array('status_name')
|
26 |
);
|
27 |
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/System/Config/Source/SiteMode.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Adminhtml
|
23 |
+
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Used in creating options for Yes|No config value selection
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
class StrakerTranslations_EasyTranslationPlatform_Model_System_Config_Source_SiteMode{
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Options getter
|
35 |
+
*
|
36 |
+
* @return array
|
37 |
+
*/
|
38 |
+
public function toOptionArray()
|
39 |
+
{
|
40 |
+
return array(
|
41 |
+
array('value' => 0, 'label'=>Mage::helper('adminhtml')->__('Sandbox')),
|
42 |
+
array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('Live')),
|
43 |
+
);
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get options in "key-value" format
|
48 |
+
*
|
49 |
+
* @return array
|
50 |
+
*/
|
51 |
+
public function toArray()
|
52 |
+
{
|
53 |
+
return array(
|
54 |
+
0 => Mage::helper('adminhtml')->__('Sandbox'),
|
55 |
+
1 => Mage::helper('adminhtml')->__('Live'),
|
56 |
+
);
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/AttributeController.php
CHANGED
@@ -7,6 +7,8 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_AttributeCon
|
|
7 |
|
8 |
protected function _initAction()
|
9 |
{
|
|
|
|
|
10 |
$this
|
11 |
->loadLayout()
|
12 |
->_setActiveMenu('straker/job')
|
@@ -17,6 +19,8 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_AttributeCon
|
|
17 |
|
18 |
protected function _initNewAction()
|
19 |
{
|
|
|
|
|
20 |
$this
|
21 |
->loadLayout()
|
22 |
->_setActiveMenu('straker/new')
|
@@ -187,4 +191,11 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_AttributeCon
|
|
187 |
}
|
188 |
|
189 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
}
|
7 |
|
8 |
protected function _initAction()
|
9 |
{
|
10 |
+
$this->checkSiteMode();
|
11 |
+
|
12 |
$this
|
13 |
->loadLayout()
|
14 |
->_setActiveMenu('straker/job')
|
19 |
|
20 |
protected function _initNewAction()
|
21 |
{
|
22 |
+
$this->checkSiteMode();
|
23 |
+
|
24 |
$this
|
25 |
->loadLayout()
|
26 |
->_setActiveMenu('straker/new')
|
191 |
}
|
192 |
|
193 |
}
|
194 |
+
|
195 |
+
private function checkSiteMode(){
|
196 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
197 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
198 |
+
$helper->checkSiteMode();
|
199 |
+
}
|
200 |
+
|
201 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/CategoryController.php
CHANGED
@@ -8,6 +8,8 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_CategoryCont
|
|
8 |
|
9 |
protected function _initAction()
|
10 |
{
|
|
|
|
|
11 |
$this
|
12 |
->loadLayout()
|
13 |
->_setActiveMenu('straker/job')
|
@@ -18,6 +20,8 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_CategoryCont
|
|
18 |
|
19 |
protected function _initNewAction()
|
20 |
{
|
|
|
|
|
21 |
$this
|
22 |
->loadLayout()
|
23 |
->_setActiveMenu('straker/new')
|
@@ -206,4 +210,10 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_CategoryCont
|
|
206 |
}
|
207 |
|
208 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
8 |
|
9 |
protected function _initAction()
|
10 |
{
|
11 |
+
$this->checkSiteMode();
|
12 |
+
|
13 |
$this
|
14 |
->loadLayout()
|
15 |
->_setActiveMenu('straker/job')
|
20 |
|
21 |
protected function _initNewAction()
|
22 |
{
|
23 |
+
$this->checkSiteMode();
|
24 |
+
|
25 |
$this
|
26 |
->loadLayout()
|
27 |
->_setActiveMenu('straker/new')
|
210 |
}
|
211 |
|
212 |
}
|
213 |
+
|
214 |
+
private function checkSiteMode(){
|
215 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
216 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
217 |
+
$helper->checkSiteMode();
|
218 |
+
}
|
219 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/JobController.php
CHANGED
@@ -17,11 +17,24 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_JobControlle
|
|
17 |
|
18 |
public function indexAction(){
|
19 |
|
|
|
|
|
|
|
|
|
20 |
//todo refresh all jobs that is waiting on a quote. This should be refactored into different process.
|
|
|
21 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job')
|
22 |
->getCollection()
|
23 |
->addFieldToFilter('status_id', array('lt' => 4));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
if ($collection->count() > 1){
|
|
|
25 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job');
|
26 |
$response = $job->bulkUpdateTranslation();
|
27 |
if ( $response ) {
|
17 |
|
18 |
public function indexAction(){
|
19 |
|
20 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
21 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
22 |
+
$helper->checkSiteMode();
|
23 |
+
|
24 |
//todo refresh all jobs that is waiting on a quote. This should be refactored into different process.
|
25 |
+
/** @var $collection StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Collection */
|
26 |
$collection = Mage::getModel('strakertranslations_easytranslationplatform/job')
|
27 |
->getCollection()
|
28 |
->addFieldToFilter('status_id', array('lt' => 4));
|
29 |
+
|
30 |
+
// foreach($collection as $job){
|
31 |
+
// $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($job->getId());
|
32 |
+
// if ( $job->updateTranslation() ){
|
33 |
+
// Mage::getSingleton('core/session')->addSuccess($this->__('Job %s has been updated.', $job->getId()));
|
34 |
+
// }
|
35 |
+
// }
|
36 |
if ($collection->count() > 1){
|
37 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Model_Job $job */
|
38 |
$job = Mage::getModel('strakertranslations_easytranslationplatform/job');
|
39 |
$response = $job->bulkUpdateTranslation();
|
40 |
if ( $response ) {
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/NewController.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
protected function _isAllowed()
|
4 |
{
|
5 |
return Mage::getSingleton('admin/session')->isAllowed('admin/straker/new');
|
@@ -9,84 +11,87 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewControlle
|
|
9 |
{
|
10 |
$this
|
11 |
->loadLayout()
|
12 |
-
->_setActiveMenu('straker/new')
|
13 |
-
;
|
14 |
$this->_title($this->__('Create New Job'));
|
15 |
return $this;
|
16 |
}
|
17 |
|
18 |
-
public function accountAction()
|
|
|
19 |
$this->_redirectUrl("https://myaccount.strakertranslations.com/");
|
20 |
}
|
21 |
|
22 |
-
public function termsAction()
|
|
|
23 |
$this->_redirectUrl("https://www.strakertranslations.com/about-us/terms-and-conditions-of-service.cfm");
|
24 |
}
|
25 |
|
26 |
-
public function indexAction()
|
|
|
27 |
$params = $this->getRequest()->getParams();
|
28 |
-
if (Mage::helper('strakertranslations_easytranslationplatform')->getAppKey() === false || Mage::helper('strakertranslations_easytranslationplatform')->getAccessToken() === false){
|
29 |
return $this->_initAction()
|
30 |
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_register'))
|
31 |
->renderLayout();
|
32 |
-
}
|
33 |
-
|
34 |
return $this->_initAction()
|
35 |
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_selectstore'))
|
36 |
->renderLayout();
|
37 |
-
}
|
38 |
-
|
39 |
-
){
|
40 |
return $this->_initAction()
|
41 |
-
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_setupstore',
|
|
|
42 |
->renderLayout();
|
43 |
-
}
|
44 |
-
|
45 |
return $this->_initAction()
|
46 |
-
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_type','strakertranslations_easytranslationplatform_new_type',
|
|
|
47 |
->renderLayout();
|
48 |
}
|
49 |
}
|
50 |
|
51 |
-
public function registerAction()
|
|
|
52 |
|
53 |
$data = $this->getRequest()->getPost();
|
54 |
-
if (array_key_exists('form_key', $data)){
|
55 |
unset($data['form_key']);
|
56 |
}
|
57 |
if ($data['first_name'] && $data['last_name'] && $data['email'] && $data['terms']) {
|
58 |
-
if ($data['company'] == ''){
|
59 |
-
$data['company'] = $data['first_name'] .' '. $data['last_name'];
|
60 |
}
|
61 |
$apiModel = Mage::getModel('strakertranslations_easytranslationplatform/api');
|
62 |
$response = $apiModel->callRegister($data);
|
63 |
-
if($response->access_token && $response->application_key) {
|
64 |
$apiModel->saveAccessToken($response->access_token);
|
65 |
$apiModel->saveAppKey($response->application_key);
|
66 |
Mage::app()->getCacheInstance()->cleanType('config');
|
67 |
Mage::getSingleton('adminhtml/session')->addSuccess('Registration success.');
|
68 |
-
}
|
69 |
-
elseif($response->magentoMessage){
|
70 |
Mage::getSingleton('adminhtml/session')->addError($response->magentoMessage);
|
71 |
-
}
|
72 |
-
else{
|
73 |
Mage::getSingleton('adminhtml/session')->addError('Registration unsuccessful.');
|
74 |
}
|
75 |
}
|
76 |
$this->_redirect('*/*/');
|
77 |
}
|
78 |
|
79 |
-
public function selectstoreAction()
|
|
|
80 |
$store = $this->getRequest()->getParam('store');
|
81 |
-
if($store){
|
82 |
$this->_redirect('*/*/', array('store' => $store));
|
83 |
-
}
|
84 |
-
else {
|
85 |
$this->_redirect('*/*/');
|
86 |
}
|
87 |
}
|
88 |
|
89 |
-
public function setupstoreAction()
|
|
|
90 |
$data = $this->getRequest()->getParams();
|
91 |
if ($data['store'] && $data['source'] && $data['from'] && $data['to']) {
|
92 |
/** @var $session Mage_Admin_Model_Session */
|
@@ -95,12 +100,11 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewControlle
|
|
95 |
//save the source, language from and to in stystem config
|
96 |
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
97 |
|
98 |
-
if ($helper->saveStoreSetup($data['store'], $data['source'], $data['from'], $data['to']) !== false
|
99 |
Mage::app()->getCacheInstance()->cleanType('config');
|
100 |
$this->_redirect('*/*/', array('store' => $data['store']));
|
101 |
return;
|
102 |
-
}
|
103 |
-
else {
|
104 |
Mage::throwException(Mage::helper('strakertranslations_easytranslationplatform')->__('Unable to save store configurations.'));
|
105 |
}
|
106 |
} catch (Exception $e) {
|
@@ -121,11 +125,12 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewControlle
|
|
121 |
|
122 |
$apiModel->saveAccessToken('');
|
123 |
$apiModel->saveAppKey('');
|
124 |
-
|
125 |
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
126 |
foreach (Mage::app()->getStores() as $store) {
|
127 |
$helper->saveStoreSetup($store->getId(), '', '', '');
|
128 |
}
|
|
|
129 |
Mage::app()->getCacheInstance()->cleanType('config');
|
130 |
$session->addSuccess('Straker Settings has been cleared.');
|
131 |
|
@@ -177,29 +182,29 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewControlle
|
|
177 |
|
178 |
$writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
179 |
|
180 |
-
if ($writeConnection->query("SELECT 1 FROM catalog_product_entity_varchar_back LIMIT 1")){
|
181 |
|
182 |
$sql = 'DELETE FROM straker_job';
|
183 |
$writeConnection->query($sql);
|
184 |
|
185 |
-
|
186 |
|
187 |
-
|
188 |
|
189 |
-
|
190 |
|
191 |
-
|
192 |
|
193 |
-
|
194 |
|
195 |
-
|
196 |
|
197 |
-
|
198 |
|
199 |
-
|
200 |
|
201 |
-
|
202 |
-
|
203 |
|
204 |
} catch (Exception $e) {
|
205 |
$session->addError($e->getMessage());
|
@@ -209,20 +214,27 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewControlle
|
|
209 |
}
|
210 |
|
211 |
|
212 |
-
public function resetStoreSettingsAction()
|
|
|
213 |
$storeId = $this->getRequest()->getParam('store');
|
214 |
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
215 |
$session = Mage::getSingleton('adminhtml/session');
|
216 |
|
217 |
-
if($helper->getStoreSetup($storeId)){
|
218 |
$helper->saveStoreSetup($storeId, '', '', '');
|
219 |
$session->addSuccess($this->__('Language settings has been reset.'));
|
220 |
-
|
221 |
-
else{
|
222 |
$session->addError($this->__('Store code is not valid.'));
|
223 |
}
|
224 |
$this->_redirect('adminhtml/system_config/edit/section/straker');
|
225 |
return;
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewController extends Mage_Adminhtml_Controller_Action
|
4 |
+
{
|
5 |
protected function _isAllowed()
|
6 |
{
|
7 |
return Mage::getSingleton('admin/session')->isAllowed('admin/straker/new');
|
11 |
{
|
12 |
$this
|
13 |
->loadLayout()
|
14 |
+
->_setActiveMenu('straker/new');
|
|
|
15 |
$this->_title($this->__('Create New Job'));
|
16 |
return $this;
|
17 |
}
|
18 |
|
19 |
+
public function accountAction()
|
20 |
+
{
|
21 |
$this->_redirectUrl("https://myaccount.strakertranslations.com/");
|
22 |
}
|
23 |
|
24 |
+
public function termsAction()
|
25 |
+
{
|
26 |
$this->_redirectUrl("https://www.strakertranslations.com/about-us/terms-and-conditions-of-service.cfm");
|
27 |
}
|
28 |
|
29 |
+
public function indexAction()
|
30 |
+
{
|
31 |
$params = $this->getRequest()->getParams();
|
32 |
+
if (Mage::helper('strakertranslations_easytranslationplatform')->getAppKey() === false || Mage::helper('strakertranslations_easytranslationplatform')->getAccessToken() === false) {
|
33 |
return $this->_initAction()
|
34 |
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_register'))
|
35 |
->renderLayout();
|
36 |
+
} elseif (empty($params['store'])) {
|
37 |
+
$this->checkSiteMode();
|
38 |
return $this->_initAction()
|
39 |
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_selectstore'))
|
40 |
->renderLayout();
|
41 |
+
} elseif (Mage::helper('strakertranslations_easytranslationplatform')->getStoreSetup($params['store']) === false ) {
|
42 |
+
$this->checkSiteMode();
|
|
|
43 |
return $this->_initAction()
|
44 |
+
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_setupstore',
|
45 |
+
'strakertranslations_easytranslationplatform_new_setupstore', array('setup_store_id' => $params['store'])))
|
46 |
->renderLayout();
|
47 |
+
} else {
|
48 |
+
$this->checkSiteMode();
|
49 |
return $this->_initAction()
|
50 |
+
->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_type', 'strakertranslations_easytranslationplatform_new_type',
|
51 |
+
array('setup_store_id' => $params['store'])))
|
52 |
->renderLayout();
|
53 |
}
|
54 |
}
|
55 |
|
56 |
+
public function registerAction()
|
57 |
+
{
|
58 |
|
59 |
$data = $this->getRequest()->getPost();
|
60 |
+
if (array_key_exists('form_key', $data)) {
|
61 |
unset($data['form_key']);
|
62 |
}
|
63 |
if ($data['first_name'] && $data['last_name'] && $data['email'] && $data['terms']) {
|
64 |
+
if ($data['company'] == '') {
|
65 |
+
$data['company'] = $data['first_name'] . ' ' . $data['last_name'];
|
66 |
}
|
67 |
$apiModel = Mage::getModel('strakertranslations_easytranslationplatform/api');
|
68 |
$response = $apiModel->callRegister($data);
|
69 |
+
if ($response->access_token && $response->application_key) {
|
70 |
$apiModel->saveAccessToken($response->access_token);
|
71 |
$apiModel->saveAppKey($response->application_key);
|
72 |
Mage::app()->getCacheInstance()->cleanType('config');
|
73 |
Mage::getSingleton('adminhtml/session')->addSuccess('Registration success.');
|
74 |
+
} elseif ($response->magentoMessage) {
|
|
|
75 |
Mage::getSingleton('adminhtml/session')->addError($response->magentoMessage);
|
76 |
+
} else {
|
|
|
77 |
Mage::getSingleton('adminhtml/session')->addError('Registration unsuccessful.');
|
78 |
}
|
79 |
}
|
80 |
$this->_redirect('*/*/');
|
81 |
}
|
82 |
|
83 |
+
public function selectstoreAction()
|
84 |
+
{
|
85 |
$store = $this->getRequest()->getParam('store');
|
86 |
+
if ($store) {
|
87 |
$this->_redirect('*/*/', array('store' => $store));
|
88 |
+
} else {
|
|
|
89 |
$this->_redirect('*/*/');
|
90 |
}
|
91 |
}
|
92 |
|
93 |
+
public function setupstoreAction()
|
94 |
+
{
|
95 |
$data = $this->getRequest()->getParams();
|
96 |
if ($data['store'] && $data['source'] && $data['from'] && $data['to']) {
|
97 |
/** @var $session Mage_Admin_Model_Session */
|
100 |
//save the source, language from and to in stystem config
|
101 |
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
102 |
|
103 |
+
if ($helper->saveStoreSetup($data['store'], $data['source'], $data['from'], $data['to']) !== false) {
|
104 |
Mage::app()->getCacheInstance()->cleanType('config');
|
105 |
$this->_redirect('*/*/', array('store' => $data['store']));
|
106 |
return;
|
107 |
+
} else {
|
|
|
108 |
Mage::throwException(Mage::helper('strakertranslations_easytranslationplatform')->__('Unable to save store configurations.'));
|
109 |
}
|
110 |
} catch (Exception $e) {
|
125 |
|
126 |
$apiModel->saveAccessToken('');
|
127 |
$apiModel->saveAppKey('');
|
128 |
+
/** @var StrakerTranslations_EasyTranslationPlatform_Helper_Data $helper */
|
129 |
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
130 |
foreach (Mage::app()->getStores() as $store) {
|
131 |
$helper->saveStoreSetup($store->getId(), '', '', '');
|
132 |
}
|
133 |
+
$helper->clearSiteMode();
|
134 |
Mage::app()->getCacheInstance()->cleanType('config');
|
135 |
$session->addSuccess('Straker Settings has been cleared.');
|
136 |
|
182 |
|
183 |
$writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
184 |
|
185 |
+
if ($writeConnection->query("SELECT 1 FROM catalog_product_entity_varchar_back LIMIT 1")) {
|
186 |
|
187 |
$sql = 'DELETE FROM straker_job';
|
188 |
$writeConnection->query($sql);
|
189 |
|
190 |
+
$sql = 'TRUNCATE catalog_product_entity_varchar; INSERT INTO catalog_product_entity_varchar SELECT * FROM catalog_product_entity_varchar_back;';
|
191 |
|
192 |
+
$writeConnection->query($sql);
|
193 |
|
194 |
+
$sql = 'TRUNCATE catalog_product_entity_text; INSERT INTO catalog_product_entity_text SELECT * FROM catalog_product_entity_text_back;';
|
195 |
|
196 |
+
$writeConnection->query($sql);
|
197 |
|
198 |
+
$sql = 'TRUNCATE catalog_category_entity_varchar; INSERT INTO catalog_category_entity_varchar SELECT * FROM catalog_category_entity_varchar_back;';
|
199 |
|
200 |
+
$writeConnection->query($sql);
|
201 |
|
202 |
+
$sql = 'TRUNCATE catalog_category_entity_text; INSERT INTO catalog_category_entity_text SELECT * FROM catalog_category_entity_text_back;';
|
203 |
|
204 |
+
$writeConnection->query($sql);
|
205 |
|
206 |
+
$session->addSuccess('product and category entity tables has been restored ');
|
207 |
+
}
|
208 |
|
209 |
} catch (Exception $e) {
|
210 |
$session->addError($e->getMessage());
|
214 |
}
|
215 |
|
216 |
|
217 |
+
public function resetStoreSettingsAction()
|
218 |
+
{
|
219 |
$storeId = $this->getRequest()->getParam('store');
|
220 |
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
221 |
$session = Mage::getSingleton('adminhtml/session');
|
222 |
|
223 |
+
if ($helper->getStoreSetup($storeId)) {
|
224 |
$helper->saveStoreSetup($storeId, '', '', '');
|
225 |
$session->addSuccess($this->__('Language settings has been reset.'));
|
226 |
+
Mage::app()->getCacheInstance()->cleanType('config');
|
227 |
+
} else {
|
228 |
$session->addError($this->__('Store code is not valid.'));
|
229 |
}
|
230 |
$this->_redirect('adminhtml/system_config/edit/section/straker');
|
231 |
return;
|
232 |
}
|
233 |
|
234 |
+
private function checkSiteMode(){
|
235 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
236 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
237 |
+
$helper->checkSiteMode();
|
238 |
+
}
|
239 |
+
|
240 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/ProductController.php
CHANGED
@@ -7,6 +7,8 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_ProductContr
|
|
7 |
|
8 |
protected function _initAction()
|
9 |
{
|
|
|
|
|
10 |
$this
|
11 |
->loadLayout()
|
12 |
->_setActiveMenu('straker/job')
|
@@ -17,6 +19,8 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_ProductContr
|
|
17 |
|
18 |
protected function _initNewAction()
|
19 |
{
|
|
|
|
|
20 |
$this
|
21 |
->loadLayout()
|
22 |
->_setActiveMenu('straker/new')
|
@@ -194,4 +198,10 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_ProductContr
|
|
194 |
}
|
195 |
|
196 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
7 |
|
8 |
protected function _initAction()
|
9 |
{
|
10 |
+
$this->checkSiteMode();
|
11 |
+
|
12 |
$this
|
13 |
->loadLayout()
|
14 |
->_setActiveMenu('straker/job')
|
19 |
|
20 |
protected function _initNewAction()
|
21 |
{
|
22 |
+
$this->checkSiteMode();
|
23 |
+
|
24 |
$this
|
25 |
->loadLayout()
|
26 |
->_setActiveMenu('straker/new')
|
198 |
}
|
199 |
|
200 |
}
|
201 |
+
|
202 |
+
private function checkSiteMode(){
|
203 |
+
/** @var $helper StrakerTranslations_EasyTranslationPlatform_Helper_Data */
|
204 |
+
$helper = Mage::helper('strakertranslations_easytranslationplatform');
|
205 |
+
$helper->checkSiteMode();
|
206 |
+
}
|
207 |
}
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/data/strakertranslations_easytranslationplatform_setup/data-install-1.2.0.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$data = [
|
6 |
+
[ 'status_id' => 1, 'status_name' => 'INIT' ],
|
7 |
+
[ 'status_id' => 2, 'status_name' => 'QUEUED' ],
|
8 |
+
[ 'status_id' => 3, 'status_name' => 'IN_PROGRESS'],
|
9 |
+
[ 'status_id' => 4, 'status_name' => 'COMPLETED' ],
|
10 |
+
[ 'status_id' => 5, 'status_name' => 'PUBLISHED' ],
|
11 |
+
];
|
12 |
+
|
13 |
+
$installer->getConnection()->insertMultiple($installer->getTable('straker_job_status'), $data);
|
14 |
+
|
15 |
+
$data = [
|
16 |
+
[ 'type_id' => 1, 'type_name' => 'Product' ],
|
17 |
+
[ 'type_id' => 3, 'type_name' => 'Category' ],
|
18 |
+
[ 'type_id' => 4, 'type_name' => 'Attribute' ]
|
19 |
+
];
|
20 |
+
|
21 |
+
$installer->getConnection()->insertMultiple($installer->getTable('straker_job_type'), $data);
|
22 |
+
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/data/strakertranslations_easytranslationplatform_setup/data-upgrade-1.2.0-1.3.0.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$data = [
|
6 |
+
[ 'type_id' => 5, 'type_name' => 'CMS Page' ],
|
7 |
+
[ 'type_id' => 6, 'type_name' => 'CMS Block' ]
|
8 |
+
];
|
9 |
+
|
10 |
+
$installer->getConnection()->insertMultiple($installer->getTable('straker_job_type'), $data);
|
11 |
+
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<StrakerTranslations_EasyTranslationPlatform>
|
5 |
-
<version>1.3.
|
6 |
</StrakerTranslations_EasyTranslationPlatform>
|
7 |
</modules>
|
8 |
<global>
|
@@ -141,15 +141,15 @@
|
|
141 |
<default>
|
142 |
<straker>
|
143 |
<api_url>
|
144 |
-
<register>https://
|
145 |
-
<languages>https://
|
146 |
-
<translate>https://
|
147 |
-
<
|
148 |
-
<
|
149 |
-
<countries>https://
|
150 |
-
<payment>https://
|
151 |
<payment_page>https://myaccount.strakertranslations.com/o/?action=api.quote</payment_page>
|
152 |
-
<support>https://
|
153 |
</api_url>
|
154 |
</straker>
|
155 |
</default>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<StrakerTranslations_EasyTranslationPlatform>
|
5 |
+
<version>1.3.4</version>
|
6 |
</StrakerTranslations_EasyTranslationPlatform>
|
7 |
</modules>
|
8 |
<global>
|
141 |
<default>
|
142 |
<straker>
|
143 |
<api_url>
|
144 |
+
<register>https://app.strakertranslations.com/v1/ta1ma/register</register>
|
145 |
+
<languages>https://app.strakertranslations.com/v1/languages</languages>
|
146 |
+
<translate>https://app.strakertranslations.com/v1/ta1ma/translate</translate>
|
147 |
+
<translate_sandbox>https://app-sandbox.strakertranslations.com/v1/ta1ma/translate</translate_sandbox>
|
148 |
+
<quote>https://app.strakertranslations.com/v1/quote</quote>
|
149 |
+
<countries>https://app.strakertranslations.com/v1/countries</countries>
|
150 |
+
<payment>https://app.strakertranslations.com/v1/payment</payment>
|
151 |
<payment_page>https://myaccount.strakertranslations.com/o/?action=api.quote</payment_page>
|
152 |
+
<support>https://app.strakertranslations.com/v1/ta1ma/support</support>
|
153 |
</api_url>
|
154 |
</straker>
|
155 |
</default>
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/system.xml
CHANGED
@@ -24,22 +24,31 @@
|
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
<clear translate="label">
|
44 |
<label>Clear All Language Settings</label>
|
45 |
<frontend_type>button</frontend_type>
|
@@ -58,92 +67,100 @@
|
|
58 |
<show_in_website>1</show_in_website>
|
59 |
<show_in_store>1</show_in_store>
|
60 |
</store>
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
</fields>
|
80 |
</general>
|
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 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
</groups>
|
148 |
</straker>
|
149 |
</sections>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
27 |
+
<!--<site_mode translate="label comment" >-->
|
28 |
+
<!--<label>Site Mode</label>-->
|
29 |
+
<!--<frontend_type>select</frontend_type>-->
|
30 |
+
<!--<sort_order>0</sort_order>-->
|
31 |
+
<!--<source_model>strakertranslations_easytranslationplatform/system_config_source_siteMode</source_model>-->
|
32 |
+
<!--<show_in_default>1</show_in_default>-->
|
33 |
+
<!--<show_in_website>1</show_in_website>-->
|
34 |
+
<!--<show_in_store>1</show_in_store>-->
|
35 |
+
<!--</site_mode>-->
|
36 |
+
<!-- <access_token translate="label comment" > -->
|
37 |
+
<!-- <label>Access Token</label> -->
|
38 |
+
<!-- <frontend_type>text</frontend_type> -->
|
39 |
+
<!-- <sort_order>10</sort_order> -->
|
40 |
+
<!-- <show_in_default>1</show_in_default> -->
|
41 |
+
<!-- <show_in_website>1</show_in_website> -->
|
42 |
+
<!-- <show_in_store>1</show_in_store> -->
|
43 |
+
<!-- </access_token> -->
|
44 |
+
<!-- <application_key translate="label comment" > -->
|
45 |
+
<!-- <label>Application Key</label> -->
|
46 |
+
<!-- <frontend_type>text</frontend_type> -->
|
47 |
+
<!-- <sort_order>20</sort_order> -->
|
48 |
+
<!-- <show_in_default>1</show_in_default> -->
|
49 |
+
<!-- <show_in_website>1</show_in_website> -->
|
50 |
+
<!-- <show_in_store>1</show_in_store> -->
|
51 |
+
<!-- </application_key> -->
|
52 |
<clear translate="label">
|
53 |
<label>Clear All Language Settings</label>
|
54 |
<frontend_type>button</frontend_type>
|
67 |
<show_in_website>1</show_in_website>
|
68 |
<show_in_store>1</show_in_store>
|
69 |
</store>
|
70 |
+
<!-- <backup translate="label"> -->
|
71 |
+
<!-- <label>Backup Product Data</label> -->
|
72 |
+
<!-- <frontend_type>button</frontend_type> -->
|
73 |
+
<!-- <frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_backupbutton</frontend_model> -->
|
74 |
+
<!-- <sort_order>50</sort_order> -->
|
75 |
+
<!-- <show_in_default>1</show_in_default> -->
|
76 |
+
<!-- <show_in_website>1</show_in_website> -->
|
77 |
+
<!-- <show_in_store>1</show_in_store> -->
|
78 |
+
<!-- </backup> -->
|
79 |
+
<!-- <restore translate="label"> -->
|
80 |
+
<!-- <label>Backup Product Data</label> -->
|
81 |
+
<!-- <frontend_type>button</frontend_type> -->
|
82 |
+
<!-- <frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_restorebutton</frontend_model> -->
|
83 |
+
<!-- <sort_order>60</sort_order> -->
|
84 |
+
<!-- <show_in_default>1</show_in_default> -->
|
85 |
+
<!-- <show_in_website>1</show_in_website> -->
|
86 |
+
<!-- <show_in_store>1</show_in_store> -->
|
87 |
+
<!-- </restore> -->
|
88 |
</fields>
|
89 |
</general>
|
90 |
+
<!-- <api_url translate="label"> -->
|
91 |
+
<!-- <label>Api Url</label> -->
|
92 |
+
<!-- <frontend_type>text</frontend_type> -->
|
93 |
+
<!-- <sort_order>100</sort_order> -->
|
94 |
+
<!-- <show_in_default>1</show_in_default> -->
|
95 |
+
<!-- <show_in_website>1</show_in_website> -->
|
96 |
+
<!-- <show_in_store>1</show_in_store> -->
|
97 |
+
<!-- <fields> -->
|
98 |
+
<!-- <register translate="label comment" > -->
|
99 |
+
<!-- <label>Register</label> -->
|
100 |
+
<!-- <frontend_type>text</frontend_type> -->
|
101 |
+
<!-- <sort_order>10</sort_order> -->
|
102 |
+
<!-- <show_in_default>1</show_in_default> -->
|
103 |
+
<!-- <show_in_website>1</show_in_website> -->
|
104 |
+
<!-- <show_in_store>1</show_in_store> -->
|
105 |
+
<!-- </register> -->
|
106 |
+
<!-- <quote translate="label comment" > -->
|
107 |
+
<!-- <label>Quote</label> -->
|
108 |
+
<!-- <frontend_type>text</frontend_type> -->
|
109 |
+
<!-- <sort_order>20</sort_order> -->
|
110 |
+
<!-- <show_in_default>1</show_in_default> -->
|
111 |
+
<!-- <show_in_website>1</show_in_website> -->
|
112 |
+
<!-- <show_in_store>1</show_in_store> -->
|
113 |
+
<!-- </quote> -->
|
114 |
+
<!-- <countries translate="label comment" > -->
|
115 |
+
<!-- <label>Countries</label> -->
|
116 |
+
<!-- <frontend_type>text</frontend_type> -->
|
117 |
+
<!-- <sort_order>30</sort_order> -->
|
118 |
+
<!-- <show_in_default>1</show_in_default> -->
|
119 |
+
<!-- <show_in_website>1</show_in_website> -->
|
120 |
+
<!-- <show_in_store>1</show_in_store> -->
|
121 |
+
<!-- </countries> -->
|
122 |
+
<!-- <languages translate="label comment" > -->
|
123 |
+
<!-- <label>Languages</label> -->
|
124 |
+
<!-- <frontend_type>text</frontend_type> -->
|
125 |
+
<!-- <sort_order>40</sort_order> -->
|
126 |
+
<!-- <show_in_default>1</show_in_default> -->
|
127 |
+
<!-- <show_in_website>1</show_in_website> -->
|
128 |
+
<!-- <show_in_store>1</show_in_store> -->
|
129 |
+
<!-- </languages> -->
|
130 |
+
<!-- <translate translate="label comment" > -->
|
131 |
+
<!-- <label>Translate</label> -->
|
132 |
+
<!-- <frontend_type>text</frontend_type> -->
|
133 |
+
<!-- <sort_order>50</sort_order> -->
|
134 |
+
<!-- <show_in_default>1</show_in_default> -->
|
135 |
+
<!-- <show_in_website>1</show_in_website> -->
|
136 |
+
<!-- <show_in_store>1</show_in_store> -->
|
137 |
+
<!-- </translate> -->
|
138 |
+
<!-- <translate_sandbox translate="label comment" > -->
|
139 |
+
<!-- <label>Translate (Sandbox)</label> -->
|
140 |
+
<!-- <frontend_type>text</frontend_type> -->
|
141 |
+
<!-- <sort_order>50</sort_order> -->
|
142 |
+
<!-- <show_in_default>0</show_in_default> -->
|
143 |
+
<!-- <show_in_website>0</show_in_website> -->
|
144 |
+
<!-- <show_in_store>0</show_in_store> -->
|
145 |
+
<!-- </translate_sandbox> -->
|
146 |
+
<!-- <payment_page translate="label comment" > -->
|
147 |
+
<!-- <label>Payment Page</label> -->
|
148 |
+
<!-- <frontend_type>text</frontend_type> -->
|
149 |
+
<!-- <sort_order>70</sort_order> -->
|
150 |
+
<!-- <show_in_default>1</show_in_default> -->
|
151 |
+
<!-- <show_in_website>1</show_in_website> -->
|
152 |
+
<!-- <show_in_store>1</show_in_store> -->
|
153 |
+
<!-- </payment_page> -->
|
154 |
+
<!-- <payment translate="label comment" > -->
|
155 |
+
<!-- <label>Payment</label> -->
|
156 |
+
<!-- <frontend_type>text</frontend_type> -->
|
157 |
+
<!-- <sort_order>80</sort_order> -->
|
158 |
+
<!-- <show_in_default>1</show_in_default> -->
|
159 |
+
<!-- <show_in_website>1</show_in_website> -->
|
160 |
+
<!-- <show_in_store>1</show_in_store> -->
|
161 |
+
<!-- </payment> -->
|
162 |
+
<!-- </fields> -->
|
163 |
+
<!-- </api_url> -->
|
164 |
</groups>
|
165 |
</straker>
|
166 |
</sections>
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/install-1.2.0.php
ADDED
@@ -0,0 +1,752 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
4 |
+
$installer = $this;
|
5 |
+
$installer->startSetup();
|
6 |
+
$connection = $installer->getConnection();
|
7 |
+
|
8 |
+
$rawTableName = 'straker_actionlog';
|
9 |
+
$tableName = $installer->getTable($rawTableName);
|
10 |
+
if ($connection->isTableExists($tableName) != true) {
|
11 |
+
$table = $connection
|
12 |
+
->newTable($tableName)
|
13 |
+
->addColumn(
|
14 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
15 |
+
[
|
16 |
+
'identity' => true,
|
17 |
+
'unsigned' => true,
|
18 |
+
'nullable' => false,
|
19 |
+
'primary' => true
|
20 |
+
],
|
21 |
+
'ID'
|
22 |
+
)->addColumn(
|
23 |
+
'user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
24 |
+
[
|
25 |
+
'nullable' => false,
|
26 |
+
'unsigned' => true,
|
27 |
+
],
|
28 |
+
'User ID'
|
29 |
+
)->addColumn(
|
30 |
+
'action', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
31 |
+
[
|
32 |
+
'default' => null
|
33 |
+
],
|
34 |
+
'Action'
|
35 |
+
)->addColumn(
|
36 |
+
'message', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
37 |
+
[],
|
38 |
+
'Message'
|
39 |
+
)->addColumn(
|
40 |
+
'extra', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
41 |
+
[],
|
42 |
+
'Extra'
|
43 |
+
)->addColumn(
|
44 |
+
'log_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null,
|
45 |
+
[
|
46 |
+
'default' => null
|
47 |
+
],
|
48 |
+
'Log Time'
|
49 |
+
)->addIndex(
|
50 |
+
$installer->getIdxName($rawTableName, 'user_id'),
|
51 |
+
'user_id'
|
52 |
+
)->addForeignKey(
|
53 |
+
$installer->getFkName($rawTableName, 'user_id', 'admin_user', 'user_id'),
|
54 |
+
'user_id',
|
55 |
+
$installer->getTable('admin_user'),
|
56 |
+
'user_id',
|
57 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
58 |
+
)->setComment('Straker Action Log Table');;
|
59 |
+
$connection->createTable($table);
|
60 |
+
}
|
61 |
+
|
62 |
+
$rawTableName = 'straker_apilog';
|
63 |
+
$tableName = $installer->getTable($rawTableName);
|
64 |
+
if ($connection->isTableExists($tableName) != true) {
|
65 |
+
$table = $connection
|
66 |
+
->newTable($tableName)
|
67 |
+
->addColumn(
|
68 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
69 |
+
[
|
70 |
+
'identity' => true,
|
71 |
+
'unsigned' => true,
|
72 |
+
'nullable' => false,
|
73 |
+
'primary' => true
|
74 |
+
],
|
75 |
+
'ID'
|
76 |
+
)->addColumn(
|
77 |
+
'method', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
78 |
+
[
|
79 |
+
'nullable' => false,
|
80 |
+
'default' => ''
|
81 |
+
],
|
82 |
+
'Method'
|
83 |
+
)->addColumn(
|
84 |
+
'request', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
85 |
+
[],
|
86 |
+
'Request'
|
87 |
+
)->addColumn(
|
88 |
+
'response', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
89 |
+
[],
|
90 |
+
'Response'
|
91 |
+
)->addColumn(
|
92 |
+
'timestamp', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null,
|
93 |
+
[
|
94 |
+
'default' => null
|
95 |
+
],
|
96 |
+
'Timestamp'
|
97 |
+
)->setComment('Straker Api Log Table');;
|
98 |
+
$connection->createTable($table);
|
99 |
+
}
|
100 |
+
|
101 |
+
$rawTableName = 'straker_job';
|
102 |
+
$tableName = $installer->getTable($rawTableName);
|
103 |
+
if ($connection->isTableExists($tableName) != true) {
|
104 |
+
$table = $connection
|
105 |
+
->newTable($tableName)
|
106 |
+
->addColumn(
|
107 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
108 |
+
[
|
109 |
+
'identity' => true,
|
110 |
+
'unsigned' => true,
|
111 |
+
'nullable' => false,
|
112 |
+
'primary' => true
|
113 |
+
],
|
114 |
+
'ID'
|
115 |
+
)->addColumn(
|
116 |
+
'type_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
117 |
+
[
|
118 |
+
'unsigned' => true,
|
119 |
+
'nullable' => false
|
120 |
+
],
|
121 |
+
'Type Id'
|
122 |
+
)->addColumn(
|
123 |
+
'source_store', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
124 |
+
[
|
125 |
+
'unsigned' => true,
|
126 |
+
'nullable' => false
|
127 |
+
],
|
128 |
+
'Source Store'
|
129 |
+
)->addColumn(
|
130 |
+
'store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
131 |
+
[
|
132 |
+
'unsigned' => true,
|
133 |
+
'nullable' => false
|
134 |
+
],
|
135 |
+
'Store Id'
|
136 |
+
)->addColumn(
|
137 |
+
'title', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
138 |
+
[
|
139 |
+
'default' => null
|
140 |
+
],
|
141 |
+
'Title'
|
142 |
+
)->addColumn(
|
143 |
+
'tj_number', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
144 |
+
[
|
145 |
+
'default' => null
|
146 |
+
],
|
147 |
+
'Job Number'
|
148 |
+
)->addColumn(
|
149 |
+
'sl', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
150 |
+
[
|
151 |
+
'default' => null
|
152 |
+
],
|
153 |
+
'Source Language'
|
154 |
+
)->addColumn(
|
155 |
+
'tl', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
156 |
+
[
|
157 |
+
'default' => null
|
158 |
+
],
|
159 |
+
'Target Language'
|
160 |
+
)->addColumn(
|
161 |
+
'job_key', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
162 |
+
[
|
163 |
+
'default' => null
|
164 |
+
],
|
165 |
+
'Job Key'
|
166 |
+
)->addColumn(
|
167 |
+
'quote', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
168 |
+
[
|
169 |
+
'default' => null
|
170 |
+
],
|
171 |
+
'Quote'
|
172 |
+
)->addColumn(
|
173 |
+
'status_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
174 |
+
[
|
175 |
+
'unsigned' => true,
|
176 |
+
'nullable' => false,
|
177 |
+
'default' => 1
|
178 |
+
],
|
179 |
+
'Status Id'
|
180 |
+
)->addColumn(
|
181 |
+
'work_flow', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
182 |
+
[
|
183 |
+
'default' => null
|
184 |
+
],
|
185 |
+
'Work Flow'
|
186 |
+
)->addColumn(
|
187 |
+
'payment_status', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
188 |
+
[
|
189 |
+
'default' => null
|
190 |
+
],
|
191 |
+
'Payment Status'
|
192 |
+
)->addColumn(
|
193 |
+
'source_file', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
194 |
+
[
|
195 |
+
'default' => null
|
196 |
+
],
|
197 |
+
'Source File'
|
198 |
+
)->addColumn(
|
199 |
+
'download_url', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
200 |
+
[
|
201 |
+
'default' => null
|
202 |
+
],
|
203 |
+
'Download Url'
|
204 |
+
)->addColumn(
|
205 |
+
'remote_version', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
206 |
+
[
|
207 |
+
'default' => null
|
208 |
+
],
|
209 |
+
'Remote Version'
|
210 |
+
)->addColumn(
|
211 |
+
'downloaded_version', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
212 |
+
[
|
213 |
+
'default' => null
|
214 |
+
],
|
215 |
+
'Downloaded Version'
|
216 |
+
)->addColumn(
|
217 |
+
'created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null,
|
218 |
+
[
|
219 |
+
'default' => null
|
220 |
+
],
|
221 |
+
'Created Time'
|
222 |
+
)->addColumn(
|
223 |
+
'updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null,
|
224 |
+
[
|
225 |
+
'default' => null
|
226 |
+
],
|
227 |
+
'Updated Time'
|
228 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_key'),
|
229 |
+
'job_key',
|
230 |
+
[
|
231 |
+
'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
|
232 |
+
]
|
233 |
+
)->addIndex($installer->getIdxName($rawTableName, 'store_id'),
|
234 |
+
'store_id'
|
235 |
+
)->addIndex($installer->getIdxName($rawTableName, 'type_id'),
|
236 |
+
'type_id'
|
237 |
+
)->addIndex($installer->getIdxName($rawTableName, 'status_id'),
|
238 |
+
'status_id'
|
239 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'store_id', 'core_store', 'store_id'),
|
240 |
+
'store_id', $installer->getTable('core_store'), 'store_id',
|
241 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
242 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'type_id', 'straker_job_type', 'type_id'),
|
243 |
+
'type_id', $installer->getTable('straker_job_type'), 'type_id',
|
244 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
245 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'status_id', 'straker_job_status', 'status_id'),
|
246 |
+
'status_id', $installer->getTable('straker_job_status'), 'status_id',
|
247 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
248 |
+
)->setComment('Straker Job Table');
|
249 |
+
$connection->createTable($table);
|
250 |
+
}
|
251 |
+
|
252 |
+
$rawTableName = 'straker_job_product';
|
253 |
+
$tableName = $installer->getTable($rawTableName);
|
254 |
+
if ($connection->isTableExists($tableName) != true) {
|
255 |
+
$table = $connection
|
256 |
+
->newTable($tableName)
|
257 |
+
->addColumn(
|
258 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
259 |
+
[
|
260 |
+
'identity' => true,
|
261 |
+
'unsigned' => true,
|
262 |
+
'nullable' => false,
|
263 |
+
'primary' => true
|
264 |
+
],
|
265 |
+
'ID'
|
266 |
+
)->addColumn(
|
267 |
+
'product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
268 |
+
[
|
269 |
+
'unsigned' => true,
|
270 |
+
'nullable' => false
|
271 |
+
],
|
272 |
+
'Product Id'
|
273 |
+
)->addColumn(
|
274 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
275 |
+
[
|
276 |
+
'unsigned' => true,
|
277 |
+
'nullable' => false
|
278 |
+
],
|
279 |
+
'Job Id'
|
280 |
+
)->addColumn(
|
281 |
+
'version', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
282 |
+
[
|
283 |
+
'default' => null
|
284 |
+
],
|
285 |
+
'Version'
|
286 |
+
)->addIndex($installer->getIdxName($rawTableName, 'product_id'),
|
287 |
+
'product_id'
|
288 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
289 |
+
'job_id'
|
290 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
291 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
292 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
293 |
+
)->setComment('Straker Product Job Table');
|
294 |
+
$connection->createTable($table);
|
295 |
+
}
|
296 |
+
|
297 |
+
$rawTableName = 'straker_job_status';
|
298 |
+
$tableName = $installer->getTable($rawTableName);
|
299 |
+
if ($connection->isTableExists($tableName) != true) {
|
300 |
+
$table = $connection
|
301 |
+
->newTable($tableName)
|
302 |
+
->addColumn(
|
303 |
+
'status_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
304 |
+
[
|
305 |
+
'identity' => true,
|
306 |
+
'unsigned' => true,
|
307 |
+
'nullable' => false,
|
308 |
+
'primary' => true
|
309 |
+
],
|
310 |
+
'Status Id'
|
311 |
+
)->addColumn(
|
312 |
+
'status_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
313 |
+
[
|
314 |
+
'nullable' => false,
|
315 |
+
'default' => ''
|
316 |
+
],
|
317 |
+
'Status Name'
|
318 |
+
)->setComment('Straker Job Status Table');
|
319 |
+
$connection->createTable($table);
|
320 |
+
}
|
321 |
+
|
322 |
+
$rawTableName = 'straker_job_type';
|
323 |
+
$tableName = $installer->getTable($rawTableName);
|
324 |
+
if ($connection->isTableExists($tableName) != true) {
|
325 |
+
$table = $connection
|
326 |
+
->newTable($tableName)
|
327 |
+
->addColumn(
|
328 |
+
'type_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
329 |
+
[
|
330 |
+
'identity' => true,
|
331 |
+
'unsigned' => true,
|
332 |
+
'nullable' => false,
|
333 |
+
'primary' => true
|
334 |
+
],
|
335 |
+
'Type Id'
|
336 |
+
)->addColumn(
|
337 |
+
'type_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
338 |
+
[
|
339 |
+
'nullable' => false,
|
340 |
+
'default' => ''
|
341 |
+
],
|
342 |
+
'Type Name'
|
343 |
+
)->setComment('Straker Job Type Table');
|
344 |
+
$connection->createTable($table);
|
345 |
+
}
|
346 |
+
|
347 |
+
$rawTableName = 'straker_product_attributes';
|
348 |
+
$tableName = $installer->getTable($rawTableName);
|
349 |
+
if ($connection->isTableExists($tableName) != true) {
|
350 |
+
$table = $connection
|
351 |
+
->newTable($tableName)
|
352 |
+
->addColumn(
|
353 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
354 |
+
[
|
355 |
+
'identity' => true,
|
356 |
+
'unsigned' => true,
|
357 |
+
'nullable' => false,
|
358 |
+
'primary' => true
|
359 |
+
],
|
360 |
+
'ID'
|
361 |
+
)->addColumn(
|
362 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
363 |
+
[
|
364 |
+
'unsigned' => true,
|
365 |
+
'nullable' => false
|
366 |
+
],
|
367 |
+
'Job Id'
|
368 |
+
)->addColumn(
|
369 |
+
'attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
370 |
+
[
|
371 |
+
'unsigned' => true,
|
372 |
+
'nullable' => false
|
373 |
+
],
|
374 |
+
'Attribute Id'
|
375 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
376 |
+
'job_id'
|
377 |
+
)->addIndex($installer->getIdxName($rawTableName, 'attribute_id'),
|
378 |
+
'attribute_id'
|
379 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'attribute_id', 'eav_attribute', 'attribute_id'),
|
380 |
+
'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id',
|
381 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
382 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
383 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
384 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
385 |
+
)->setComment('Straker Product Attribute Table');
|
386 |
+
$connection->createTable($table);
|
387 |
+
}
|
388 |
+
|
389 |
+
$rawTableName = 'straker_product_translate';
|
390 |
+
$tableName = $installer->getTable($rawTableName);
|
391 |
+
if ($connection->isTableExists($tableName) != true) {
|
392 |
+
$table = $connection
|
393 |
+
->newTable($tableName)
|
394 |
+
->addColumn(
|
395 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
396 |
+
[
|
397 |
+
'identity' => true,
|
398 |
+
'unsigned' => true,
|
399 |
+
'nullable' => false,
|
400 |
+
'primary' => true
|
401 |
+
],
|
402 |
+
'ID'
|
403 |
+
)->addColumn(
|
404 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
405 |
+
[
|
406 |
+
'unsigned' => true,
|
407 |
+
'nullable' => false
|
408 |
+
],
|
409 |
+
'Job Id'
|
410 |
+
)->addColumn(
|
411 |
+
'product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
412 |
+
[
|
413 |
+
'unsigned' => true,
|
414 |
+
'nullable' => false
|
415 |
+
],
|
416 |
+
'Product Id'
|
417 |
+
)->addColumn(
|
418 |
+
'attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
419 |
+
[
|
420 |
+
'unsigned' => true,
|
421 |
+
'nullable' => false
|
422 |
+
],
|
423 |
+
'Attribute Id'
|
424 |
+
)->addColumn(
|
425 |
+
'original', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
426 |
+
[],
|
427 |
+
'Original'
|
428 |
+
)->addColumn(
|
429 |
+
'translate', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
430 |
+
[],
|
431 |
+
'Translate'
|
432 |
+
)->addColumn(
|
433 |
+
'backup', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
434 |
+
[],
|
435 |
+
'Backup'
|
436 |
+
)->addColumn(
|
437 |
+
'is_imported', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
438 |
+
[
|
439 |
+
'unsigned' => true,
|
440 |
+
'nullable' => false,
|
441 |
+
'default' => 0
|
442 |
+
],
|
443 |
+
'Is Imported'
|
444 |
+
)->addIndex($installer->getIdxName($rawTableName, 'product_id'),
|
445 |
+
'product_id'
|
446 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
447 |
+
'job_id'
|
448 |
+
)->addIndex($installer->getIdxName($rawTableName, 'attribute_id'),
|
449 |
+
'attribute_id'
|
450 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'attribute_id', 'eav_attribute', 'attribute_id'),
|
451 |
+
'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id',
|
452 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
453 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
454 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
455 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
456 |
+
)->setComment('Straker Product Translation Table');
|
457 |
+
$connection->createTable($table);
|
458 |
+
}
|
459 |
+
|
460 |
+
$rawTableName = 'straker_job_category';
|
461 |
+
$tableName = $installer->getTable($rawTableName);
|
462 |
+
if ($connection->isTableExists($tableName) != true) {
|
463 |
+
$table = $connection
|
464 |
+
->newTable($tableName)
|
465 |
+
->addColumn(
|
466 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
467 |
+
[
|
468 |
+
'identity' => true,
|
469 |
+
'unsigned' => true,
|
470 |
+
'nullable' => false,
|
471 |
+
'primary' => true
|
472 |
+
],
|
473 |
+
'ID'
|
474 |
+
)->addColumn(
|
475 |
+
'category_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
476 |
+
[
|
477 |
+
'unsigned' => true,
|
478 |
+
'nullable' => false
|
479 |
+
],
|
480 |
+
'Category Id'
|
481 |
+
)->addColumn(
|
482 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
483 |
+
[
|
484 |
+
'unsigned' => true,
|
485 |
+
'nullable' => false
|
486 |
+
],
|
487 |
+
'Job Id'
|
488 |
+
)->addColumn(
|
489 |
+
'version', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
490 |
+
[
|
491 |
+
'default' => null
|
492 |
+
],
|
493 |
+
'Version'
|
494 |
+
)->addIndex($installer->getIdxName($rawTableName, 'category_id'),
|
495 |
+
'category_id'
|
496 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
497 |
+
'job_id'
|
498 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'category_id', 'catalog_category_entity', 'entity_id'),
|
499 |
+
'category_id', $installer->getTable('catalog_category_entity'), 'entity_id',
|
500 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
501 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
502 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
503 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
504 |
+
)->setComment('Straker Category Job Table');
|
505 |
+
|
506 |
+
$connection->createTable($table);
|
507 |
+
}
|
508 |
+
|
509 |
+
$rawTableName = 'straker_category_attributes';
|
510 |
+
$tableName = $installer->getTable($rawTableName);
|
511 |
+
if ($connection->isTableExists($tableName) != true) {
|
512 |
+
$table = $connection
|
513 |
+
->newTable($tableName)
|
514 |
+
->addColumn(
|
515 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
516 |
+
[
|
517 |
+
'identity' => true,
|
518 |
+
'unsigned' => true,
|
519 |
+
'nullable' => false,
|
520 |
+
'primary' => true
|
521 |
+
],
|
522 |
+
'ID'
|
523 |
+
)->addColumn(
|
524 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
525 |
+
[
|
526 |
+
'unsigned' => true,
|
527 |
+
'nullable' => false
|
528 |
+
],
|
529 |
+
'Job Id'
|
530 |
+
)->addColumn(
|
531 |
+
'attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
532 |
+
[
|
533 |
+
'unsigned' => true,
|
534 |
+
'nullable' => false
|
535 |
+
],
|
536 |
+
'Attribute Id'
|
537 |
+
)->addIndex($installer->getIdxName($rawTableName, 'attribute_id'),
|
538 |
+
'attribute_id'
|
539 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
540 |
+
'job_id'
|
541 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'attribute_id', 'eav_attribute', 'attribute_id'),
|
542 |
+
'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id',
|
543 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
544 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
545 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
546 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
547 |
+
)->setComment('Straker Category Attribute Table');
|
548 |
+
|
549 |
+
$connection->createTable($table);
|
550 |
+
}
|
551 |
+
|
552 |
+
$rawTableName = 'straker_category_translate';
|
553 |
+
$tableName = $installer->getTable($rawTableName);
|
554 |
+
if ($connection->isTableExists($tableName) != true) {
|
555 |
+
$table = $connection
|
556 |
+
->newTable($tableName)
|
557 |
+
->addColumn(
|
558 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
559 |
+
[
|
560 |
+
'identity' => true,
|
561 |
+
'unsigned' => true,
|
562 |
+
'nullable' => false,
|
563 |
+
'primary' => true
|
564 |
+
],
|
565 |
+
'ID'
|
566 |
+
)->addColumn(
|
567 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
568 |
+
[
|
569 |
+
'unsigned' => true,
|
570 |
+
'nullable' => false
|
571 |
+
],
|
572 |
+
'Job Id'
|
573 |
+
)->addColumn(
|
574 |
+
'category_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
575 |
+
[
|
576 |
+
'unsigned' => true,
|
577 |
+
'nullable' => false
|
578 |
+
],
|
579 |
+
'Category Id'
|
580 |
+
)->addColumn(
|
581 |
+
'attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
582 |
+
[
|
583 |
+
'unsigned' => true,
|
584 |
+
'nullable' => false
|
585 |
+
],
|
586 |
+
'Attribute Id'
|
587 |
+
)->addColumn(
|
588 |
+
'original', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
589 |
+
[],
|
590 |
+
'Original'
|
591 |
+
)->addColumn(
|
592 |
+
'translate', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
593 |
+
[],
|
594 |
+
'Translate'
|
595 |
+
)->addColumn(
|
596 |
+
'backup', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
597 |
+
[],
|
598 |
+
'Backup'
|
599 |
+
)->addColumn(
|
600 |
+
'is_imported', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
601 |
+
[
|
602 |
+
'unsigned' => true,
|
603 |
+
'nullable' => false,
|
604 |
+
'default' => 0
|
605 |
+
],
|
606 |
+
'Is Imported'
|
607 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
608 |
+
'job_id'
|
609 |
+
)->addIndex($installer->getIdxName($rawTableName, 'attribute_id'),
|
610 |
+
'attribute_id'
|
611 |
+
)->addIndex($installer->getIdxName($rawTableName, 'category_id'),
|
612 |
+
'category_id'
|
613 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'attribute_id', 'eav_attribute', 'attribute_id'),
|
614 |
+
'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id',
|
615 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
616 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
617 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
618 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
619 |
+
)->setComment('Straker Category Translation Table');
|
620 |
+
|
621 |
+
$connection->createTable($table);
|
622 |
+
}
|
623 |
+
|
624 |
+
$rawTableName = 'straker_job_attribute';
|
625 |
+
$tableName = $installer->getTable($rawTableName);
|
626 |
+
if ($connection->isTableExists($tableName) != true) {
|
627 |
+
$table = $connection
|
628 |
+
->newTable($tableName)
|
629 |
+
->addColumn(
|
630 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
631 |
+
[
|
632 |
+
'identity' => true,
|
633 |
+
'unsigned' => true,
|
634 |
+
'nullable' => false,
|
635 |
+
'primary' => true
|
636 |
+
],
|
637 |
+
'ID'
|
638 |
+
)->addColumn(
|
639 |
+
'attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
640 |
+
[
|
641 |
+
'unsigned' => true,
|
642 |
+
'nullable' => false
|
643 |
+
],
|
644 |
+
'Attribute Id'
|
645 |
+
)->addColumn(
|
646 |
+
'translate_label', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
647 |
+
[
|
648 |
+
'unsigned' => true,
|
649 |
+
'nullable' => false,
|
650 |
+
'default' => 0
|
651 |
+
],
|
652 |
+
'Translate Label'
|
653 |
+
)->addColumn(
|
654 |
+
'translate_option', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
655 |
+
[
|
656 |
+
'unsigned' => true,
|
657 |
+
'nullable' => false,
|
658 |
+
'default' => 0
|
659 |
+
],
|
660 |
+
'Translate Option'
|
661 |
+
)->addColumn(
|
662 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
663 |
+
[
|
664 |
+
'unsigned' => true,
|
665 |
+
'nullable' => false
|
666 |
+
],
|
667 |
+
'Job Id'
|
668 |
+
)->addColumn(
|
669 |
+
'version', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
670 |
+
[
|
671 |
+
'default' => null
|
672 |
+
],
|
673 |
+
'Version'
|
674 |
+
)->addIndex($installer->getIdxName($rawTableName, 'attribute_id'),
|
675 |
+
'attribute_id'
|
676 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
677 |
+
'job_id'
|
678 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'attribute_id', 'eav_attribute', 'attribute_id'),
|
679 |
+
'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id',
|
680 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
681 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
682 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
683 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
684 |
+
)->setComment('Straker Attribute Job Table');
|
685 |
+
|
686 |
+
$connection->createTable($table);
|
687 |
+
}
|
688 |
+
|
689 |
+
$rawTableName = 'straker_attribute_translate';
|
690 |
+
$tableName = $installer->getTable($rawTableName);
|
691 |
+
if ($connection->isTableExists($tableName) != true) {
|
692 |
+
$table = $connection
|
693 |
+
->newTable($tableName)
|
694 |
+
->addColumn(
|
695 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
696 |
+
[
|
697 |
+
'identity' => true,
|
698 |
+
'unsigned' => true,
|
699 |
+
'nullable' => false,
|
700 |
+
'primary' => true
|
701 |
+
],
|
702 |
+
'ID'
|
703 |
+
)->addColumn(
|
704 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
705 |
+
[
|
706 |
+
'unsigned' => true,
|
707 |
+
'nullable' => false
|
708 |
+
],
|
709 |
+
'Job Id'
|
710 |
+
)->addColumn(
|
711 |
+
'attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
712 |
+
[
|
713 |
+
'unsigned' => true,
|
714 |
+
'nullable' => false
|
715 |
+
],
|
716 |
+
'Attribute Id'
|
717 |
+
)->addColumn(
|
718 |
+
'original', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
719 |
+
[],
|
720 |
+
'Original'
|
721 |
+
)->addColumn(
|
722 |
+
'translate', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
723 |
+
[],
|
724 |
+
'Translate'
|
725 |
+
)->addColumn(
|
726 |
+
'backup', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
727 |
+
[],
|
728 |
+
'Backup'
|
729 |
+
)->addColumn(
|
730 |
+
'is_imported', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
731 |
+
[
|
732 |
+
'unsigned' => true,
|
733 |
+
'nullable' => false,
|
734 |
+
'default' => 0
|
735 |
+
],
|
736 |
+
'Is Imported'
|
737 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
738 |
+
'job_id'
|
739 |
+
)->addIndex($installer->getIdxName($rawTableName, 'attribute_id'),
|
740 |
+
'attribute_id'
|
741 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
742 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
743 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
744 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'attribute_id', 'eav_attribute', 'attribute_id'),
|
745 |
+
'attribute_id', $installer->getTable('eav_attribute'), 'attribute_id',
|
746 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
747 |
+
)->setComment('Straker Attribute Translation Table');
|
748 |
+
|
749 |
+
$connection->createTable($table);
|
750 |
+
}
|
751 |
+
|
752 |
+
$installer->endSetup();
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-install-1.0.0.php
DELETED
@@ -1,179 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: stevenyang
|
5 |
-
* Date: 18/09/15
|
6 |
-
* Time: 9:46 AM
|
7 |
-
*/
|
8 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
-
$installer = $this;
|
10 |
-
|
11 |
-
$installer->startSetup();
|
12 |
-
|
13 |
-
try {
|
14 |
-
$installer->run(" CREATE TABLE IF NOT EXISTS `straker_actionlog` (
|
15 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
16 |
-
`user_id` int(10) NOT NULL,
|
17 |
-
`action` varchar(255) DEFAULT NULL,
|
18 |
-
`message` text,
|
19 |
-
`extra` text,
|
20 |
-
`log_at` timestamp NULL DEFAULT NULL,
|
21 |
-
PRIMARY KEY (`id`),
|
22 |
-
KEY `user_id` (`user_id`),
|
23 |
-
CONSTRAINT `straker_actionlog_ibfk_1` FOREIGN KEY (`id`) REFERENCES `admin_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
24 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
25 |
-
|
26 |
-
CREATE TABLE IF NOT EXISTS `straker_apilog` (
|
27 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
28 |
-
`method` varchar(255) NOT NULL DEFAULT '',
|
29 |
-
`request` text,
|
30 |
-
`response` text,
|
31 |
-
`timestamp` timestamp NULL DEFAULT NULL,
|
32 |
-
PRIMARY KEY (`id`)
|
33 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
34 |
-
|
35 |
-
CREATE TABLE IF NOT EXISTS `straker_job` (
|
36 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
37 |
-
`type_id` tinyint(3) unsigned NOT NULL,
|
38 |
-
`source_store` smallint(5) unsigned NOT NULL,
|
39 |
-
`store_id` smallint(5) unsigned NOT NULL,
|
40 |
-
`title` varchar(255) DEFAULT NULL,
|
41 |
-
`tj_number` varchar(255) DEFAULT NULL,
|
42 |
-
`sl` varchar(255) DEFAULT NULL,
|
43 |
-
`tl` varchar(255) DEFAULT NULL,
|
44 |
-
`job_key` varchar(255) DEFAULT NULL,
|
45 |
-
`quote` varchar(255) DEFAULT NULL,
|
46 |
-
`status_id` tinyint(3) unsigned NOT NULL DEFAULT '1',
|
47 |
-
`work_flow` varchar(255) DEFAULT NULL,
|
48 |
-
`payment_status` varchar(255) DEFAULT NULL,
|
49 |
-
`source_file` varchar(255) DEFAULT NULL,
|
50 |
-
`download_url` varchar(255) DEFAULT NULL,
|
51 |
-
`remote_version` varchar(255) DEFAULT NULL,
|
52 |
-
`downloaded_version` varchar(255) DEFAULT '0',
|
53 |
-
`created_at` timestamp NULL DEFAULT NULL,
|
54 |
-
`updated_at` timestamp NULL DEFAULT NULL,
|
55 |
-
PRIMARY KEY (`id`),
|
56 |
-
UNIQUE KEY `job_key` (`job_key`),
|
57 |
-
KEY `store_id` (`store_id`),
|
58 |
-
KEY `type_id` (`type_id`),
|
59 |
-
KEY `status_id` (`status_id`),
|
60 |
-
CONSTRAINT `straker_job_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
61 |
-
CONSTRAINT `straker_job_ibfk_2` FOREIGN KEY (`type_id`) REFERENCES `straker_job_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
62 |
-
CONSTRAINT `straker_job_ibfk_3` FOREIGN KEY (`status_id`) REFERENCES `straker_job_status` (`status_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
63 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
64 |
-
|
65 |
-
CREATE TABLE IF NOT EXISTS `straker_job_product` (
|
66 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
67 |
-
`product_id` int(10) unsigned NOT NULL,
|
68 |
-
`job_id` int(11) unsigned NOT NULL,
|
69 |
-
`version` varchar(255) DEFAULT NULL,
|
70 |
-
PRIMARY KEY (`id`),
|
71 |
-
KEY `product_id` (`product_id`),
|
72 |
-
KEY `job_id` (`job_id`),
|
73 |
-
CONSTRAINT `straker_job_product_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
74 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
75 |
-
|
76 |
-
CREATE TABLE IF NOT EXISTS `straker_job_status` (
|
77 |
-
`status_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
|
78 |
-
`status_name` varchar(255) NOT NULL DEFAULT '',
|
79 |
-
PRIMARY KEY (`status_id`)
|
80 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
81 |
-
|
82 |
-
REPLACE INTO `straker_job_status` (`status_id`, `status_name`)
|
83 |
-
VALUES
|
84 |
-
(1,'INIT'),
|
85 |
-
(2,'QUEUED'),
|
86 |
-
(3,'IN_PROGRESS'),
|
87 |
-
(4,'COMPLETED');
|
88 |
-
|
89 |
-
CREATE TABLE IF NOT EXISTS `straker_job_type` (
|
90 |
-
`type_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
|
91 |
-
`type_name` varchar(255) NOT NULL DEFAULT '',
|
92 |
-
PRIMARY KEY (`type_id`)
|
93 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
94 |
-
|
95 |
-
REPLACE INTO `straker_job_type` (`type_id`, `type_name`)
|
96 |
-
VALUES
|
97 |
-
(1,'Product');
|
98 |
-
|
99 |
-
CREATE TABLE IF NOT EXISTS `straker_product_attributes` (
|
100 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
101 |
-
`job_id` int(10) unsigned NOT NULL,
|
102 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
103 |
-
PRIMARY KEY (`id`),
|
104 |
-
KEY `job_id` (`job_id`),
|
105 |
-
KEY `attribute_id` (`attribute_id`),
|
106 |
-
CONSTRAINT `straker_product_attributes_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
107 |
-
CONSTRAINT `straker_product_attributes_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
108 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
109 |
-
|
110 |
-
CREATE TABLE IF NOT EXISTS `straker_product_translate` (
|
111 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
112 |
-
`job_id` int(11) unsigned NOT NULL,
|
113 |
-
`product_id` int(10) unsigned NOT NULL,
|
114 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
115 |
-
`original` text,
|
116 |
-
`translate` text,
|
117 |
-
`backup` text,
|
118 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
119 |
-
PRIMARY KEY (`id`),
|
120 |
-
KEY `product_id` (`product_id`),
|
121 |
-
KEY `job_id` (`job_id`),
|
122 |
-
KEY `attribute_id` (`attribute_id`),
|
123 |
-
CONSTRAINT `straker_product_translate_ibfk_3` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
124 |
-
CONSTRAINT `straker_product_translate_ibfk_4` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
125 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
126 |
-
|
127 |
-
REPLACE INTO `straker_job_type` (`type_id`, `type_name`)
|
128 |
-
VALUES (3,'Category');
|
129 |
-
|
130 |
-
CREATE TABLE IF NOT EXISTS `straker_job_category` (
|
131 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
132 |
-
`category_id` int(10) unsigned NOT NULL,
|
133 |
-
`job_id` int(11) unsigned NOT NULL,
|
134 |
-
`version` tinyint(3) DEFAULT NULL,
|
135 |
-
PRIMARY KEY (`id`),
|
136 |
-
KEY `category_id` (`category_id`),
|
137 |
-
KEY `job_id` (`job_id`),
|
138 |
-
CONSTRAINT `straker_job_category_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
139 |
-
CONSTRAINT `straker_job_category_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
140 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
141 |
-
|
142 |
-
CREATE TABLE IF NOT EXISTS `straker_category_attributes` (
|
143 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
144 |
-
`job_id` int(10) unsigned NOT NULL,
|
145 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
146 |
-
PRIMARY KEY (`id`),
|
147 |
-
KEY `job_id` (`job_id`),
|
148 |
-
KEY `attribute_id` (`attribute_id`),
|
149 |
-
CONSTRAINT `straker_category_attributes_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
150 |
-
CONSTRAINT `straker_category_attributes_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
151 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
152 |
-
|
153 |
-
CREATE TABLE IF NOT EXISTS `straker_category_translate` (
|
154 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
155 |
-
`job_id` int(11) unsigned NOT NULL,
|
156 |
-
`category_id` int(10) unsigned NOT NULL,
|
157 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
158 |
-
`original` text,
|
159 |
-
`translate` text,
|
160 |
-
`backup` text,
|
161 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
162 |
-
PRIMARY KEY (`id`),
|
163 |
-
KEY `job_id` (`job_id`),
|
164 |
-
KEY `attribute_id` (`attribute_id`),
|
165 |
-
KEY `category_id` (`category_id`),
|
166 |
-
CONSTRAINT `straker_category_translate_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
167 |
-
CONSTRAINT `straker_category_translate_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
168 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
169 |
-
|
170 |
-
REPLACE INTO `straker_job_status` (`status_id`, `status_name`)
|
171 |
-
VALUES
|
172 |
-
(5, 'PUBLISHED');
|
173 |
-
");
|
174 |
-
|
175 |
-
} catch (Exception $e) {
|
176 |
-
Mage::logException($e);
|
177 |
-
}
|
178 |
-
|
179 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.0.0-1.1.0.php
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: stevenyang
|
5 |
-
* Date: 18/09/15
|
6 |
-
* Time: 9:46 AM
|
7 |
-
*/
|
8 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
-
$installer = $this;
|
10 |
-
|
11 |
-
$installer->startSetup();
|
12 |
-
|
13 |
-
try {
|
14 |
-
$installer->run("
|
15 |
-
REPLACE INTO `straker_job_type` (`type_id`, `type_name`)
|
16 |
-
VALUES (4,'Attribute');
|
17 |
-
|
18 |
-
CREATE TABLE IF NOT EXISTS `straker_job_attribute` (
|
19 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
20 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
21 |
-
`translate_lable` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
22 |
-
`translate_option` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
23 |
-
`job_id` int(11) unsigned NOT NULL,
|
24 |
-
`version` tinyint(3) DEFAULT NULL,
|
25 |
-
PRIMARY KEY (`id`),
|
26 |
-
KEY `attribute_id` (`attribute_id`),
|
27 |
-
KEY `job_id` (`job_id`),
|
28 |
-
CONSTRAINT `straker_job_attribute_ibfk_1` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
29 |
-
CONSTRAINT `straker_job_attribute_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
30 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
31 |
-
|
32 |
-
|
33 |
-
CREATE TABLE IF NOT EXISTS `straker_attribute_translate` (
|
34 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
35 |
-
`job_id` int(11) unsigned NOT NULL,
|
36 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
37 |
-
`original` text,
|
38 |
-
`translate` text,
|
39 |
-
`backup` text,
|
40 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
41 |
-
PRIMARY KEY (`id`),
|
42 |
-
KEY `job_id` (`job_id`),
|
43 |
-
KEY `attribute_id` (`attribute_id`),
|
44 |
-
CONSTRAINT `straker_attribute_translate_ibfk_3` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
45 |
-
CONSTRAINT `straker_attribute_translate_ibfk_4` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
46 |
-
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
|
47 |
-
|
48 |
-
");
|
49 |
-
} catch (Exception $e) {
|
50 |
-
Mage::logException($e);
|
51 |
-
}
|
52 |
-
|
53 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.1.0-1.2.0.php
DELETED
@@ -1,218 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: stevenyang
|
5 |
-
* Date: 18/09/15
|
6 |
-
* Time: 9:46 AM
|
7 |
-
*/
|
8 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
-
$installer = $this;
|
10 |
-
|
11 |
-
//fix for magento prefix db tabme names
|
12 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
13 |
-
|
14 |
-
if (!empty($prefix)) {
|
15 |
-
|
16 |
-
$installer->startSetup();
|
17 |
-
|
18 |
-
try {
|
19 |
-
$query = " CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_actionlog` (
|
20 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
21 |
-
`user_id` int(10) NOT NULL,
|
22 |
-
`action` varchar(255) DEFAULT NULL,
|
23 |
-
`message` text,
|
24 |
-
`extra` text,
|
25 |
-
`log_at` timestamp NULL DEFAULT NULL,
|
26 |
-
PRIMARY KEY (`id`),
|
27 |
-
KEY `user_id` (`user_id`),
|
28 |
-
CONSTRAINT `" . $prefix . "straker_actionlog_ibfk_1` FOREIGN KEY (`id`) REFERENCES `" . $prefix . "admin_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
29 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
30 |
-
|
31 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_apilog` (
|
32 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
33 |
-
`method` varchar(255) NOT NULL DEFAULT '',
|
34 |
-
`request` text,
|
35 |
-
`response` text,
|
36 |
-
`timestamp` timestamp NULL DEFAULT NULL,
|
37 |
-
PRIMARY KEY (`id`)
|
38 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
39 |
-
|
40 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job` (
|
41 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
42 |
-
`type_id` tinyint(3) unsigned NOT NULL,
|
43 |
-
`source_store` smallint(5) unsigned NOT NULL,
|
44 |
-
`store_id` smallint(5) unsigned NOT NULL,
|
45 |
-
`title` varchar(255) DEFAULT NULL,
|
46 |
-
`tj_number` varchar(255) DEFAULT NULL,
|
47 |
-
`sl` varchar(255) DEFAULT NULL,
|
48 |
-
`tl` varchar(255) DEFAULT NULL,
|
49 |
-
`job_key` varchar(255) DEFAULT NULL,
|
50 |
-
`quote` varchar(255) DEFAULT NULL,
|
51 |
-
`status_id` tinyint(3) unsigned NOT NULL DEFAULT '1',
|
52 |
-
`work_flow` varchar(255) DEFAULT NULL,
|
53 |
-
`payment_status` varchar(255) DEFAULT NULL,
|
54 |
-
`source_file` varchar(255) DEFAULT NULL,
|
55 |
-
`download_url` varchar(255) DEFAULT NULL,
|
56 |
-
`remote_version` varchar(255) DEFAULT NULL,
|
57 |
-
`downloaded_version` varchar(255) DEFAULT '0',
|
58 |
-
`created_at` timestamp NULL DEFAULT NULL,
|
59 |
-
`updated_at` timestamp NULL DEFAULT NULL,
|
60 |
-
PRIMARY KEY (`id`),
|
61 |
-
UNIQUE KEY `job_key` (`job_key`),
|
62 |
-
KEY `store_id` (`store_id`),
|
63 |
-
KEY `type_id` (`type_id`),
|
64 |
-
KEY `status_id` (`status_id`),
|
65 |
-
CONSTRAINT `" . $prefix . "straker_job_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `" . $prefix . "core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
66 |
-
CONSTRAINT `" . $prefix . "straker_job_ibfk_2` FOREIGN KEY (`type_id`) REFERENCES `" . $prefix . "straker_job_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
67 |
-
CONSTRAINT `" . $prefix . "straker_job_ibfk_3` FOREIGN KEY (`status_id`) REFERENCES `" . $prefix . "straker_job_status` (`status_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
68 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
69 |
-
|
70 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_product` (
|
71 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
72 |
-
`product_id` int(10) unsigned NOT NULL,
|
73 |
-
`job_id` int(11) unsigned NOT NULL,
|
74 |
-
`version` varchar(255) DEFAULT NULL,
|
75 |
-
PRIMARY KEY (`id`),
|
76 |
-
KEY `product_id` (`product_id`),
|
77 |
-
KEY `job_id` (`job_id`),
|
78 |
-
CONSTRAINT `" . $prefix . "straker_job_product_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
79 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
80 |
-
|
81 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_status` (
|
82 |
-
`status_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
|
83 |
-
`status_name` varchar(255) NOT NULL DEFAULT '',
|
84 |
-
PRIMARY KEY (`status_id`)
|
85 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
86 |
-
|
87 |
-
REPLACE INTO `" . $prefix . "straker_job_status` (`status_id`, `status_name`)
|
88 |
-
VALUES
|
89 |
-
(1,'INIT'),
|
90 |
-
(2,'QUEUED'),
|
91 |
-
(3,'IN_PROGRESS'),
|
92 |
-
(4,'COMPLETED');
|
93 |
-
|
94 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_type` (
|
95 |
-
`type_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
|
96 |
-
`type_name` varchar(255) NOT NULL DEFAULT '',
|
97 |
-
PRIMARY KEY (`type_id`)
|
98 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
99 |
-
|
100 |
-
REPLACE INTO `" . $prefix . "straker_job_type` (`type_id`, `type_name`)
|
101 |
-
VALUES
|
102 |
-
(1,'Product');
|
103 |
-
|
104 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_product_attributes` (
|
105 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
106 |
-
`job_id` int(10) unsigned NOT NULL,
|
107 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
108 |
-
PRIMARY KEY (`id`),
|
109 |
-
KEY `job_id` (`job_id`),
|
110 |
-
KEY `attribute_id` (`attribute_id`),
|
111 |
-
CONSTRAINT `" . $prefix . "straker_product_attributes_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
112 |
-
CONSTRAINT `" . $prefix . "straker_product_attributes_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `" . $prefix . "eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
113 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
114 |
-
|
115 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_product_translate` (
|
116 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
117 |
-
`job_id` int(11) unsigned NOT NULL,
|
118 |
-
`product_id` int(10) unsigned NOT NULL,
|
119 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
120 |
-
`original` text,
|
121 |
-
`translate` text,
|
122 |
-
`backup` text,
|
123 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
124 |
-
PRIMARY KEY (`id`),
|
125 |
-
KEY `product_id` (`product_id`),
|
126 |
-
KEY `job_id` (`job_id`),
|
127 |
-
KEY `attribute_id` (`attribute_id`),
|
128 |
-
CONSTRAINT `" . $prefix . "straker_product_translate_ibfk_3` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
129 |
-
CONSTRAINT `" . $prefix . "straker_product_translate_ibfk_4` FOREIGN KEY (`attribute_id`) REFERENCES `" . $prefix . "eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
130 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
131 |
-
|
132 |
-
REPLACE INTO `" . $prefix . "straker_job_type` (`type_id`, `type_name`)
|
133 |
-
VALUES (3,'Category');
|
134 |
-
|
135 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_category` (
|
136 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
137 |
-
`category_id` int(10) unsigned NOT NULL,
|
138 |
-
`job_id` int(11) unsigned NOT NULL,
|
139 |
-
`version` tinyint(3) DEFAULT NULL,
|
140 |
-
PRIMARY KEY (`id`),
|
141 |
-
KEY `category_id` (`category_id`),
|
142 |
-
KEY `job_id` (`job_id`),
|
143 |
-
CONSTRAINT `" . $prefix . "straker_job_category_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `" . $prefix . "catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
144 |
-
CONSTRAINT `" . $prefix . "straker_job_category_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
145 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
146 |
-
|
147 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_category_attributes` (
|
148 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
149 |
-
`job_id` int(10) unsigned NOT NULL,
|
150 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
151 |
-
PRIMARY KEY (`id`),
|
152 |
-
KEY `job_id` (`job_id`),
|
153 |
-
KEY `attribute_id` (`attribute_id`),
|
154 |
-
CONSTRAINT `" . $prefix . "straker_category_attributes_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
155 |
-
CONSTRAINT `" . $prefix . "straker_category_attributes_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `" . $prefix . "eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
156 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
157 |
-
|
158 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_category_translate` (
|
159 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
160 |
-
`job_id` int(11) unsigned NOT NULL,
|
161 |
-
`category_id` int(10) unsigned NOT NULL,
|
162 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
163 |
-
`original` text,
|
164 |
-
`translate` text,
|
165 |
-
`backup` text,
|
166 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
167 |
-
PRIMARY KEY (`id`),
|
168 |
-
KEY `job_id` (`job_id`),
|
169 |
-
KEY `attribute_id` (`attribute_id`),
|
170 |
-
KEY `category_id` (`category_id`),
|
171 |
-
CONSTRAINT `" . $prefix . "straker_category_translate_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
172 |
-
CONSTRAINT `" . $prefix . "straker_category_translate_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `" . $prefix . "eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
173 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
174 |
-
|
175 |
-
REPLACE INTO `" . $prefix . "straker_job_status` (`status_id`, `status_name`)
|
176 |
-
VALUES
|
177 |
-
(5, 'PUBLISHED');
|
178 |
-
|
179 |
-
REPLACE INTO `" . $prefix . "straker_job_type` (`type_id`, `type_name`)
|
180 |
-
VALUES (4,'Attribute');
|
181 |
-
|
182 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_attribute` (
|
183 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
184 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
185 |
-
`translate_lable` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
186 |
-
`translate_option` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
187 |
-
`job_id` int(11) unsigned NOT NULL,
|
188 |
-
`version` tinyint(3) DEFAULT NULL,
|
189 |
-
PRIMARY KEY (`id`),
|
190 |
-
KEY `attribute_id` (`attribute_id`),
|
191 |
-
KEY `job_id` (`job_id`),
|
192 |
-
CONSTRAINT `" . $prefix . "straker_job_attribute_ibfk_1` FOREIGN KEY (`attribute_id`) REFERENCES `" . $prefix . "eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
193 |
-
CONSTRAINT `" . $prefix . "straker_job_attribute_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
194 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
195 |
-
|
196 |
-
|
197 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_attribute_translate` (
|
198 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
199 |
-
`job_id` int(11) unsigned NOT NULL,
|
200 |
-
`attribute_id` smallint(5) unsigned NOT NULL,
|
201 |
-
`original` text,
|
202 |
-
`translate` text,
|
203 |
-
`backup` text,
|
204 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
205 |
-
PRIMARY KEY (`id`),
|
206 |
-
KEY `job_id` (`job_id`),
|
207 |
-
KEY `attribute_id` (`attribute_id`),
|
208 |
-
CONSTRAINT `" . $prefix . "straker_attribute_translate_ibfk_3` FOREIGN KEY (`job_id`) REFERENCES `" . $prefix . "straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
209 |
-
CONSTRAINT `" . $prefix . "straker_attribute_translate_ibfk_4` FOREIGN KEY (`attribute_id`) REFERENCES `" . $prefix . "eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
210 |
-
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
|
211 |
-
";
|
212 |
-
$installer->run($query);
|
213 |
-
} catch (Exception $e) {
|
214 |
-
Mage::logException($e);
|
215 |
-
}
|
216 |
-
|
217 |
-
$installer->endSetup();
|
218 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.3.0-1.3.1.php
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: stevenyang
|
5 |
-
* Date: 18/09/15
|
6 |
-
* Time: 9:46 AM
|
7 |
-
*/
|
8 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
-
$installer = $this;
|
10 |
-
|
11 |
-
//fix for magento prefix db tabme names
|
12 |
-
$prefix = Mage::getConfig()->getTablePrefix()->__toString();
|
13 |
-
|
14 |
-
|
15 |
-
$installer->startSetup();
|
16 |
-
|
17 |
-
$query = "
|
18 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_cms_block_attributes` (
|
19 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
20 |
-
`job_id` int(10) unsigned NOT NULL,
|
21 |
-
`column_name` varchar(255) DEFAULT NULL,
|
22 |
-
PRIMARY KEY (`id`),
|
23 |
-
KEY `job_id` (`job_id`),
|
24 |
-
CONSTRAINT `" . $prefix . "straker_cms_block_attributes_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
25 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
26 |
-
|
27 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_cms_block_translate` (
|
28 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
29 |
-
`job_id` int(11) unsigned NOT NULL,
|
30 |
-
`cms_block_id` int(11) DEFAULT NULL,
|
31 |
-
`column_name` varchar(255) NOT NULL DEFAULT '',
|
32 |
-
`original` text,
|
33 |
-
`translate` text,
|
34 |
-
`backup` text,
|
35 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
36 |
-
`job_cms_id` int(11) DEFAULT NULL,
|
37 |
-
PRIMARY KEY (`id`),
|
38 |
-
KEY `job_id` (`job_id`),
|
39 |
-
CONSTRAINT `" . $prefix . "straker_cms_block_translate_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
40 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_cms_page_attributes` (
|
46 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
47 |
-
`job_id` int(10) unsigned NOT NULL,
|
48 |
-
`column_name` varchar(255) DEFAULT NULL,
|
49 |
-
PRIMARY KEY (`id`),
|
50 |
-
KEY `job_id` (`job_id`),
|
51 |
-
CONSTRAINT `" . $prefix . "straker_cms_page_attributes_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
52 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_cms_page_translate` (
|
58 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
59 |
-
`job_id` int(11) unsigned NOT NULL,
|
60 |
-
`cms_page_id` int(11) DEFAULT NULL,
|
61 |
-
`column_name` varchar(255) NOT NULL DEFAULT '',
|
62 |
-
`original` text,
|
63 |
-
`translate` text,
|
64 |
-
`backup` text,
|
65 |
-
`is_imported` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
66 |
-
`job_cms_id` int(11) DEFAULT NULL,
|
67 |
-
PRIMARY KEY (`id`),
|
68 |
-
KEY `job_id` (`job_id`),
|
69 |
-
CONSTRAINT `" . $prefix . "straker_cms_page_translate_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
70 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_cmsblock` (
|
76 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
77 |
-
`block_id` smallint(6) NOT NULL,
|
78 |
-
`job_id` int(11) unsigned NOT NULL,
|
79 |
-
`version` tinyint(3) DEFAULT NULL,
|
80 |
-
`origin` text,
|
81 |
-
`new_entity_id` int(11) DEFAULT NULL,
|
82 |
-
PRIMARY KEY (`id`),
|
83 |
-
KEY `job_id` (`job_id`),
|
84 |
-
KEY `block_id` (`block_id`),
|
85 |
-
KEY `new_entity_id` (`new_entity_id`),
|
86 |
-
CONSTRAINT `" . $prefix . "straker_job_cmsblock_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
87 |
-
CONSTRAINT `" . $prefix . "straker_job_cmsblock_ibfk_2` FOREIGN KEY (`block_id`) REFERENCES `cms_block` (`block_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
88 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
CREATE TABLE IF NOT EXISTS `" . $prefix . "straker_job_cmspage` (
|
94 |
-
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
95 |
-
`page_id` smallint(6) NOT NULL,
|
96 |
-
`job_id` int(11) unsigned NOT NULL,
|
97 |
-
`version` tinyint(3) DEFAULT NULL,
|
98 |
-
`origin` text,
|
99 |
-
`new_entity_id` int(11) DEFAULT NULL,
|
100 |
-
PRIMARY KEY (`id`),
|
101 |
-
KEY `job_id` (`job_id`),
|
102 |
-
KEY `page_id` (`page_id`),
|
103 |
-
KEY `new_entity_id` (`new_entity_id`),
|
104 |
-
CONSTRAINT `" . $prefix . "straker_job_cmspage_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
105 |
-
CONSTRAINT `" . $prefix . "straker_job_cmspage_ibfk_3` FOREIGN KEY (`page_id`) REFERENCES `cms_page` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
106 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
107 |
-
|
108 |
-
DROP TABLE IF EXISTS `" . $prefix . "straker_job_type`;
|
109 |
-
|
110 |
-
CREATE TABLE `" . $prefix . "straker_job_type` (
|
111 |
-
`type_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
|
112 |
-
`type_name` varchar(255) NOT NULL DEFAULT '',
|
113 |
-
PRIMARY KEY (`type_id`)
|
114 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
115 |
-
|
116 |
-
INSERT INTO `" . $prefix . "straker_job_type` (`type_id`, `type_name`)
|
117 |
-
VALUES
|
118 |
-
(1,'Product'),
|
119 |
-
(3,'Category'),
|
120 |
-
(4,'Attribute'),
|
121 |
-
(5,'CMS Page'),
|
122 |
-
(6,'CMS Block');
|
123 |
-
|
124 |
-
";
|
125 |
-
$installer->run($query);
|
126 |
-
|
127 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/upgrade-1.2.0-1.3.0.php
ADDED
@@ -0,0 +1,358 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: stevenyang
|
5 |
+
* Date: 18/09/15
|
6 |
+
* Time: 9:46 AM
|
7 |
+
*/
|
8 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
+
$installer = $this;
|
10 |
+
$installer->startSetup();
|
11 |
+
$connection = $installer->getConnection();
|
12 |
+
|
13 |
+
$rawTableName = 'straker_cms_block_attributes';
|
14 |
+
$tableName = $installer->getTable($rawTableName);
|
15 |
+
if ($connection->isTableExists($tableName) != true) {
|
16 |
+
$table = $connection
|
17 |
+
->newTable($tableName)
|
18 |
+
->addColumn(
|
19 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
20 |
+
[
|
21 |
+
'identity' => true,
|
22 |
+
'unsigned' => true,
|
23 |
+
'nullable' => false,
|
24 |
+
'primary' => true
|
25 |
+
],
|
26 |
+
'ID'
|
27 |
+
)->addColumn(
|
28 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
29 |
+
[
|
30 |
+
'nullable' => false,
|
31 |
+
'unsigned' => true,
|
32 |
+
],
|
33 |
+
'User ID'
|
34 |
+
)->addColumn(
|
35 |
+
'column_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
36 |
+
[
|
37 |
+
'default' => null
|
38 |
+
],
|
39 |
+
'Column Name'
|
40 |
+
)->addIndex(
|
41 |
+
$installer->getIdxName($rawTableName, 'job_id'),
|
42 |
+
'job_id'
|
43 |
+
)->addForeignKey(
|
44 |
+
$installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
45 |
+
'job_id',
|
46 |
+
$installer->getTable('straker_job'),
|
47 |
+
'id',
|
48 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
49 |
+
)->setComment('Straker Cms Block Attribute Table');;
|
50 |
+
$connection->createTable($table);
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
$rawTableName = 'straker_cms_block_translate';
|
55 |
+
$tableName = $installer->getTable($rawTableName);
|
56 |
+
if ($connection->isTableExists($tableName) != true) {
|
57 |
+
$table = $connection
|
58 |
+
->newTable($tableName)
|
59 |
+
->addColumn(
|
60 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
61 |
+
[
|
62 |
+
'identity' => true,
|
63 |
+
'unsigned' => true,
|
64 |
+
'nullable' => false,
|
65 |
+
'primary' => true
|
66 |
+
],
|
67 |
+
'ID'
|
68 |
+
)->addColumn(
|
69 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
70 |
+
[
|
71 |
+
'nullable' => false,
|
72 |
+
'unsigned' => true,
|
73 |
+
],
|
74 |
+
'User ID'
|
75 |
+
)->addColumn(
|
76 |
+
'cms_block_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
77 |
+
[
|
78 |
+
'default' => null
|
79 |
+
],
|
80 |
+
'Cms Block ID'
|
81 |
+
)->addColumn(
|
82 |
+
'column_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
83 |
+
[
|
84 |
+
'nullable' => false,
|
85 |
+
'default' => ''
|
86 |
+
],
|
87 |
+
'Column Name'
|
88 |
+
)->addColumn(
|
89 |
+
'original', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
90 |
+
[],
|
91 |
+
'Original'
|
92 |
+
)->addColumn(
|
93 |
+
'translate', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
94 |
+
[],
|
95 |
+
'Translate'
|
96 |
+
)->addColumn(
|
97 |
+
'backup', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
98 |
+
[],
|
99 |
+
'Backup'
|
100 |
+
)->addColumn(
|
101 |
+
'is_imported', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
102 |
+
[
|
103 |
+
'unsigned' => true,
|
104 |
+
'nullable' => false,
|
105 |
+
'default' => 0
|
106 |
+
],
|
107 |
+
'Is Imported'
|
108 |
+
)->addColumn(
|
109 |
+
'job_cms_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
110 |
+
[
|
111 |
+
'default' => null
|
112 |
+
],
|
113 |
+
'Job Cms ID'
|
114 |
+
)->addIndex(
|
115 |
+
$installer->getIdxName($rawTableName, 'job_id'),
|
116 |
+
'job_id'
|
117 |
+
)->addForeignKey(
|
118 |
+
$installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
119 |
+
'job_id',
|
120 |
+
$installer->getTable('straker_job'),
|
121 |
+
'id',
|
122 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
123 |
+
)->setComment('Straker Cms Block Translate Table');;
|
124 |
+
$connection->createTable($table);
|
125 |
+
}
|
126 |
+
|
127 |
+
$rawTableName = 'straker_cms_page_attributes';
|
128 |
+
$tableName = $installer->getTable($rawTableName);
|
129 |
+
if ($connection->isTableExists($tableName) != true) {
|
130 |
+
$table = $connection
|
131 |
+
->newTable($tableName)
|
132 |
+
->addColumn(
|
133 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
134 |
+
[
|
135 |
+
'identity' => true,
|
136 |
+
'unsigned' => true,
|
137 |
+
'nullable' => false,
|
138 |
+
'primary' => true
|
139 |
+
],
|
140 |
+
'ID'
|
141 |
+
)->addColumn(
|
142 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
143 |
+
[
|
144 |
+
'nullable' => false,
|
145 |
+
'unsigned' => true,
|
146 |
+
],
|
147 |
+
'User ID'
|
148 |
+
)->addColumn(
|
149 |
+
'column_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
150 |
+
[
|
151 |
+
'default' => null
|
152 |
+
],
|
153 |
+
'Column Name'
|
154 |
+
)->addIndex(
|
155 |
+
$installer->getIdxName($rawTableName, 'job_id'),
|
156 |
+
'job_id'
|
157 |
+
)->addForeignKey(
|
158 |
+
$installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
159 |
+
'job_id',
|
160 |
+
$installer->getTable('straker_job'),
|
161 |
+
'id',
|
162 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
163 |
+
)->setComment('Straker Cms Block Translate Table');;
|
164 |
+
$connection->createTable($table);
|
165 |
+
}
|
166 |
+
|
167 |
+
$rawTableName = 'straker_cms_page_translate';
|
168 |
+
$tableName = $installer->getTable($rawTableName);
|
169 |
+
if ($connection->isTableExists($tableName) != true) {
|
170 |
+
$table = $connection
|
171 |
+
->newTable($tableName)
|
172 |
+
->addColumn(
|
173 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
174 |
+
[
|
175 |
+
'identity' => true,
|
176 |
+
'unsigned' => true,
|
177 |
+
'nullable' => false,
|
178 |
+
'primary' => true
|
179 |
+
],
|
180 |
+
'ID'
|
181 |
+
)->addColumn(
|
182 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
183 |
+
[
|
184 |
+
'nullable' => false,
|
185 |
+
'unsigned' => true,
|
186 |
+
],
|
187 |
+
'User ID'
|
188 |
+
)->addColumn(
|
189 |
+
'cms_page_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
190 |
+
[
|
191 |
+
'default' => null
|
192 |
+
],
|
193 |
+
'Cms Page ID'
|
194 |
+
)->addColumn(
|
195 |
+
'column_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
|
196 |
+
[
|
197 |
+
'nullable' => false,
|
198 |
+
'default' => ''
|
199 |
+
],
|
200 |
+
'Column Name'
|
201 |
+
)->addColumn(
|
202 |
+
'original', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
203 |
+
[],
|
204 |
+
'Original'
|
205 |
+
)->addColumn(
|
206 |
+
'translate', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
207 |
+
[],
|
208 |
+
'Translate'
|
209 |
+
)->addColumn(
|
210 |
+
'backup', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
211 |
+
[],
|
212 |
+
'Backup'
|
213 |
+
)->addColumn(
|
214 |
+
'is_imported', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5,
|
215 |
+
[
|
216 |
+
'unsigned' => true,
|
217 |
+
'nullable' => false,
|
218 |
+
'default' => 0
|
219 |
+
],
|
220 |
+
'Is Imported'
|
221 |
+
)->addColumn(
|
222 |
+
'job_cms_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
223 |
+
[
|
224 |
+
'default' => null
|
225 |
+
],
|
226 |
+
'Job Cms ID'
|
227 |
+
)->addIndex(
|
228 |
+
$installer->getIdxName($rawTableName, 'job_id'),
|
229 |
+
'job_id'
|
230 |
+
)->addForeignKey(
|
231 |
+
$installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
232 |
+
'job_id',
|
233 |
+
$installer->getTable('straker_job'),
|
234 |
+
'id',
|
235 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
236 |
+
)->setComment('Straker Cms Block Translate Table');;
|
237 |
+
$connection->createTable($table);
|
238 |
+
}
|
239 |
+
|
240 |
+
|
241 |
+
$rawTableName = 'straker_job_cmsblock';
|
242 |
+
$tableName = $installer->getTable($rawTableName);
|
243 |
+
if ($connection->isTableExists($tableName) != true) {
|
244 |
+
$table = $connection
|
245 |
+
->newTable($tableName)
|
246 |
+
->addColumn(
|
247 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
248 |
+
[
|
249 |
+
'identity' => true,
|
250 |
+
'unsigned' => true,
|
251 |
+
'nullable' => false,
|
252 |
+
'primary' => true
|
253 |
+
],
|
254 |
+
'ID'
|
255 |
+
)->addColumn(
|
256 |
+
'block_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
257 |
+
[
|
258 |
+
'nullable' => false
|
259 |
+
],
|
260 |
+
'Block Id'
|
261 |
+
)->addColumn(
|
262 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
263 |
+
[
|
264 |
+
'unsigned' => true,
|
265 |
+
'nullable' => false
|
266 |
+
],
|
267 |
+
'Job Id'
|
268 |
+
)->addColumn(
|
269 |
+
'version', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
270 |
+
[
|
271 |
+
'default' => null
|
272 |
+
],
|
273 |
+
'Version'
|
274 |
+
)->addColumn(
|
275 |
+
'origin', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
276 |
+
[],
|
277 |
+
'Origin'
|
278 |
+
)->addColumn(
|
279 |
+
'new_entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
280 |
+
[
|
281 |
+
'default' => null
|
282 |
+
],
|
283 |
+
'New Entity ID'
|
284 |
+
)->addIndex($installer->getIdxName($rawTableName, 'block_id'),
|
285 |
+
'block_id'
|
286 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
287 |
+
'job_id'
|
288 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'block_id', 'cms_block', 'block_id'),
|
289 |
+
'block_id', $installer->getTable('cms_block'), 'block_id',
|
290 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
291 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
292 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
293 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
294 |
+
)->setComment('Straker Cms Block Job Table');
|
295 |
+
|
296 |
+
$connection->createTable($table);
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
$rawTableName = 'straker_job_cmspage';
|
301 |
+
$tableName = $installer->getTable($rawTableName);
|
302 |
+
if ($connection->isTableExists($tableName) != true) {
|
303 |
+
$table = $connection
|
304 |
+
->newTable($tableName)
|
305 |
+
->addColumn(
|
306 |
+
'id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
307 |
+
[
|
308 |
+
'identity' => true,
|
309 |
+
'unsigned' => true,
|
310 |
+
'nullable' => false,
|
311 |
+
'primary' => true
|
312 |
+
],
|
313 |
+
'ID'
|
314 |
+
)->addColumn(
|
315 |
+
'page_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
316 |
+
[
|
317 |
+
'nullable' => false
|
318 |
+
],
|
319 |
+
'Page Id'
|
320 |
+
)->addColumn(
|
321 |
+
'job_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
322 |
+
[
|
323 |
+
'unsigned' => true,
|
324 |
+
'nullable' => false
|
325 |
+
],
|
326 |
+
'Job Id'
|
327 |
+
)->addColumn(
|
328 |
+
'version', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6,
|
329 |
+
[
|
330 |
+
'default' => null
|
331 |
+
],
|
332 |
+
'Version'
|
333 |
+
)->addColumn(
|
334 |
+
'origin', Varien_Db_Ddl_Table::TYPE_TEXT, null,
|
335 |
+
[],
|
336 |
+
'Origin'
|
337 |
+
)->addColumn(
|
338 |
+
'new_entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10,
|
339 |
+
[
|
340 |
+
'default' => null
|
341 |
+
],
|
342 |
+
'New Entity ID'
|
343 |
+
)->addIndex($installer->getIdxName($rawTableName, 'page_id'),
|
344 |
+
'page_id'
|
345 |
+
)->addIndex($installer->getIdxName($rawTableName, 'job_id'),
|
346 |
+
'job_id'
|
347 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'page_id', 'cms_page', 'page_id'),
|
348 |
+
'page_id', $installer->getTable('cms_page'), 'page_id',
|
349 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
350 |
+
)->addForeignKey($installer->getFkName($rawTableName, 'job_id', 'straker_job', 'id'),
|
351 |
+
'job_id', $installer->getTable('straker_job'), 'id',
|
352 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
353 |
+
)->setComment('Straker Cms Page Job Table');
|
354 |
+
|
355 |
+
$connection->createTable($table);
|
356 |
+
}
|
357 |
+
|
358 |
+
$installer->endSetup();
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/upgrade-1.3.0-1.3.1.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: stevenyang
|
5 |
+
* Date: 18/09/15
|
6 |
+
* Time: 9:46 AM
|
7 |
+
*/
|
8 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
+
$installer = $this;
|
10 |
+
$connection = $installer->getConnection();
|
11 |
+
|
12 |
+
$rawTableName = 'straker_job_cmspage';
|
13 |
+
$tableName = $installer->getTable($rawTableName);
|
14 |
+
if ($connection->isTableExists($tableName) == true) {
|
15 |
+
$table = $connection
|
16 |
+
->addIndex(
|
17 |
+
$tableName,
|
18 |
+
$installer->getIdxName($rawTableName, 'new_entity_id'),
|
19 |
+
'new_entity_id'
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
$rawTableName = 'straker_job_cmsblock';
|
24 |
+
$tableName = $installer->getTable($rawTableName);
|
25 |
+
if ($connection->isTableExists($tableName) == true) {
|
26 |
+
$table = $connection
|
27 |
+
->addIndex(
|
28 |
+
$tableName,
|
29 |
+
$installer->getIdxName($rawTableName, 'new_entity_id'),
|
30 |
+
'new_entity_id'
|
31 |
+
);
|
32 |
+
}
|
33 |
+
|
34 |
+
// $tables = [
|
35 |
+
// 'straker_actionlog',
|
36 |
+
// 'straker_cms_block_attributes',
|
37 |
+
// 'straker_cms_block_translate',
|
38 |
+
// 'straker_cms_page_attributes',
|
39 |
+
// 'straker_cms_page_translate',
|
40 |
+
// 'straker_job_cmsblock',
|
41 |
+
// 'straker_job_cmspage'
|
42 |
+
// ];
|
43 |
+
//
|
44 |
+
// $prefix = Mage::getConfig()->getTablePrefix();
|
45 |
+
//
|
46 |
+
//
|
47 |
+
// //format of returned foreign key
|
48 |
+
// //[
|
49 |
+
// // 'FK_NAME',
|
50 |
+
// // 'SCHEMA_NAME',
|
51 |
+
// // 'TABLE_NAME',
|
52 |
+
// // 'COLUMN_NAME',
|
53 |
+
// // 'REF_SHEMA_NAME',
|
54 |
+
// // 'REF_TABLE_NAME',
|
55 |
+
// // 'REF_COLUMN_NAME',
|
56 |
+
// // 'ON_DELETE',
|
57 |
+
// // 'ON_UPDATE'
|
58 |
+
// //];
|
59 |
+
//
|
60 |
+
// foreach ($tables as $table){
|
61 |
+
// $tableName = $installer->getTable($table);
|
62 |
+
// $fks = $connection->getForeignKeys($tableName);
|
63 |
+
// if(strcasecmp($table, 'straker_actionlog') === 0){
|
64 |
+
// $fk = reset($fks);
|
65 |
+
// $connection->dropForeignKey($tableName, $fk['FK_NAME']);
|
66 |
+
// $connection->addForeignKey(
|
67 |
+
// $installer->getFkName($table, 'user_id', 'admin_user', 'user_id'),
|
68 |
+
// $tableName,
|
69 |
+
// 'user_id',
|
70 |
+
// $installer->getTable('admin_user'),
|
71 |
+
// 'user_id',
|
72 |
+
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
73 |
+
// );
|
74 |
+
// }else{
|
75 |
+
// foreach ($fks as $fk){
|
76 |
+
//
|
77 |
+
// if(strcasecmp(substr($fk['REF_TABLE_NAME'], 0, strlen($prefix)), $prefix) !== 0){
|
78 |
+
// $connection->dropForeignKey($tableName, $fk['FK_NAME']);
|
79 |
+
// $connection->addForeignKey(
|
80 |
+
// $installer->getFkName($table, $fk['COLUMN_NAME'], $fk['REF_TABLE_NAME'], $fk['REF_COLUMN_NAME']),
|
81 |
+
// $tableName,
|
82 |
+
// $fk['COLUMN_NAME'],
|
83 |
+
// $installer->getTable($fk['REF_TABLE_NAME']),
|
84 |
+
// $fk['REF_COLUMN_NAME'],
|
85 |
+
// Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
86 |
+
// );
|
87 |
+
// }
|
88 |
+
// }
|
89 |
+
// }
|
90 |
+
//
|
91 |
+
// }
|
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/upgrade-1.3.3-1.3.4.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/** @var $installer Mage_Eav_Model_Entity_Setup */
|
4 |
+
$installer = $this;
|
5 |
+
$connection = $installer->getConnection();
|
6 |
+
|
7 |
+
$tables = [
|
8 |
+
'straker_actionlog',
|
9 |
+
'straker_cms_block_attributes',
|
10 |
+
'straker_cms_block_translate',
|
11 |
+
'straker_cms_page_attributes',
|
12 |
+
'straker_cms_page_translate',
|
13 |
+
'straker_job_cmsblock',
|
14 |
+
'straker_job_cmspage'
|
15 |
+
];
|
16 |
+
|
17 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
18 |
+
|
19 |
+
|
20 |
+
//format of returned foreign key
|
21 |
+
//[
|
22 |
+
// 'FK_NAME',
|
23 |
+
// 'SCHEMA_NAME',
|
24 |
+
// 'TABLE_NAME',
|
25 |
+
// 'COLUMN_NAME',
|
26 |
+
// 'REF_SHEMA_NAME',
|
27 |
+
// 'REF_TABLE_NAME',
|
28 |
+
// 'REF_COLUMN_NAME',
|
29 |
+
// 'ON_DELETE',
|
30 |
+
// 'ON_UPDATE'
|
31 |
+
//];
|
32 |
+
|
33 |
+
if(strcasecmp($prefix, '') !== 0){
|
34 |
+
foreach ($tables as $table){
|
35 |
+
$tableName = $installer->getTable($table);
|
36 |
+
$fks = $connection->getForeignKeys($tableName);
|
37 |
+
if(strcasecmp($table, 'straker_actionlog') === 0){
|
38 |
+
$fk = reset($fks);
|
39 |
+
$connection->dropForeignKey($tableName, $fk['FK_NAME']);
|
40 |
+
$connection->addForeignKey(
|
41 |
+
$installer->getFkName($table, 'user_id', 'admin_user', 'user_id'),
|
42 |
+
$tableName,
|
43 |
+
'user_id',
|
44 |
+
$installer->getTable('admin_user'),
|
45 |
+
'user_id',
|
46 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
47 |
+
);
|
48 |
+
}else{
|
49 |
+
foreach ($fks as $fk){
|
50 |
+
|
51 |
+
if(strcasecmp(substr($fk['REF_TABLE_NAME'], 0, strlen($prefix)), $prefix) !== 0){
|
52 |
+
$connection->dropForeignKey($tableName, $fk['FK_NAME']);
|
53 |
+
$connection->addForeignKey(
|
54 |
+
$installer->getFkName($table, $fk['COLUMN_NAME'], $fk['REF_TABLE_NAME'], $fk['REF_COLUMN_NAME']),
|
55 |
+
$tableName,
|
56 |
+
$fk['COLUMN_NAME'],
|
57 |
+
$installer->getTable($fk['REF_TABLE_NAME']),
|
58 |
+
$fk['REF_COLUMN_NAME'],
|
59 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
|
60 |
+
);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
/**
|
67 |
+
* Add new field to 'cataloginventory/stock_item'
|
68 |
+
*/
|
69 |
+
$installer->getConnection()
|
70 |
+
->addColumn(
|
71 |
+
$installer->getTable('straker_job'),
|
72 |
+
'is_test_job',
|
73 |
+
[
|
74 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
75 |
+
'length' => 1,
|
76 |
+
'comment' => 'Is Test Job',
|
77 |
+
'nullable' => false,
|
78 |
+
'default' => 0
|
79 |
+
]
|
80 |
+
);
|
app/design/adminhtml/default/straker/template/straker/new/attribute/confirm.phtml
CHANGED
@@ -27,7 +27,7 @@
|
|
27 |
<form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_attribute/submitjob") ?>" method="post">
|
28 |
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
|
29 |
<input type="hidden" name="attribute" value="<?php echo implode(',', $this->getAttribute()) ?>" >
|
30 |
-
<input type="hidden" name="option" value="<?php echo $this->getOption() ?>" >
|
31 |
<input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
|
32 |
</form>
|
33 |
<div>
|
27 |
<form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_attribute/submitjob") ?>" method="post">
|
28 |
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
|
29 |
<input type="hidden" name="attribute" value="<?php echo implode(',', $this->getAttribute()) ?>" >
|
30 |
+
<input type="hidden" name="option" value="<?php echo empty($this->getOption()) ? '' : $this->getOption() ?>" >
|
31 |
<input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
|
32 |
</form>
|
33 |
<div>
|
app/design/adminhtml/default/straker/template/straker/new/attributes.phtml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="content-header">
|
2 |
+
<h3><?php echo $this->__('Create New Job') ?></h3>
|
3 |
+
</div>
|
4 |
+
<ol class="wizard" data-wizard-steps="3">
|
5 |
+
<li class="wizard-todo">Select Product Details</li>
|
6 |
+
<li class="wizard-todo">Select Products</li>
|
7 |
+
<li class="wizard-todo">Confirm Products</li>
|
8 |
+
</ol>
|
9 |
+
<div class="straker-main-container border">
|
10 |
+
<h1><?php echo $this->__('Product Details') ?></h1>
|
11 |
+
<p><?php echo $this->__('What product details would you like to translate?') ?></p>
|
12 |
+
<form action="<?php echo Mage::helper("adminhtml")->getUrl("straker/adminhtml_new/attribute") ?>" >
|
13 |
+
<div style="padding:0; margin-bottom: 30px;">
|
14 |
+
<div style="text-align: left;">
|
15 |
+
<input name="store" type="hidden" value="<?php echo $this->getSetupStoreId() ?>" />
|
16 |
+
<input type="checkbox" name="attr[name]" id="name" value="1">
|
17 |
+
<label for="name"><?php echo $this->__('Title') ?></label>
|
18 |
+
<br>
|
19 |
+
<input type="checkbox" name="attr[short_description]" id="short_description" value="1">
|
20 |
+
<label for="short_description"><?php echo $this->__('Short Description') ?></label>
|
21 |
+
<br>
|
22 |
+
<input type="checkbox" name="attr[description]" id="description" value="1">
|
23 |
+
<label for="description"><?php echo $this->__('Description') ?></label>
|
24 |
+
<br>
|
25 |
+
<input type="checkbox" name="attr[meta_title]" id="meta_title" value="1">
|
26 |
+
<label for="meta_title"><?php echo $this->__('Meta Title') ?></label><br></div>
|
27 |
+
<div class="clear"></div>
|
28 |
+
<input type="submit" class="form-button right" value="Next" title="Next">
|
29 |
+
</div>
|
30 |
+
</form>
|
31 |
+
</div>
|
app/design/adminhtml/default/straker/template/straker/new/products/confirm.phtml
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
<li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
|
18 |
</ol>
|
19 |
<?php $params = $this->getRequest()->getParams(); ?>
|
20 |
-
<a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_product/new", array('store'=>$this->getStore(), 'attr'=>$this->getAttr()
|
21 |
<form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_product/submitjob") ?>" method="post">
|
22 |
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
|
23 |
<input type="hidden" name="product" value="<?php echo implode(',', $this->getProduct()) ?>" >
|
17 |
<li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
|
18 |
</ol>
|
19 |
<?php $params = $this->getRequest()->getParams(); ?>
|
20 |
+
<a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_product/new", array('store'=>$this->getStore(), 'attr'=>$this->getAttr())) ?>"><?php echo $this->__('Edit Products') ?></a>
|
21 |
<form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_product/submitjob") ?>" method="post">
|
22 |
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
|
23 |
<input type="hidden" name="product" value="<?php echo implode(',', $this->getProduct()) ?>" >
|
js/straker/translations.js
CHANGED
@@ -1,16 +1,20 @@
|
|
1 |
Event.observe(window, "load", function() {
|
2 |
-
var strakerMenu = $$("#nav LI.level0:has(A[href*=admin/straker])")[0];
|
|
|
3 |
var n = SKIN_URL.indexOf("adminhtml");
|
4 |
var imageElement = '<img style="height: 23px;margin-right: 3px;line-height: 27px;vertical-align: middle;margin-top: -2px;" id="straker_block" src="'+SKIN_URL.substring(0, n)+'adminhtml/default/straker/images/straker-translations-logo.png"." alt="" border="0" />';
|
5 |
$(strakerMenu.select(' > a > span'))[0].setStyle({display: 'inline-block'}).insert({before: imageElement});
|
6 |
|
7 |
-
var strakerAccountLink = $$('a[href*="admin/straker_new/account"]')[0];
|
|
|
|
|
8 |
strakerAccountLink.observe('click', function(event) {
|
9 |
window.open(strakerAccountLink.href, '_blank');
|
10 |
Event.stop(event);
|
11 |
});
|
12 |
|
13 |
-
var strakerTermsLink = $$('a[href*="admin/straker_new/terms"]')[0];
|
|
|
14 |
strakerTermsLink.observe('click', function(event) {
|
15 |
window.open(strakerTermsLink.href, '_blank');
|
16 |
Event.stop(event);
|
1 |
Event.observe(window, "load", function() {
|
2 |
+
// var strakerMenu = $$("#nav LI.level0:has(A[href*=admin/straker])")[0];
|
3 |
+
var strakerMenu = $$("#nav LI.level0:has(A[href*=/straker_new])")[0];
|
4 |
var n = SKIN_URL.indexOf("adminhtml");
|
5 |
var imageElement = '<img style="height: 23px;margin-right: 3px;line-height: 27px;vertical-align: middle;margin-top: -2px;" id="straker_block" src="'+SKIN_URL.substring(0, n)+'adminhtml/default/straker/images/straker-translations-logo.png"." alt="" border="0" />';
|
6 |
$(strakerMenu.select(' > a > span'))[0].setStyle({display: 'inline-block'}).insert({before: imageElement});
|
7 |
|
8 |
+
// var strakerAccountLink = $$('a[href*="admin/straker_new/account"]')[0];
|
9 |
+
var strakerAccountLink = strakerMenu.select('a[href*="/straker_new/account"]')[0];
|
10 |
+
|
11 |
strakerAccountLink.observe('click', function(event) {
|
12 |
window.open(strakerAccountLink.href, '_blank');
|
13 |
Event.stop(event);
|
14 |
});
|
15 |
|
16 |
+
// var strakerTermsLink = $$('a[href*="admin/straker_new/terms"]')[0];
|
17 |
+
var strakerTermsLink = $$('a[href*="/straker_new/terms"]')[0];
|
18 |
strakerTermsLink.observe('click', function(event) {
|
19 |
window.open(strakerTermsLink.href, '_blank');
|
20 |
Event.stop(event);
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>straker-translations-easy-translation-platform</name>
|
4 |
-
<version>1.3.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Multilingual eCommerce extensions from the award-winning global translation company
|
10 |
<description>Total automation of the translation process, simple installation and setup, quality human translation at cost-effective rates, scalable to more than 80 languages and 1000s of projects and powerful dashboard reporting.</description>
|
11 |
-
<notes>
|
12 |
-
<authors><author><name>Chris
|
13 |
-
<date>2016-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="StrakerTranslations"><dir name="EasyTranslationPlatform"><dir name="Block"><dir name="Adminhtml"><dir name="Cms"><dir name="Block"><file name="Grid.php" hash="a91cad8f4e6b0920287f69f6e995b860"/></dir><dir name="Page"><file name="Grid.php" hash="30f9866bc414f611a9f279f6fab65756"/></dir></dir><dir name="Job"><dir name="Attribute"><file name="Grid.php" hash="58111da5ce029ff247dc84d0ced569fe"/></dir><file name="Attribute.php" hash="c355f64a030766afcf646b411035f85f"/><dir name="Category"><file name="Grid.php" hash="1ae3bfd56e78e76ba9d48eac508b06bd"/></dir><file name="Category.php" hash="f2c9c52e51b2112f32065beee4c3cafe"/><dir name="Cms"><dir name="Block"><file name="Grid.php" hash="12c391e13201367a4887a407d0ffed00"/></dir><file name="Block.php" hash="e5ab4001b92c2bccc442ae4cfb59f047"/><dir name="Page"><file name="Grid.php" hash="bf37702f1a5fccef2fa628bc2c5ee71b"/></dir><file name="Page.php" hash="b7c14cf9b9892977d4c945d7d4b5e4bd"/></dir><file name="Grid.php" hash="8872f97732a139ace260973041dfca5a"/><dir name="Product"><file name="Grid.php" hash="3f7ba41da65f9d86e9a103a5050c6a18"/></dir><file name="Product.php" hash="85f95b9ffd2a3f80fb62ad37b3cf11b5"/></dir><file name="Job.php" hash="bf5ad4cd596a3a93a54447ee112c0a23"/><dir name="New"><dir name="Attribute"><dir name="Confirm"><file name="Grid.php" hash="5ab113bb0a3e42ceef939b1b52c36876"/></dir><file name="Confirm.php" hash="d7ed18d35d0df6b899b402beb0800caa"/><file name="Grid.php" hash="77a95f55bcaa1a4e74224e9a8d162b2c"/></dir><file name="Attribute.php" hash="31f61557f7c69d8b90521e60bbb79898"/><dir name="Category"><file name="Attribute.php" hash="b6698a36ee449853edff1815fca6a56f"/><dir name="Confirm"><file name="Grid.php" hash="551ab5c0bc002fb618783befed6c37b7"/></dir><file name="Confirm.php" hash="b710371dceb26866857a62f9d19425e7"/><file name="Tree.php" hash="b405b4bf4969812e13d63d752cd89c23"/></dir><dir name="Cms"><dir name="Block"><file name="Attribute.php" hash="698021304ad1346b6f8476fd629c8eed"/><dir name="Confirm"><file name="Grid.php" hash="dcf6c9a7a3a844963076b5140370507c"/></dir><file name="Confirm.php" hash="d38a9be9238e8eff3c322529e066b2ae"/><file name="Grid.php" hash="25cd4beda99cf997a108db78d6af2b32"/></dir><file name="Block.php" hash="771df45fe8fa9d24b7a920f485cc67a4"/><dir name="Page"><file name="Attribute.php" hash="3643f4821171d2efb08f478db03b2eaa"/><dir name="Confirm"><file name="Grid.php" hash="5c77ef51a041fc61422efe3467e5be75"/></dir><file name="Confirm.php" hash="ca21f36fe293b10f5a7f0be7d4acd437"/><file name="Grid.php" hash="57c94125c38f0be2729efda49873f793"/></dir><file name="Page.php" hash="d4f32301e714f1e6692ace8ed40ec5c4"/></dir><dir name="Products"><file name="Attribute.php" hash="f9b11618404c31e7ac91622a0188479d"/><dir name="Confirm"><file name="Grid.php" hash="e35a967bf2e3d9882889a67d7de26e09"/></dir><file name="Confirm.php" hash="d4dddb499ff29d646fcd48246666126a"/><file name="Grid.php" hash="df8e34c0b291730e7475513cbdc74c21"/></dir><file name="Products.php" hash="cd0c2de765d91c4c7a82cc74bb1797c9"/><file name="Register.php" hash="7f43aee445980708a6cb8510eec21e78"/><file name="Selectstore.php" hash="42553d67a4e14ca8f754ea096ddf9cf6"/><file name="Setupstore.php" hash="bc1ca941654f47f763d0e7605fc7b050"/><file name="Type.php" hash="6786a8663d019a616dfcd229f609b0cf"/></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Backupbutton.php" hash="8bfae419ddceed0553db1f5dc5322356"/><file name="Button.php" hash="eb5d2544ba93cbcd09e534dc5b81bbc1"/><file name="Restorebutton.php" hash="e98058e6769f5308fa9f48fa19a22704"/><file name="Store.php" hash="5b98d4711b04acbb60d1b7c17405a4a6"/></dir></dir></dir><dir name="Template"><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="47a1988c0136fa892856d7390af1d6bd"/><file name="AttributeOriginalLabel.php" hash="895fdf18d8993d3268d95541cca1a7a3"/><file name="AttributeOriginalOption.php" hash="3cbe41544c9a32a5742950392973a533"/><file name="AttributeTranslateLabel.php" hash="eef210480eea84f5fd69ded360697acf"/><file name="AttributeTranslateOption.php" hash="2393ee81a57d67de08d38c5e81ea9403"/><file name="Backend.php" hash="6ca085c9a5c50e635f8f4aa41d3314e1"/><file name="CmsOriginTitle.php" hash="e66578d499b77b65226ec3be9e727c56"/><file name="CmsVersion.php" hash="d396904cc2b8637e87c3332eff877436"/><file name="ConfirmTranslateLabel.php" hash="09fdb0146ab6f9fad36bff50042d2587"/><file name="ConfirmTranslateOptions.php" hash="90ba018bb7eef8d6ac3006b058d66197"/><file name="Dispute.php" hash="3bae4a4bbf43890a53a8c2698315430e"/><file name="Frontend.php" hash="f1a0c9a0b98e3e16ec28a46c11f3b71f"/><file name="Path.php" hash="5d9e268bde77a5e1d6d435a48d9f60b7"/><file name="Quote.php" hash="728f3e53af9619760a3921993a823ca6"/><file name="Refresh.php" hash="28db5556c4dad64f4d3aa808758673dd"/><file name="Selected.php" hash="88f58ed6edb419d1701a6f6a4955d881"/><file name="Status.php" hash="fd88108278d137995b6bbd2b9747a179"/><file name="StrakerTranslated.php" hash="8f6d3a963627f02fcd092c4103843c61"/><file name="TranslateOptions.php" hash="00f1c42c2205f76db4322fa0dbd686f6"/><file name="Translated.php" hash="cda1f5c402ed086974b76ee427c2a23a"/><file name="Update.php" hash="43a114983b2c00af3432e664512b1704"/><file name="Version.php" hash="908c1697bd48848a2ebf00cd38aa8dc1"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="87b463fe9801879b9e7bffce16c9a1bc"/></dir><dir name="Model"><file name="Actionlog.php" hash="bd8a61e14712e32937e0622376b07ae7"/><file name="Api.php" hash="28967043b3073fb37fc3cbdc69c3bd99"/><dir name="Attribute"><file name="Translate.php" hash="6ab35279fc74e807e433776d14155a55"/></dir><dir name="Category"><file name="Attributes.php" hash="31639770ebe8f2aa4b320d686786f716"/><file name="Translate.php" hash="63888c2d229d1cc860b2d3555470f597"/></dir><dir name="Cms"><dir name="Block"><file name="Attributes.php" hash="1df167ceeea902db512b297d601336b8"/><file name="Translate.php" hash="2603aaff40894a99122cdec6c19bcb97"/></dir><dir name="Page"><file name="Attributes.php" hash="f9aa8f988a06b442d44c5e1e3c044b0c"/><file name="Translate.php" hash="74e4749da4273c1476bd2821144b7fd1"/></dir></dir><dir name="Job"><file name="Attribute.php" hash="6bc9221934346093ec6054704625808e"/><file name="Category.php" hash="37079e7131a4d10a9577afb499c6d7b6"/><dir name="Cms"><file name="Block.php" hash="2263b8165de77cda0c368a6b127e5edb"/><file name="Page.php" hash="54cf2ffb4943b3bcffe28a5fc60a0d00"/></dir><file name="Product.php" hash="9f02ce34f909df6dd26c3414356ad565"/><file name="Status.php" hash="64c766deaf33bd0460c739f04544f8db"/><file name="Type.php" hash="c5010524e83e0c3c56595bcd72bba97d"/></dir><file name="Job.php" hash="a6c3e7074bff162029cd5a5a36cd438e"/><dir name="Product"><file name="Attributes.php" hash="f8539bb8a73a59017b811bea7d99835b"/><file name="Translate.php" hash="ebe6df5219d4ca3ee71290bf3e1de0da"/></dir><dir name="Resource"><dir name="Actionlog"><file name="Collection.php" hash="a60fb59aa09d55b5e5d4f41d58e20e6f"/></dir><file name="Actionlog.php" hash="5742408ecac5dce23b3492d118d6ca41"/><dir name="Attribute"><dir name="Translate"><file name="Collection.php" hash="dc15902d152cdc907123bbd847bc124a"/></dir><file name="Translate.php" hash="f619af9fb3bb71e346d89a314c1d0a2c"/></dir><dir name="Category"><dir name="Attributes"><file name="Collection.php" hash="d0d1bdb74c8b6d3ebcd00e986bbda5ac"/></dir><file name="Attributes.php" hash="438aefd7fd4768a18dea3835e592d020"/><dir name="Translate"><file name="Collection.php" hash="6f9b263579ba9c988dbf476a9a8d5254"/></dir><file name="Translate.php" hash="3493c3a5f4dff5278e61cf758b58f09e"/></dir><dir name="Cms"><dir name="Block"><dir name="Attributes"><file name="Collection.php" hash="877832a90560893e916e43b967e6dc34"/></dir><file name="Attributes.php" hash="09ff0c55a851e01cb84ea36d04f25991"/><dir name="Translate"><file name="Collection.php" hash="de7c22817b8216ba532469e22530fc9e"/></dir><file name="Translate.php" hash="a42c5543d64b231251c50623c06267e3"/></dir><dir name="Page"><dir name="Attributes"><file name="Collection.php" hash="e1316d1cd3595bbfb7733b2ac237796e"/></dir><file name="Attributes.php" hash="17aad05de17f6e1457ee41022acdce17"/><dir name="Translate"><file name="Collection.php" hash="6d3a9c65e8cab69179ac62d3cf4a86eb"/></dir><file name="Translate.php" hash="875bb57fe743508ff7fb46d7cb5031f9"/></dir></dir><dir name="Job"><dir name="Attribute"><file name="Collection.php" hash="e336ec26c414bdb050ae87d70487349a"/></dir><file name="Attribute.php" hash="6c096169a8867d54b37997312753a94e"/><dir name="Category"><file name="Collection.php" hash="6e29696c703503c821fb4fbeb04f7169"/></dir><file name="Category.php" hash="5cb332770a4600be8d82d5440a42a2a6"/><dir name="Cms"><dir name="Block"><file name="Collection.php" hash="6524c7d53db9e32d2802e571cc54a8ca"/></dir><file name="Block.php" hash="9de78cd2dad032b94b7a0fe32ca6b785"/><dir name="Page"><file name="Collection.php" hash="b36385630e4cd6fd25a233305bd8d359"/></dir><file name="Page.php" hash="0d449938e643605e500efc3f4c4f13ea"/></dir><file name="Collection.php" hash="26b821d388a969c048418254c702767d"/><dir name="Product"><file name="Collection.php" hash="0b333a2caf8977dbc9a8e71e58c54de6"/></dir><file name="Product.php" hash="8b0dfa9ce28bc4292021055f9253ea5d"/><dir name="Status"><file name="Collection.php" hash="84dd6c9d32fda84ea11102692b5359a9"/></dir><file name="Status.php" hash="5e29fbf619c9b1278273266fb2ce2afa"/><dir name="Type"><file name="Collection.php" hash="625b61447aee152376c19f36a347d5d8"/></dir><file name="Type.php" hash="36b8ec250e3bc2377c1fb755459fad95"/></dir><file name="Job.php" hash="e400eedb5cfc3f742e58d567412ae1a0"/><dir name="Product"><dir name="Attributes"><file name="Collection.php" hash="3f479577ce23ba9f264125439c1d1099"/></dir><file name="Attributes.php" hash="93c962dc76384771d9139574796c16b5"/><dir name="Translate"><file name="Collection.php" hash="4dc7e3a0a44edd6acea4b8cf45b40d05"/></dir><file name="Translate.php" hash="f88f7ea6f6e1dfdc55ef648ddea2ca38"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Straker"><file name="AttributeController.php" hash="e39069c05d9674ec5ca5fefb9e3f2bdc"/><file name="CategoryController.php" hash="a5ef91045b5f614a787302e9592b9720"/><dir name="Cms"><file name="BlockController.php" hash="2627bff77c3b5fafc0ad1102ce716445"/><file name="PageController.php" hash="e43d66294440afb15294217135334e80"/></dir><file name="JobController.php" hash="de5f85133df38403438c24371c0426d7"/><file name="NewController.php" hash="6351201a63cb651af2aa0575d044e35f"/><file name="ProductController.php" hash="c60649321775e486944c1146b8ba5cff"/></dir></dir><file name="CallbackController.php" hash="c9abd6304f6f071940735a47ab658633"/></dir><dir name="etc"><file name="adminhtml.xml" hash="802ab54b889201efd9318ec11f220f18"/><file name="config.xml" hash="aba6ea6ccdb6d97d77b8c3f3700723b2"/><file name="system.xml" hash="e047c334b01ea71b3108c02c1c5e7ae5"/></dir><dir name="sql"><dir name="strakertranslations_easytranslationplatform_setup"><file name="mysql4-install-1.0.0.php" hash="bb9810e99580d4a20431cd0cc22f5532"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="eb74b0ba3f3572ffc6dde4ace8d8640c"/><file name="mysql4-upgrade-1.1.0-1.2.0.php" hash="77cd0f3e3f7303b8492504dcb485e268"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="a2cb7c86542fdb7778318669b2965191"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="straker"><dir name="layout"><file name="straker.xml" hash="52ec2d65c1ac817a5f1603e916037d15"/></dir><dir name="template"><dir name="cms"><dir name="form"><file name="container.phtml" hash="9069e9f2e13f3f0c1f175920c295ee65"/></dir></dir><dir name="straker"><dir name="job"><dir name="attribute"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="attribute.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/><dir name="category"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="category.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/><dir name="cms"><dir name="block"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="block.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/><dir name="page"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="page.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/></dir><dir name="product"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="product.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/></dir><file name="job.phtml" hash="63c7a5b66b969635ee9996638878d63c"/><dir name="new"><dir name="attribute"><file name="confirm.phtml" hash="1285dfdce8a71b0af7545aa8d77b360d"/><file name="massaction.phtml" hash="9dcf11014c7a598128a64c048e0108cf"/></dir><file name="attribute.phtml" hash="9f327fe0551b9d39e455b361d662ce08"/><dir name="category"><file name="attributes.phtml" hash="c92f98e8397ae9143c17c87e2e468758"/><dir name="confirm"><file name="grid.phtml" hash="8336aad4f7275992704b1b7ddaccac3e"/></dir><file name="confirm.phtml" hash="8e10afdfc326dc5e16f8d40125bfeaf8"/><file name="tree.phtml" hash="4599d5840d9bdf21cf5c057c6112dfcc"/></dir><dir name="cms"><dir name="block"><file name="attributes.phtml" hash="b2767598f08b2159c952c446f306e717"/><file name="confirm.phtml" hash="a7369555063de98c418c6cdf64485b6c"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="block.phtml" hash="6ad391571d617ca4f262d3bc15a41d7c"/><dir name="page"><file name="attributes.phtml" hash="288ef5992432d95493f919372af419bb"/><file name="confirm.phtml" hash="329c1f0943eda97164bda08e712a929c"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="page.phtml" hash="9e5e384888f81b5933ea2deb8dd9e0e8"/></dir><file name="confirm.phtml" hash="72552d8f56335eb644a4c0ffe314f12b"/><dir name="products"><file name="attributes.phtml" hash="fdfeb163ffb82ae983b4872fe59d2b77"/><file name="confirm.phtml" hash="7905811dd324b034756d03a9b0711aca"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="products.phtml" hash="2930c175307b3178a7b8a6205981cdf2"/><file name="register.phtml" hash="13da4e89dafcdf0508343905121a6ed3"/><file name="selectstore.phtml" hash="59b46141938afec500ce3acf36da5427"/><file name="setupstore.phtml" hash="c3dab5a53f6007ac9608721bd75761bf"/><file name="type.phtml" hash="ab8bd7f6b5945af2e1dd0a9b19f0bfee"/></dir><dir name="system"><dir name="config"><file name="button.phtml" hash="9725dd1eea9e0a5c6ff9a34a31d5e433"/><file name="store.phtml" hash="accefd80ff19bf7c917c923b2aed961c"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="straker"><dir name="css"><file name="straker.css" hash="7de7c21b46326f421fcbb6363ab9e955"/><file name="straker.less" hash="5455064a2c31680a823d39bdc24997b0"/></dir><dir name="images"><dir name="default"><file name="bottom_left.gif" hash="fb99ffa815a8648f95f42698fe5dfaa1"/><file name="bottom_mid.gif" hash="49b9ca7025562ea7f070a9111282364b"/><file name="bottom_right.gif" hash="e46768f632765cd86c5fe5d0166dcf2c"/><file name="bottom_right_resize.gif" hash="1b35a4ec3b734dfe37e31ba87bcc7d99"/><file name="center_left.gif" hash="bd567580b4ee16a7a2734057cfbbe219"/><file name="center_right.gif" hash="eef184d5d89d1710313581a2ccf408e8"/><file name="clear.gif" hash="7af1206eeb0e7834a75e69d70676060d"/><file name="close.gif" hash="8a08f243c37a8e25a88d4ac135b2f07d"/><file name="inspect.gif" hash="aa2a0961067aad5c54b8634919af863b"/><file name="maximize.gif" hash="e73cd71c4979ebeadeb9e27d40a9e8fb"/><file name="minimize.gif" hash="2d2f4b1bd0506f342425f80ab76c49a3"/><file name="overlay.png" hash="536d40e87cda0c7ae7b11f1721aa52d0"/><file name="resize.gif" hash="320f534b5d444b39701e0b679529e779"/><file name="sizer.gif" hash="1b35a4ec3b734dfe37e31ba87bcc7d99"/><file name="top_left.gif" hash="9c5e5920bfc189a45cc618099af93aa8"/><file name="top_mid.gif" hash="a12ff2b944025ad2d127d033dae5e9e1"/><file name="top_right.gif" hash="0cf1ec5b93f8ac8fcce0e2f72cf7f45e"/></dir><file name="magento-banner.jpg" hash="b3105fd2dd00004ab903db4fbb81b61e"/><file name="refresh_32.png" hash="96e793bcbcc2dc48768b8e124beea378"/><file name="straker-translations-logo.png" hash="7cb5e29f562420142f918147d95ed232"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="StrakerTranslations_EasyTranslationPlatform.xml" hash="eb61fdaac7559a75e39bc01206165d0c"/></dir></target><target name="mage"><dir name="js"><dir name="straker"><file name="translations.js" hash="af7812040012a3ea23fb2782ca293884"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>straker-translations-easy-translation-platform</name>
|
4 |
+
<version>1.3.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Multilingual eCommerce extensions from the award-winning global translation company.</summary>
|
10 |
<description>Total automation of the translation process, simple installation and setup, quality human translation at cost-effective rates, scalable to more than 80 languages and 1000s of projects and powerful dashboard reporting.</description>
|
11 |
+
<notes>Bug fix release</notes>
|
12 |
+
<authors><author><name>Chris</name><user>Straker_support</user><email>extensions@strakertranslations.com</email></author></authors>
|
13 |
+
<date>2016-12-11</date>
|
14 |
+
<time>23:46:36</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="StrakerTranslations"><dir name="EasyTranslationPlatform"><dir name="Block"><dir name="Adminhtml"><dir name="Cms"><dir name="Block"><file name="Grid.php" hash="f3f619834386cc32c7b0d938d85b1b94"/></dir><dir name="Page"><file name="Grid.php" hash="b24310c42254a22bc94fa926f93735fd"/></dir></dir><dir name="Job"><dir name="Attribute"><file name="Grid.php" hash="4eae0bb7355b35a7e7b695f6add78fae"/></dir><file name="Attribute.php" hash="c355f64a030766afcf646b411035f85f"/><dir name="Category"><file name="Grid.php" hash="1052d1e5494533c80a89a5e74041f72d"/></dir><file name="Category.php" hash="f2c9c52e51b2112f32065beee4c3cafe"/><dir name="Cms"><dir name="Block"><file name="Grid.php" hash="64170c9e8cf55c3cfd5a8c9717fe665a"/></dir><file name="Block.php" hash="e5ab4001b92c2bccc442ae4cfb59f047"/><dir name="Page"><file name="Grid.php" hash="6a8406b8bf46d1e4a802b182cef19603"/></dir><file name="Page.php" hash="b7c14cf9b9892977d4c945d7d4b5e4bd"/></dir><file name="Grid.php" hash="c52dbc25e0c5c0f07f111e8dcc0f301b"/><dir name="Product"><file name="Grid.php" hash="5fd9795e42b12b97cb217fbad0e529f8"/></dir><file name="Product.php" hash="85f95b9ffd2a3f80fb62ad37b3cf11b5"/></dir><file name="Job.php" hash="bf5ad4cd596a3a93a54447ee112c0a23"/><dir name="New"><dir name="Attribute"><dir name="Confirm"><file name="Grid.php" hash="5ab113bb0a3e42ceef939b1b52c36876"/></dir><file name="Confirm.php" hash="d7ed18d35d0df6b899b402beb0800caa"/><file name="Grid.php" hash="7fd33f4b1c1b9854dd2592e2171db618"/></dir><file name="Attribute.php" hash="31f61557f7c69d8b90521e60bbb79898"/><dir name="Category"><file name="Attribute.php" hash="b6698a36ee449853edff1815fca6a56f"/><dir name="Confirm"><file name="Grid.php" hash="64fd873d16622c13581ae398eb07bbbb"/></dir><file name="Confirm.php" hash="b710371dceb26866857a62f9d19425e7"/><file name="Tree.php" hash="b405b4bf4969812e13d63d752cd89c23"/></dir><dir name="Cms"><dir name="Block"><file name="Attribute.php" hash="698021304ad1346b6f8476fd629c8eed"/><dir name="Confirm"><file name="Grid.php" hash="dcf6c9a7a3a844963076b5140370507c"/></dir><file name="Confirm.php" hash="d38a9be9238e8eff3c322529e066b2ae"/><file name="Grid.php" hash="25cd4beda99cf997a108db78d6af2b32"/></dir><file name="Block.php" hash="771df45fe8fa9d24b7a920f485cc67a4"/><dir name="Page"><file name="Attribute.php" hash="3643f4821171d2efb08f478db03b2eaa"/><dir name="Confirm"><file name="Grid.php" hash="5c77ef51a041fc61422efe3467e5be75"/></dir><file name="Confirm.php" hash="ca21f36fe293b10f5a7f0be7d4acd437"/><file name="Grid.php" hash="0916a315b664c02c94cebfa79af4a0a0"/></dir><file name="Page.php" hash="d4f32301e714f1e6692ace8ed40ec5c4"/></dir><dir name="Confirm"><file name="Grid.php" hash="49a048fe7340150dc387a30355951385"/></dir><file name="Confirm.php" hash="a903a2f53c3b44fb8c72dc70716ff0d3"/><dir name="Products"><file name="Attribute.php" hash="f9b11618404c31e7ac91622a0188479d"/><dir name="Confirm"><file name="Grid.php" hash="e35a967bf2e3d9882889a67d7de26e09"/></dir><file name="Confirm.php" hash="d4dddb499ff29d646fcd48246666126a"/><file name="Grid.php" hash="5c716c61d8b23d253b37f4755d4ea231"/></dir><file name="Products.php" hash="cd0c2de765d91c4c7a82cc74bb1797c9"/><file name="Register.php" hash="7f43aee445980708a6cb8510eec21e78"/><file name="Selectstore.php" hash="42553d67a4e14ca8f754ea096ddf9cf6"/><file name="Setupstore.php" hash="bc1ca941654f47f763d0e7605fc7b050"/><file name="Type.php" hash="6786a8663d019a616dfcd229f609b0cf"/></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Backupbutton.php" hash="8bfae419ddceed0553db1f5dc5322356"/><file name="Button.php" hash="eb5d2544ba93cbcd09e534dc5b81bbc1"/><file name="Restorebutton.php" hash="e98058e6769f5308fa9f48fa19a22704"/><file name="Store.php" hash="5b98d4711b04acbb60d1b7c17405a4a6"/></dir></dir></dir><dir name="Template"><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="47a1988c0136fa892856d7390af1d6bd"/><file name="AttributeOriginalLabel.php" hash="895fdf18d8993d3268d95541cca1a7a3"/><file name="AttributeOriginalOption.php" hash="3cbe41544c9a32a5742950392973a533"/><file name="AttributeTranslateLabel.php" hash="eef210480eea84f5fd69ded360697acf"/><file name="AttributeTranslateOption.php" hash="2393ee81a57d67de08d38c5e81ea9403"/><file name="Backend.php" hash="6ca085c9a5c50e635f8f4aa41d3314e1"/><file name="CmsOriginTitle.php" hash="e66578d499b77b65226ec3be9e727c56"/><file name="CmsVersion.php" hash="d396904cc2b8637e87c3332eff877436"/><file name="ConfirmTranslateLabel.php" hash="09fdb0146ab6f9fad36bff50042d2587"/><file name="ConfirmTranslateOptions.php" hash="90ba018bb7eef8d6ac3006b058d66197"/><file name="Dispute.php" hash="3bae4a4bbf43890a53a8c2698315430e"/><file name="Frontend.php" hash="f1a0c9a0b98e3e16ec28a46c11f3b71f"/><file name="Path.php" hash="5d9e268bde77a5e1d6d435a48d9f60b7"/><file name="Quote.php" hash="728f3e53af9619760a3921993a823ca6"/><file name="Refresh.php" hash="28db5556c4dad64f4d3aa808758673dd"/><file name="Selected.php" hash="88f58ed6edb419d1701a6f6a4955d881"/><file name="Status.php" hash="fd88108278d137995b6bbd2b9747a179"/><file name="StrakerTranslated.php" hash="8f6d3a963627f02fcd092c4103843c61"/><file name="TranslateOptions.php" hash="00f1c42c2205f76db4322fa0dbd686f6"/><file name="Translated.php" hash="cda1f5c402ed086974b76ee427c2a23a"/><file name="Update.php" hash="43a114983b2c00af3432e664512b1704"/><file name="Version.php" hash="908c1697bd48848a2ebf00cd38aa8dc1"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="8015cf21db04507b48387b9821dcd30f"/></dir><dir name="Model"><file name="Actionlog.php" hash="bd8a61e14712e32937e0622376b07ae7"/><file name="Api.php" hash="6b38c84f487d57023a243194e6ccfe18"/><dir name="Attribute"><file name="Translate.php" hash="f16a1150f44c70e92e1f5e75da3cfc0d"/></dir><dir name="Category"><file name="Attributes.php" hash="31639770ebe8f2aa4b320d686786f716"/><file name="Translate.php" hash="63888c2d229d1cc860b2d3555470f597"/></dir><dir name="Cms"><dir name="Block"><file name="Attributes.php" hash="1df167ceeea902db512b297d601336b8"/><file name="Translate.php" hash="239afe3bb57efe43687f7fd4abaabe11"/></dir><dir name="Page"><file name="Attributes.php" hash="f9aa8f988a06b442d44c5e1e3c044b0c"/><file name="Translate.php" hash="ada614e5395bea4a02694e38a9b4d761"/></dir></dir><dir name="Job"><file name="Attribute.php" hash="6bc9221934346093ec6054704625808e"/><file name="Category.php" hash="37079e7131a4d10a9577afb499c6d7b6"/><dir name="Cms"><file name="Block.php" hash="2263b8165de77cda0c368a6b127e5edb"/><file name="Page.php" hash="54cf2ffb4943b3bcffe28a5fc60a0d00"/></dir><file name="Product.php" hash="9f02ce34f909df6dd26c3414356ad565"/><file name="Status.php" hash="64c766deaf33bd0460c739f04544f8db"/><file name="Type.php" hash="c5010524e83e0c3c56595bcd72bba97d"/></dir><file name="Job.php" hash="279f6b7a8d105380389c58425467a855"/><dir name="Product"><file name="Attributes.php" hash="f8539bb8a73a59017b811bea7d99835b"/><file name="Translate.php" hash="ebe6df5219d4ca3ee71290bf3e1de0da"/></dir><dir name="Resource"><dir name="Actionlog"><file name="Collection.php" hash="a60fb59aa09d55b5e5d4f41d58e20e6f"/></dir><file name="Actionlog.php" hash="5742408ecac5dce23b3492d118d6ca41"/><dir name="Attribute"><dir name="Translate"><file name="Collection.php" hash="dc15902d152cdc907123bbd847bc124a"/></dir><file name="Translate.php" hash="f619af9fb3bb71e346d89a314c1d0a2c"/></dir><dir name="Category"><dir name="Attributes"><file name="Collection.php" hash="d0d1bdb74c8b6d3ebcd00e986bbda5ac"/></dir><file name="Attributes.php" hash="438aefd7fd4768a18dea3835e592d020"/><dir name="Translate"><file name="Collection.php" hash="6f9b263579ba9c988dbf476a9a8d5254"/></dir><file name="Translate.php" hash="3493c3a5f4dff5278e61cf758b58f09e"/></dir><dir name="Cms"><dir name="Block"><dir name="Attributes"><file name="Collection.php" hash="877832a90560893e916e43b967e6dc34"/></dir><file name="Attributes.php" hash="09ff0c55a851e01cb84ea36d04f25991"/><dir name="Translate"><file name="Collection.php" hash="de7c22817b8216ba532469e22530fc9e"/></dir><file name="Translate.php" hash="a42c5543d64b231251c50623c06267e3"/></dir><dir name="Page"><dir name="Attributes"><file name="Collection.php" hash="e1316d1cd3595bbfb7733b2ac237796e"/></dir><file name="Attributes.php" hash="17aad05de17f6e1457ee41022acdce17"/><dir name="Translate"><file name="Collection.php" hash="6d3a9c65e8cab69179ac62d3cf4a86eb"/></dir><file name="Translate.php" hash="875bb57fe743508ff7fb46d7cb5031f9"/></dir></dir><dir name="Job"><dir name="Attribute"><file name="Collection.php" hash="e336ec26c414bdb050ae87d70487349a"/></dir><file name="Attribute.php" hash="6c096169a8867d54b37997312753a94e"/><dir name="Category"><file name="Collection.php" hash="6e29696c703503c821fb4fbeb04f7169"/></dir><file name="Category.php" hash="5cb332770a4600be8d82d5440a42a2a6"/><dir name="Cms"><dir name="Block"><file name="Collection.php" hash="6524c7d53db9e32d2802e571cc54a8ca"/></dir><file name="Block.php" hash="9de78cd2dad032b94b7a0fe32ca6b785"/><dir name="Page"><file name="Collection.php" hash="b36385630e4cd6fd25a233305bd8d359"/></dir><file name="Page.php" hash="0d449938e643605e500efc3f4c4f13ea"/></dir><file name="Collection.php" hash="26b821d388a969c048418254c702767d"/><dir name="Product"><file name="Collection.php" hash="0b333a2caf8977dbc9a8e71e58c54de6"/></dir><file name="Product.php" hash="8b0dfa9ce28bc4292021055f9253ea5d"/><dir name="Status"><file name="Collection.php" hash="84dd6c9d32fda84ea11102692b5359a9"/></dir><file name="Status.php" hash="5e29fbf619c9b1278273266fb2ce2afa"/><dir name="Type"><file name="Collection.php" hash="625b61447aee152376c19f36a347d5d8"/></dir><file name="Type.php" hash="36b8ec250e3bc2377c1fb755459fad95"/></dir><file name="Job.php" hash="22b19e144ede17aa8c57f817f3c84046"/><dir name="Product"><dir name="Attributes"><file name="Collection.php" hash="3f479577ce23ba9f264125439c1d1099"/></dir><file name="Attributes.php" hash="93c962dc76384771d9139574796c16b5"/><dir name="Translate"><file name="Collection.php" hash="4dc7e3a0a44edd6acea4b8cf45b40d05"/></dir><file name="Translate.php" hash="f88f7ea6f6e1dfdc55ef648ddea2ca38"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="SiteMode.php" hash="89a8260d88855f2caea230e3466c8f9a"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Straker"><file name="AttributeController.php" hash="699a547cfbddab454f057136df40c93a"/><file name="CategoryController.php" hash="0950833563bef549cc2426f63030f6db"/><dir name="Cms"><file name="BlockController.php" hash="2627bff77c3b5fafc0ad1102ce716445"/><file name="PageController.php" hash="e43d66294440afb15294217135334e80"/></dir><file name="JobController.php" hash="34c064012ad52f06ff65b4e61df2a7f2"/><file name="NewController.php" hash="c7288367fd7f7b2488d2e1746c5edfa5"/><file name="ProductController.php" hash="ae3b984d64ce4730b0f37084f8b1add6"/></dir></dir><file name="CallbackController.php" hash="c9abd6304f6f071940735a47ab658633"/></dir><dir name="data"><dir name="strakertranslations_easytranslationplatform_setup"><file name="data-install-1.2.0.php" hash="8f64e0b9eea4fe7b0d880cd354f59412"/><file name="data-upgrade-1.2.0-1.3.0.php" hash="5e01aabbd2c80e6c6d1c3e12126a4e6e"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="802ab54b889201efd9318ec11f220f18"/><file name="config.xml" hash="19d848792a0bafdc9aa74b3f7cbbbf3a"/><file name="system.xml" hash="577f61032f35ff143513513ae5bdac95"/></dir><dir name="sql"><dir name="strakertranslations_easytranslationplatform_setup"><file name="install-1.2.0.php" hash="a93fd3369feb8cf12e1c69a8ae3bbe8b"/><file name="upgrade-1.2.0-1.3.0.php" hash="55e4e676d70e9ca6371b7b7ccd7a48e4"/><file name="upgrade-1.3.0-1.3.1.php" hash="37441781e0348f3761e677457e6b73b0"/><file name="upgrade-1.3.3-1.3.4.php" hash="5a7c214c97e3a8935feb0d7a1947c7eb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="straker"><dir name="layout"><file name="straker.xml" hash="52ec2d65c1ac817a5f1603e916037d15"/></dir><dir name="template"><dir name="cms"><dir name="form"><file name="container.phtml" hash="9069e9f2e13f3f0c1f175920c295ee65"/></dir></dir><dir name="straker"><dir name="job"><dir name="attribute"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="attribute.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/><dir name="category"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="category.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/><dir name="cms"><dir name="block"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="block.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/><dir name="page"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="page.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/></dir><dir name="product"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="product.phtml" hash="e908bcbf0ad1435a35d6009f599c4f77"/></dir><file name="job.phtml" hash="63c7a5b66b969635ee9996638878d63c"/><dir name="new"><dir name="attribute"><file name="confirm.phtml" hash="609ab700b5386b7d9549fb74f7e9025f"/><file name="massaction.phtml" hash="9dcf11014c7a598128a64c048e0108cf"/></dir><file name="attribute.phtml" hash="9f327fe0551b9d39e455b361d662ce08"/><file name="attributes.phtml" hash="a2b5136923f2afad369185077a3c4c53"/><dir name="category"><file name="attributes.phtml" hash="c92f98e8397ae9143c17c87e2e468758"/><dir name="confirm"><file name="grid.phtml" hash="8336aad4f7275992704b1b7ddaccac3e"/></dir><file name="confirm.phtml" hash="8e10afdfc326dc5e16f8d40125bfeaf8"/><file name="tree.phtml" hash="4599d5840d9bdf21cf5c057c6112dfcc"/></dir><dir name="cms"><dir name="block"><file name="attributes.phtml" hash="b2767598f08b2159c952c446f306e717"/><file name="confirm.phtml" hash="a7369555063de98c418c6cdf64485b6c"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="block.phtml" hash="6ad391571d617ca4f262d3bc15a41d7c"/><dir name="page"><file name="attributes.phtml" hash="288ef5992432d95493f919372af419bb"/><file name="confirm.phtml" hash="329c1f0943eda97164bda08e712a929c"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="page.phtml" hash="9e5e384888f81b5933ea2deb8dd9e0e8"/></dir><file name="confirm.phtml" hash="72552d8f56335eb644a4c0ffe314f12b"/><dir name="products"><file name="attributes.phtml" hash="fdfeb163ffb82ae983b4872fe59d2b77"/><file name="confirm.phtml" hash="f00acbdd4f83694b390c29346f6f0f79"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="products.phtml" hash="2930c175307b3178a7b8a6205981cdf2"/><file name="register.phtml" hash="13da4e89dafcdf0508343905121a6ed3"/><file name="selectstore.phtml" hash="59b46141938afec500ce3acf36da5427"/><file name="setupstore.phtml" hash="c3dab5a53f6007ac9608721bd75761bf"/><file name="type.phtml" hash="ab8bd7f6b5945af2e1dd0a9b19f0bfee"/></dir><dir name="system"><dir name="config"><file name="button.phtml" hash="9725dd1eea9e0a5c6ff9a34a31d5e433"/><file name="store.phtml" hash="accefd80ff19bf7c917c923b2aed961c"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="straker"><dir name="css"><file name="straker.css" hash="7de7c21b46326f421fcbb6363ab9e955"/><file name="straker.less" hash="5455064a2c31680a823d39bdc24997b0"/></dir><dir name="images"><dir name="default"><file name="bottom_left.gif" hash="fb99ffa815a8648f95f42698fe5dfaa1"/><file name="bottom_mid.gif" hash="49b9ca7025562ea7f070a9111282364b"/><file name="bottom_right.gif" hash="e46768f632765cd86c5fe5d0166dcf2c"/><file name="bottom_right_resize.gif" hash="1b35a4ec3b734dfe37e31ba87bcc7d99"/><file name="center_left.gif" hash="bd567580b4ee16a7a2734057cfbbe219"/><file name="center_right.gif" hash="eef184d5d89d1710313581a2ccf408e8"/><file name="clear.gif" hash="7af1206eeb0e7834a75e69d70676060d"/><file name="close.gif" hash="8a08f243c37a8e25a88d4ac135b2f07d"/><file name="inspect.gif" hash="aa2a0961067aad5c54b8634919af863b"/><file name="maximize.gif" hash="e73cd71c4979ebeadeb9e27d40a9e8fb"/><file name="minimize.gif" hash="2d2f4b1bd0506f342425f80ab76c49a3"/><file name="overlay.png" hash="536d40e87cda0c7ae7b11f1721aa52d0"/><file name="resize.gif" hash="320f534b5d444b39701e0b679529e779"/><file name="sizer.gif" hash="1b35a4ec3b734dfe37e31ba87bcc7d99"/><file name="top_left.gif" hash="9c5e5920bfc189a45cc618099af93aa8"/><file name="top_mid.gif" hash="a12ff2b944025ad2d127d033dae5e9e1"/><file name="top_right.gif" hash="0cf1ec5b93f8ac8fcce0e2f72cf7f45e"/></dir><file name="magento-banner.jpg" hash="b3105fd2dd00004ab903db4fbb81b61e"/><file name="refresh_32.png" hash="96e793bcbcc2dc48768b8e124beea378"/><file name="straker-translations-logo.png" hash="7cb5e29f562420142f918147d95ed232"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="StrakerTranslations_EasyTranslationPlatform.xml" hash="eb61fdaac7559a75e39bc01206165d0c"/></dir></target><target name="mage"><dir name="js"><dir name="straker"><file name="translations.js" hash="0168be67b66e071d1e8f833a959d95b7"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|