straker-translations-easy-translation-platform - Version 1.2.0

Version Notes

Initial Stable release

Download this release

Release Info

Developer Chris
Extension straker-translations-easy-translation-platform
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.0.0 to 1.2.0

Files changed (72) hide show
  1. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Attribute.php +41 -0
  2. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Attribute/Grid.php +200 -0
  3. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Category.php +12 -1
  4. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Category/Grid.php +4 -4
  5. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Grid.php +18 -11
  6. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Product.php +12 -1
  7. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Product/Grid.php +4 -4
  8. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute.php +25 -2
  9. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/{Confirm.php → Attribute/Confirm.php} +3 -4
  10. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute/Confirm/Grid.php +107 -0
  11. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute/Grid.php +170 -0
  12. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Category/Confirm/Grid.php +4 -3
  13. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Confirm/Grid.php +0 -150
  14. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Products/Confirm/Grid.php +1 -1
  15. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Products/Grid.php +40 -15
  16. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/System/Config/Form/Button.php +1 -1
  17. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/System/Config/Form/Store.php +1 -1
  18. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/Action.php +1 -1
  19. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeOriginalLabel.php +18 -0
  20. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeOriginalOption.php +19 -0
  21. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeTranslateLabel.php +18 -0
  22. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeTranslateOption.php +19 -0
  23. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/ConfirmTranslateLabel.php +28 -0
  24. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/ConfirmTranslateOptions.php +33 -0
  25. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/Selected.php +65 -0
  26. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/TranslateOptions.php +17 -0
  27. app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/Translated.php +14 -0
  28. app/code/community/StrakerTranslations/EasyTranslationPlatform/Helper/Data.php +11 -0
  29. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Attribute/Translate.php +85 -0
  30. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Job.php +191 -7
  31. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Job/Attribute.php +16 -0
  32. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Product/Translate.php +9 -3
  33. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Attribute/Translate.php +16 -0
  34. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Attribute/Translate/Collection.php +16 -0
  35. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job.php +3 -2
  36. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job/Attribute.php +16 -0
  37. app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job/Attribute/Collection.php +16 -0
  38. app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/AttributeController.php +179 -0
  39. app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/CategoryController.php +0 -1
  40. app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/JobController.php +10 -0
  41. app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/NewController.php +5 -1
  42. app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/ProductController.php +0 -1
  43. app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/adminhtml.xml +5 -1
  44. app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/config.xml +8 -2
  45. app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/system.xml +86 -86
  46. app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-install-1.0.0.php +17 -23
  47. app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.0.0-1.1.0.php +53 -0
  48. app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.1.0-1.2.0.php +218 -0
  49. app/design/adminhtml/default/straker/layout/straker.xml +11 -0
  50. app/design/adminhtml/default/straker/template/straker/job/attribute.phtml +39 -0
  51. app/design/adminhtml/default/straker/template/straker/job/attribute/massaction.phtml +87 -0
  52. app/design/adminhtml/default/straker/template/straker/job/category.phtml +4 -1
  53. app/design/adminhtml/default/straker/template/straker/job/product.phtml +4 -1
  54. app/design/adminhtml/default/straker/template/straker/new/attribute.phtml +31 -0
  55. app/design/adminhtml/default/straker/template/straker/new/attribute/confirm.phtml +42 -0
  56. app/design/adminhtml/default/straker/template/straker/new/attribute/massaction.phtml +271 -0
  57. app/design/adminhtml/default/straker/template/straker/new/attributes.phtml +0 -31
  58. app/design/adminhtml/default/straker/template/straker/new/category/attributes.phtml +8 -5
  59. app/design/adminhtml/default/straker/template/straker/new/category/confirm.phtml +9 -8
  60. app/design/adminhtml/default/straker/template/straker/new/category/tree.phtml +18 -6
  61. app/design/adminhtml/default/straker/template/straker/new/confirm.phtml +6 -5
  62. app/design/adminhtml/default/straker/template/straker/new/products.phtml +9 -5
  63. app/design/adminhtml/default/straker/template/straker/new/products/attributes.phtml +7 -5
  64. app/design/adminhtml/default/straker/template/straker/new/products/confirm.phtml +9 -8
  65. app/design/adminhtml/default/straker/template/straker/new/register.phtml +2 -2
  66. app/design/adminhtml/default/straker/template/straker/new/selectstore.phtml +12 -6
  67. app/design/adminhtml/default/straker/template/straker/new/setupstore.phtml +12 -7
  68. app/design/adminhtml/default/straker/template/straker/new/type.phtml +11 -2
  69. js/straker/translations.js +14 -2
  70. package.xml +4 -4
  71. skin/adminhtml/default/straker/css/straker.css +14 -1
  72. skin/adminhtml/default/straker/css/straker.less +19 -1
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Attribute.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Attribute extends Mage_Adminhtml_Block_Widget_Container{
3
+
4
+ protected $_job;
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setTemplate('straker/job/attribute.phtml');
10
+ }
11
+
12
+ protected function _prepareLayout()
13
+ {
14
+ $jobId = $this->getRequest()->getParam('job_id');
15
+ $jobStatus = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId)->getStatusId();
16
+ if ( $jobStatus == '4'){
17
+ $this->_addButton('publish', array(
18
+ 'label' => Mage::helper('catalog')->__('Publish All Translations'),
19
+ 'onclick' => "setLocation('{$this->getUrl('*/*/copyAll',array('job_id'=>$jobId))}');",
20
+ 'class' => 'task'
21
+ ));
22
+ }
23
+
24
+ $this->setChild('grid', $this->getLayout()->createBlock('strakertranslations_easytranslationplatform/adminhtml_job_attribute_grid', 'job_attribute.grid'));
25
+ $this->getChild('grid')->setStatusId($jobStatus);
26
+ return parent::_prepareLayout();
27
+ }
28
+
29
+ public function getGridHtml()
30
+ {
31
+ return $this->getChildHtml('grid');
32
+ }
33
+
34
+ public function getJob(){
35
+ if(!$this->_job) {
36
+ $jobId = $this->getRequest()->getParam('job_id');
37
+ $this->_job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId);
38
+ }
39
+ return $this->_job;
40
+ }
41
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Attribute/Grid.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Attribute_Grid extends Mage_Adminhtml_Block_Widget_Grid {
4
+
5
+ public function __construct() {
6
+ parent::__construct();
7
+ $this->setId('strakerJobAttributeGrid');
8
+ $this->setSaveParametersInSession(true);
9
+ }
10
+
11
+ protected function _prepareLayout()
12
+ {
13
+ $this->setChild('dispute_button',
14
+ $this->getLayout()->createBlock('adminhtml/widget_button')
15
+ ->setData(array(
16
+ 'label' => Mage::helper('catalog')->__('Feedback'),
17
+ 'onclick' => 'disputeForm.show(\''.$this->getRequest()->getParam('job_id').'\')',
18
+ 'class' => 'feedback'
19
+ ))
20
+ );
21
+
22
+ return parent::_prepareLayout();
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()->joinLeft(
33
+ array('ea' => $prefix.'eav_attribute'),
34
+ 'ea.attribute_id = main_table.attribute_id',
35
+ array('attribute_code' => 'attribute_code')
36
+ );
37
+ $collection->getSelect()->joinLeft(
38
+ array('translate' => $prefix.'straker_attribute_translate'),
39
+ 'translate.attribute_id = main_table.attribute_id AND translate.job_id = '.$job->getId(),
40
+ array('original' => 'original', 'translate' => 'translate')
41
+ );
42
+
43
+
44
+ //echo $collection->getSelect();
45
+ //die();
46
+ $this->setCollection($collection);
47
+ return parent::_prepareCollection();
48
+ }
49
+
50
+ protected function _prepareColumns() {
51
+ $this->addColumn('id', array(
52
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('ID'),
53
+ 'align' => 'right',
54
+ 'width' => '50px',
55
+ 'index' => 'id',
56
+ ));
57
+
58
+ $this->addColumn('attribute_id', array(
59
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute ID'),
60
+ 'align' => 'left',
61
+ 'index' => 'attribute_id',
62
+ ));
63
+
64
+ $this->addColumn('attribute_code', array(
65
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),
66
+ 'align' => 'left',
67
+ 'index' => 'attribute_code',
68
+ ));
69
+
70
+
71
+ $this->addColumn('label_original', array(
72
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Label - Source'),
73
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeOriginalLabel',
74
+ 'align' => 'center',
75
+ 'index' => false,
76
+ 'sortable'=> false,
77
+ 'filter' => false,
78
+ ));
79
+
80
+ $this->addColumn('option_original', array(
81
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Option - Source'),
82
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeOriginalOption',
83
+ 'align' => 'center',
84
+ 'index' => false,
85
+ 'sortable'=> false,
86
+ 'filter' => false,
87
+ ));
88
+
89
+ $this->addColumn('label_translate', array(
90
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Label - Target'),
91
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeTranslateLabel',
92
+ 'align' => 'center',
93
+ 'index' => false,
94
+ 'sortable'=> false,
95
+ 'filter' => false,
96
+ ));
97
+
98
+ $this->addColumn('option_translate', array(
99
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Option - Target'),
100
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeTranslateOption',
101
+ 'align' => 'center',
102
+ 'index' => false,
103
+ 'sortable'=> false,
104
+ 'filter' => false,
105
+ ));
106
+
107
+ if ($this->getStatusId() == '4'){
108
+ $this->addColumn('version', array(
109
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Published'),
110
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Version',
111
+ 'align' => 'center',
112
+ 'index' => false,
113
+ 'filter' => false,
114
+ ));
115
+ }
116
+
117
+ // $this->addColumn('view_backend', array(
118
+ // 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('View Backend'),
119
+ // 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Backend',
120
+ // 'align' => 'center',
121
+ // 'index' => false,
122
+ // 'filter' => false,
123
+ // ));
124
+
125
+ return parent::_prepareColumns();
126
+ }
127
+
128
+ public function getRowUrl($row) {
129
+ // return $this->getUrl('*/*/edit', array('id' => $row->getId()));
130
+ return '';
131
+ }
132
+
133
+ protected function _prepareMassaction()
134
+ {
135
+ if ($this->getStatusId() == '4') {
136
+
137
+ $this->setMassactionIdField('attribute_id');
138
+ $this->getMassactionBlock()->setFormFieldName('attribute');
139
+
140
+ $this->getMassactionBlock()->addItem('add', array(
141
+ 'label' => Mage::helper('catalog')->__('Publish Translation'),
142
+ 'url' => $this->getUrl('*/*/applyTranslation'),
143
+ 'selected' => 1
144
+ ));
145
+
146
+ $this->getMassactionBlock()->setTemplate('straker/job/attribute/massaction.phtml');
147
+
148
+ $hiddenParams = '<input type="hidden" name="job_id" value="' . $this->getRequest()->getParam('job_id') . '" />';
149
+ $this->getMassactionBlock()->setHiddenParams($hiddenParams);
150
+
151
+
152
+ // Mage::dispatchEvent('adminhtml_strakertranslation_job_product_grid_prepare_massaction', array('block' => $this));
153
+ return $this;
154
+ }
155
+ }
156
+
157
+ protected function _prepareMassactionColumn()
158
+ {
159
+ if ($this->getStatusId() == '4') {
160
+ $columnId = 'massaction';
161
+ $massactionColumn = $this->getLayout()->createBlock('adminhtml/widget_grid_column')
162
+ ->setData(array(
163
+ 'index' => $this->getMassactionIdField(),
164
+ 'use_index' => $this->getMassactionIdField(),
165
+ 'filter_index' => $this->getMassactionIdFilter(),
166
+ 'type' => 'massaction',
167
+ 'name' => $this->getMassactionBlock()->getFormFieldName(),
168
+ 'align' => 'center',
169
+ 'is_system' => true
170
+ ));
171
+
172
+ if ($this->getNoFilterMassactionColumn()) {
173
+ $massactionColumn->setData('filter', false);
174
+ }
175
+
176
+ $massactionColumn->setSelected($this->getMassactionBlock()->getSelected())
177
+ ->setGrid($this)
178
+ ->setId($columnId);
179
+
180
+ $oldColumns = $this->_columns;
181
+ $this->_columns = array();
182
+ $this->_columns[$columnId] = $massactionColumn;
183
+ $this->_columns = array_merge($this->_columns, $oldColumns);
184
+ return $this;
185
+ }
186
+ }
187
+
188
+ public function getMainButtonsHtml()
189
+ {
190
+ $html = '';
191
+ if ($this->getStatusId() == '4') {
192
+ $html .= $this->getChildHtml('dispute_button');
193
+ }
194
+ if($this->getFilterVisibility()){
195
+ $html.= $this->getResetFilterButtonHtml();
196
+ $html.= $this->getSearchButtonHtml();
197
+ }
198
+ return $html;
199
+ }
200
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Category.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
  class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category extends Mage_Adminhtml_Block_Widget_Container{
 
 
 
3
  public function __construct()
4
  {
5
  parent::__construct();
@@ -9,7 +12,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category e
9
  protected function _prepareLayout()
10
  {
11
  $jobId = $this->getRequest()->getParam('job_id');
12
- $jobStatus = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId)->getStatusId();
13
  if ( $jobStatus == '4'){
14
  $this->_addButton('publish', array(
15
  'label' => Mage::helper('catalog')->__('Publish All Translations'),
@@ -27,4 +30,12 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category e
27
  {
28
  return $this->getChildHtml('grid');
29
  }
 
 
 
 
 
 
 
 
30
  }
1
  <?php
2
  class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category extends Mage_Adminhtml_Block_Widget_Container{
3
+
4
+ protected $_job;
5
+
6
  public function __construct()
7
  {
8
  parent::__construct();
12
  protected function _prepareLayout()
13
  {
14
  $jobId = $this->getRequest()->getParam('job_id');
15
+ $jobStatus = $this->getJob()->getStatusId();
16
  if ( $jobStatus == '4'){
17
  $this->_addButton('publish', array(
18
  'label' => Mage::helper('catalog')->__('Publish All Translations'),
30
  {
31
  return $this->getChildHtml('grid');
32
  }
33
+
34
+ public function getJob(){
35
+ if(!$this->_job) {
36
+ $jobId = $this->getRequest()->getParam('job_id');
37
+ $this->_job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId);
38
+ }
39
+ return $this->_job;
40
+ }
41
  }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Category/Grid.php CHANGED
@@ -24,7 +24,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
24
  }
25
 
26
  protected function _prepareCollection() {
27
-
28
  $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
29
  $jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
30
  $collection = Mage::getModel('strakertranslations_easytranslationplatform/job_category')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
@@ -33,7 +33,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
33
  foreach($jobAttributes as $jobAttribute){
34
  $attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
35
  $collection->getSelect()->joinLeft(
36
- array($attributeCode => 'straker_category_translate'),
37
  $attributeCode.'.category_id = main_table.category_id AND '.$attributeCode.'.attribute_id = '.$jobAttribute->getAttributeId(). ' AND '
38
  .$attributeCode.'.job_id = '.$job->getId(),
39
  array($attributeCode.'_original' => 'original', $attributeCode.'_translate' => 'translate')
@@ -73,13 +73,13 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Category_G
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 Original', $attrModel->getFrontendLabel()),
77
  'align' => 'left',
78
  'index' => $attributeCode.'_original',
79
  ));
80
 
81
  $this->addColumn($attributeCode.'_translate', array(
82
- 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s Translate', $attrModel->getFrontendLabel()),
83
  'align' => 'left',
84
  'index' => $attributeCode.'_translate',
85
  ));
24
  }
25
 
26
  protected function _prepareCollection() {
27
+ $prefix = Mage::getConfig()->getTablePrefix()->__toString();
28
  $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
29
  $jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
30
  $collection = Mage::getModel('strakertranslations_easytranslationplatform/job_category')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
33
  foreach($jobAttributes as $jobAttribute){
34
  $attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
35
  $collection->getSelect()->joinLeft(
36
+ array($attributeCode => $prefix.'straker_category_translate'),
37
  $attributeCode.'.category_id = main_table.category_id AND '.$attributeCode.'.attribute_id = '.$jobAttribute->getAttributeId(). ' AND '
38
  .$attributeCode.'.job_id = '.$job->getId(),
39
  array($attributeCode.'_original' => 'original', $attributeCode.'_translate' => 'translate')
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
  ));
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Grid.php CHANGED
@@ -23,19 +23,19 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Grid exten
23
  $collection = Mage::getModel('strakertranslations_easytranslationplatform/job')->getCollection();
24
 
25
  $collection->getSelect()->joinLeft(
26
- 'straker_job_type',
27
- 'straker_job_type.type_id = main_table.type_id',
28
  'type_name'
29
  );
30
  $collection->getSelect()->joinLeft(
31
- 'straker_job_status',
32
- 'straker_job_status.status_id = main_table.status_id',
33
  'status_name'
34
 
35
  );
36
  $collection->getSelect()->joinLeft(
37
- 'core_store',
38
- 'core_store.store_id = main_table.store_id',
39
  'name'
40
  );
41
  $this->setCollection($collection);
@@ -71,26 +71,33 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Grid exten
71
  ));
72
 
73
  $this->addColumn('type_name', array(
74
- 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Type'),
75
  'align' => 'left',
76
  'index' => 'type_name',
77
  ));
78
 
 
 
 
 
 
 
 
79
  $this->addColumn('name', array(
80
- 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Store'),
81
  'align' => 'left',
82
  'index' => 'name',
83
- 'filter_index' =>'core_store.name',
84
  ));
85
 
86
  $this->addColumn('sl', array(
87
- 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Language From'),
88
  'align' => 'left',
89
  'index' => 'sl',
90
  ));
91
 
92
  $this->addColumn('tl', array(
93
- 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Language To'),
94
  'align' => 'left',
95
  'index' => 'tl',
96
  ));
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',
28
  'type_name'
29
  );
30
  $collection->getSelect()->joinLeft(
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'),
38
+ Mage::getSingleton('core/resource')->getTableName('core/store').'.store_id = main_table.store_id',
39
  'name'
40
  );
41
  $this->setCollection($collection);
71
  ));
72
 
73
  $this->addColumn('type_name', array(
74
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Content Type'),
75
  'align' => 'left',
76
  'index' => 'type_name',
77
  ));
78
 
79
+ $this->addColumn('selected', array(
80
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Content Selected'),
81
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Selected',
82
+ 'align' => 'center',
83
+ 'filter' => false,
84
+ ));
85
+
86
  $this->addColumn('name', array(
87
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Store View'),
88
  'align' => 'left',
89
  'index' => 'name',
90
+ 'filter_index' => Mage::getSingleton('core/resource')->getTableName('core/store').'.name',
91
  ));
92
 
93
  $this->addColumn('sl', array(
94
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Source Language'),
95
  'align' => 'left',
96
  'index' => 'sl',
97
  ));
98
 
99
  $this->addColumn('tl', array(
100
+ 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('Target Language'),
101
  'align' => 'left',
102
  'index' => 'tl',
103
  ));
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Product.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
  class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product extends Mage_Adminhtml_Block_Widget_Container{
 
 
 
3
  public function __construct()
4
  {
5
  parent::__construct();
@@ -9,7 +12,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product ex
9
  protected function _prepareLayout()
10
  {
11
  $jobId = $this->getRequest()->getParam('job_id');
12
- $jobStatus = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId)->getStatusId();
13
  if ( $jobStatus == '4'){
14
  $this->_addButton('publish', array(
15
  'label' => Mage::helper('catalog')->__('Publish All Translations'),
@@ -27,4 +30,12 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product ex
27
  {
28
  return $this->getChildHtml('grid');
29
  }
 
 
 
 
 
 
 
 
30
  }
1
  <?php
2
  class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product extends Mage_Adminhtml_Block_Widget_Container{
3
+
4
+ protected $_job;
5
+
6
  public function __construct()
7
  {
8
  parent::__construct();
12
  protected function _prepareLayout()
13
  {
14
  $jobId = $this->getRequest()->getParam('job_id');
15
+ $jobStatus = $this->getJob()->getStatusId();
16
  if ( $jobStatus == '4'){
17
  $this->_addButton('publish', array(
18
  'label' => Mage::helper('catalog')->__('Publish All Translations'),
30
  {
31
  return $this->getChildHtml('grid');
32
  }
33
+
34
+ public function getJob(){
35
+ if(!$this->_job) {
36
+ $jobId = $this->getRequest()->getParam('job_id');
37
+ $this->_job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId);
38
+ }
39
+ return $this->_job;
40
+ }
41
  }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Job/Product/Grid.php CHANGED
@@ -24,7 +24,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
24
  }
25
 
26
  protected function _prepareCollection() {
27
-
28
  $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
29
  $jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
30
  $collection = Mage::getModel('strakertranslations_easytranslationplatform/job_product')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
@@ -33,7 +33,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
33
  foreach($jobAttributes as $jobAttribute){
34
  $attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
35
  $collection->getSelect()->joinLeft(
36
- array($attributeCode => 'straker_product_translate'),
37
  $attributeCode.'.product_id = main_table.product_id AND '.$attributeCode.'.attribute_id = '.$jobAttribute->getAttributeId(). ' AND '
38
  .$attributeCode.'.job_id = '.$job->getId(),
39
  array($attributeCode.'_original' => 'original', $attributeCode.'_translate' => 'translate')
@@ -73,13 +73,13 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Job_Product_Gr
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 Original', $attrModel->getFrontendLabel()),
77
  'align' => 'left',
78
  'index' => $attributeCode.'_original',
79
  ));
80
 
81
  $this->addColumn($attributeCode.'_translate', array(
82
- 'header' => Mage::helper('strakertranslations_easytranslationplatform')->__('%s Translate', $attrModel->getFrontendLabel()),
83
  'align' => 'left',
84
  'index' => $attributeCode.'_translate',
85
  ));
24
  }
25
 
26
  protected function _prepareCollection() {
27
+ $prefix = Mage::getConfig()->getTablePrefix()->__toString();
28
  $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
29
  $jobAttributes = Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')->getCollection()->addFieldToFilter('job_id', $job->getId());
30
  $collection = Mage::getModel('strakertranslations_easytranslationplatform/job_product')->getCollection()->addFieldToFilter('main_table.job_id', $job->getId());
33
  foreach($jobAttributes as $jobAttribute){
34
  $attributeCode = Mage::getModel('eav/entity_attribute')->load($jobAttribute->getAttributeId())->getAttributeCode();
35
  $collection->getSelect()->joinLeft(
36
+ array($attributeCode => $prefix.'straker_product_translate'),
37
  $attributeCode.'.product_id = main_table.product_id AND '.$attributeCode.'.attribute_id = '.$jobAttribute->getAttributeId(). ' AND '
38
  .$attributeCode.'.job_id = '.$job->getId(),
39
  array($attributeCode.'_original' => 'original', $attributeCode.'_translate' => 'translate')
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
  ));
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute.php CHANGED
@@ -1,6 +1,29 @@
1
  <?php
2
  class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Attribute extends Mage_Adminhtml_Block_Widget_Container{
3
- protected function _beforeToHtml(){
4
- $this->setTemplate('straker/new/attributes.phtml');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  }
6
  }
1
  <?php
2
  class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Attribute 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/attribute.phtml');
11
+ }
12
+
13
+ protected function _prepareLayout()
14
+ {
15
+ $this->setChild('grid', $this->getLayout()->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_attribute_grid', 'attribute.grid', array('setup_store_id' => $this->getSetupStoreId() )));
16
+ return parent::_prepareLayout();
17
+ }
18
+
19
+
20
+ /**
21
+ * Render grid
22
+ *
23
+ * @return string
24
+ */
25
+ public function getGridHtml()
26
+ {
27
+ return $this->getChildHtml('grid');
28
  }
29
  }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/{Confirm.php → Attribute/Confirm.php} RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Confirm extends Mage_Adminhtml_Block_Widget_Container
3
  {
4
  /**
5
  * Set template
@@ -7,7 +7,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Confirm ex
7
  public function __construct()
8
  {
9
  parent::__construct();
10
- $this->setTemplate('straker/new/confirm.phtml');
11
  }
12
 
13
  /**
@@ -20,11 +20,10 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Confirm ex
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
 
1
  <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Attribute_Confirm extends Mage_Adminhtml_Block_Widget_Container
3
  {
4
  /**
5
  * Set template
7
  public function __construct()
8
  {
9
  parent::__construct();
10
+ $this->setTemplate('straker/new/attribute/confirm.phtml');
11
  }
12
 
13
  /**
20
  $this->_addButton('submit', array(
21
  'label' => Mage::helper('catalog')->__('Submit'),
22
  'onclick' => "$('submit-new-job-form').submit();",
 
23
  'class' => 'task'
24
  ));
25
 
26
+ $this->setChild('grid', $this->getLayout()->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_attribute_confirm_grid', 'product.grid', array('store' => $this->getStore(), 'attribute' => $this->getAttribute(), 'option' => $this->getOption())));
27
  return parent::_prepareLayout();
28
  }
29
 
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute/Confirm/Grid.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Attribute_Confirm_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('strakerAttribute');
9
+ $this->setDefaultSort('attribute_code');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ $this->setUseAjax(false);
13
+ }
14
+
15
+ protected function _prepareLayout()
16
+ {
17
+ return $this;
18
+ }
19
+
20
+ protected function _prepareColumns()
21
+ {
22
+ parent::_prepareColumns();
23
+
24
+
25
+ $this->addColumn('attribute_code', array(
26
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),
27
+ 'sortable'=>true,
28
+ 'filter' => false,
29
+ 'index'=>'attribute_code'
30
+ ));
31
+
32
+ $this->addColumn('frontend_label', array(
33
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Label'),
34
+ 'sortable'=>true,
35
+ 'filter' => false,
36
+ 'index'=>'frontend_label'
37
+ ));
38
+
39
+ $this->addColumn('translate_label', array(
40
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Label'),
41
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_ConfirmTranslateLabel',
42
+ 'align' => 'center',
43
+ 'index' => false,
44
+ 'sortable'=> false,
45
+ 'filter' => false,
46
+ ));
47
+
48
+ $this->addColumn('translate_options', array(
49
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Options'),
50
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_ConfirmTranslateOptions',
51
+ 'align' => 'center',
52
+ 'index' => false,
53
+ 'sortable'=> false,
54
+ 'filter' => false,
55
+ ));
56
+
57
+ $this->addColumn('is_visible', array(
58
+ 'header'=>Mage::helper('catalog')->__('Visible'),
59
+ 'sortable'=>true,
60
+ 'index'=>'is_visible_on_front',
61
+ 'type' => 'options',
62
+ 'filter' => false,
63
+ 'options' => array(
64
+ '1' => Mage::helper('catalog')->__('Yes'),
65
+ '0' => Mage::helper('catalog')->__('No'),
66
+ ),
67
+ 'align' => 'center',
68
+ ));
69
+
70
+ return $this;
71
+ }
72
+
73
+ protected function _prepareCollection()
74
+ {
75
+ if ($this->getOption()) {
76
+ $attributeIds = array_unique(
77
+ array_merge(
78
+ $this->getAttribute(),
79
+ explode(',', $this->getOption())
80
+ )
81
+ );
82
+ }
83
+ else {
84
+ $attributeIds = $this->getAttribute();
85
+ }
86
+ $collection = Mage::getResourceModel('catalog/product_attribute_collection')
87
+ ->addFieldToFilter('main_table.attribute_id', $attributeIds)
88
+ ->addVisibleFilter();
89
+ $this->setCollection($collection);
90
+
91
+ return parent::_prepareCollection();
92
+ }
93
+
94
+ public function getGridUrl()
95
+ {
96
+ return $this->getUrl('*/*/addtoconfirm', array('_current'=>true));
97
+ }
98
+
99
+ public function getRowUrl($row)
100
+ {
101
+ return '';
102
+ }
103
+
104
+ public function getAttrArray(){
105
+ return explode(',', $this->getAttr());
106
+ }
107
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Attribute/Grid.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Attribute_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId('attributeGrid');
8
+ $this->setDefaultSort('attribute_code');
9
+ $this->setDefaultDir('ASC');
10
+ }
11
+
12
+ protected function _getStore()
13
+ {
14
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
15
+ return Mage::app()->getStore($storeId);
16
+ }
17
+
18
+ /**
19
+ * Prepare product attributes grid collection object
20
+ *
21
+ * @return Mage_Adminhtml_Block_Catalog_Product_Attribute_Grid
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
+ new Zend_Db_Expr('('.$jobAttributeQuery.')'),
39
+ 'main_table.attribute_id = t.attribute_id',
40
+ array('version')
41
+
42
+ );
43
+ $this->setCollection($collection);
44
+
45
+ return parent::_prepareCollection();
46
+ }
47
+
48
+
49
+ /**
50
+ * Prepare product attributes grid columns
51
+ *
52
+ * @return Mage_Adminhtml_Block_Catalog_Product_Attribute_Grid
53
+ */
54
+ protected function _prepareColumns()
55
+ {
56
+ parent::_prepareColumns();
57
+
58
+
59
+ $this->addColumn('attribute_code', array(
60
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),
61
+ 'sortable'=>true,
62
+ 'index'=>'attribute_code',
63
+ 'filter' => false
64
+ ));
65
+
66
+ $this->addColumn('frontend_label', array(
67
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Label'),
68
+ 'sortable'=>true,
69
+ 'index'=>'frontend_label'
70
+ ));
71
+
72
+ $this->addColumn('translate_options', array(
73
+ 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Options'),
74
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_TranslateOptions',
75
+ 'align' => 'center',
76
+ 'index' => false,
77
+ 'sortable'=> false,
78
+ 'filter' => false,
79
+ ));
80
+
81
+ $this->addColumn('is_visible', array(
82
+ 'header'=>Mage::helper('catalog')->__('Visible'),
83
+ 'sortable'=>true,
84
+ 'index'=>'is_visible_on_front',
85
+ 'type' => 'options',
86
+ 'options' => array(
87
+ '1' => Mage::helper('catalog')->__('Yes'),
88
+ '0' => Mage::helper('catalog')->__('No'),
89
+ ),
90
+ 'align' => 'center',
91
+ ));
92
+
93
+ $this->addColumn('version',
94
+ array(
95
+ 'header'=> Mage::helper('catalog')->__('Translated'),
96
+ 'width' => '70px',
97
+ 'index' => 'version',
98
+ 'type' => 'options',
99
+ 'options' => array(
100
+ 'Translated' => Mage::helper('catalog')->__('Translated'),
101
+ 'Not Translated' => Mage::helper('catalog')->__('Not Translated')
102
+ ),
103
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated',
104
+ 'filter_condition_callback' => array($this, '_versionFilter'),
105
+ ));
106
+
107
+ return $this;
108
+ }
109
+
110
+ protected function _versionFilter($collection, $column)
111
+ {
112
+ if (!$value = $column->getFilter()->getValue()) {
113
+ return $this;
114
+ }
115
+
116
+ if ($value == 'Translated' ){
117
+ $collection->getSelect()->where('t.version is not null');
118
+ // print $this->getCollection()->getSelect(); exit;
119
+
120
+ } elseif ($value == 'Not Translated'){
121
+ $collection->getSelect()->where('t.version is null');
122
+ }
123
+
124
+ return $this;
125
+ }
126
+
127
+ protected function _prepareMassaction()
128
+ {
129
+ $this->setMassactionIdField('attribute_id');
130
+ $this->setMassactionIdFilter('main_table.attribute_id');
131
+ $this->getMassactionBlock()->setFormFieldName('attribute');
132
+
133
+ $this->getMassactionBlock()->addItem('add', array(
134
+ 'label'=> Mage::helper('catalog')->__('Add to Confirm Page'),
135
+ 'url' => $this->getUrl('*/*/addtoconfirm'),
136
+ 'selected' => 1
137
+ ));
138
+ $this->getMassactionBlock()->setTemplate('straker/new/attribute/massaction.phtml');
139
+
140
+ //todo: refine this
141
+ $hiddenParams = '<input type="hidden" name="store" value="'.$this->getRequest()->getParam('store').'" /><input type="hidden" name="option" value="'.$this->getRequest()->getParam('internal_option').'" />';
142
+ $this->getMassactionBlock()->setHiddenParams($hiddenParams);
143
+
144
+ Mage::dispatchEvent('adminhtml_strakertranslation_new_products_grid_prepare_massaction', array('block' => $this));
145
+ return $this;
146
+
147
+ }
148
+
149
+ public function getAttributesWithOption(){
150
+ $AttributeIdsWithOption = clone $this->getCollection()->getSelect();
151
+ $AttributeIdsWithOption->reset(Zend_Db_Select::ORDER);
152
+ $AttributeIdsWithOption->reset(Zend_Db_Select::LIMIT_COUNT);
153
+ $AttributeIdsWithOption->reset(Zend_Db_Select::LIMIT_OFFSET);
154
+ $AttributeIdsWithOption->reset(Zend_Db_Select::COLUMNS);
155
+ $AttributeIdsWithOption->reset(Zend_Db_Select::COLUMNS);
156
+ $AttributeIdsWithOption->where('frontend_input=?','select');
157
+ $AttributeIdsWithOption->columns('attribute_id', 'main_table');
158
+ return Mage::getSingleton('core/resource')->getConnection('core_read')->fetchCol($AttributeIdsWithOption);
159
+ }
160
+
161
+ public function getGridUrl()
162
+ {
163
+ return $this->getUrl('*/*/new', array('_current'=>true));
164
+ }
165
+
166
+ public function getRowUrl($row)
167
+ {
168
+ return '';
169
+ }
170
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Category/Confirm/Grid.php CHANGED
@@ -34,9 +34,10 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Category_C
34
  }
35
 
36
  //join straker job product table to get version for each product
 
37
  $collection->getSelect()->joinLeft(
38
- 'straker_job_category',
39
- 'straker_job_category.category_id = e.entity_id',
40
  'version'
41
  );
42
 
@@ -77,7 +78,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Category_C
77
  if (in_array('name',$this->getAttrArray())) {
78
  $this->addColumn('name',
79
  array(
80
- 'header' => Mage::helper('catalog')->__('Name to translate'),
81
  'index' => 'name',
82
  'filter' => false,
83
  'sortable' => false
34
  }
35
 
36
  //join straker job product table to get version for each product
37
+ $prefix = Mage::getConfig()->getTablePrefix()->__toString();
38
  $collection->getSelect()->joinLeft(
39
+ $prefix.'straker_job_category',
40
+ $prefix.'straker_job_category.category_id = e.entity_id',
41
  'version'
42
  );
43
 
78
  if (in_array('name',$this->getAttrArray())) {
79
  $this->addColumn('name',
80
  array(
81
+ 'header' => Mage::helper('catalog')->__('Name to Translate'),
82
  'index' => 'name',
83
  'filter' => false,
84
  'sortable' => false
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Confirm/Grid.php DELETED
@@ -1,150 +0,0 @@
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/Confirm/Grid.php CHANGED
@@ -105,7 +105,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products_C
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
  ));
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
  ));
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/New/Products/Grid.php CHANGED
@@ -63,12 +63,19 @@ 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
 
67
  //join straker job product table to get version for each product
68
  $collection->getSelect()->joinLeft(
69
- 'straker_job_product',
70
- 'straker_job_product.product_id = e.entity_id',
71
- 'version'
 
 
72
  );
73
 
74
  $this->setCollection($collection);
@@ -89,15 +96,15 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products_G
89
  null,
90
  'left');
91
  }
92
-
93
- if ($column->getId() == 'version') {
94
- $this->getCollection()->joinField('version',
95
- 'straker_job_product',
96
- 'version',
97
- 'product_id=entity_id',
98
- null,
99
- 'left');
100
- }
101
 
102
  }
103
  return parent::_addColumnFilterToCollection($column);
@@ -170,9 +177,11 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products_G
170
  'index' => 'version',
171
  'type' => 'options',
172
  'options' => array(
173
- 1 => Mage::helper('catalog')->__('Translated'),
174
- '' => Mage::helper('catalog')->__('Not Translated')
175
- )
 
 
176
  ));
177
 
178
  if (!Mage::app()->isSingleStoreMode()) {
@@ -190,6 +199,22 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products_G
190
  return parent::_prepareColumns();
191
  }
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  protected function _prepareMassaction()
194
  {
195
  $this->setMassactionIdField('entity_id');
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
+ new Zend_Db_Expr('('.$jobProductQuery.')'),
76
+ 'e.entity_id = t.product_id',
77
+ array('version')
78
+
79
  );
80
 
81
  $this->setCollection($collection);
96
  null,
97
  'left');
98
  }
99
+ //
100
+ // if ($column->getId() == 'version') {
101
+ // $this->getCollection()->joinField('version',
102
+ // 'straker_job_product',
103
+ // 'version',
104
+ // 'product_id=entity_id',
105
+ // null,
106
+ // 'left');
107
+ // }
108
 
109
  }
110
  return parent::_addColumnFilterToCollection($column);
177
  'index' => 'version',
178
  'type' => 'options',
179
  'options' => array(
180
+ 'Translated' => Mage::helper('catalog')->__('Translated'),
181
+ 'Not Translated' => Mage::helper('catalog')->__('Not Translated')
182
+ ),
183
+ 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated',
184
+ 'filter_condition_callback' => array($this, '_versionFilter'),
185
  ));
186
 
187
  if (!Mage::app()->isSingleStoreMode()) {
199
  return parent::_prepareColumns();
200
  }
201
 
202
+ protected function _versionFilter($collection, $column)
203
+ {
204
+ if (!$value = $column->getFilter()->getValue()) {
205
+ return $this;
206
+ }
207
+
208
+ if ($value == 'Translated' ){
209
+ $this->getCollection()->getSelect()->where('t.version is not null');
210
+
211
+ } elseif ($value == 'Not Translated'){
212
+ $this->getCollection()->getSelect()->where('t.version is null');
213
+ }
214
+
215
+ return $this;
216
+ }
217
+
218
  protected function _prepareMassaction()
219
  {
220
  $this->setMassactionIdField('entity_id');
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/System/Config/Form/Button.php CHANGED
@@ -41,7 +41,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_System_Config_
41
  $button = $this->getLayout()->createBlock('adminhtml/widget_button')
42
  ->setData(array(
43
  'id' => 'straker_clear_button',
44
- 'label' => $this->helper('adminhtml')->__('Clear All Settings'),
45
  'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl('adminhtml/straker_new/clearSettings').'\');'
46
  ));
47
 
41
  $button = $this->getLayout()->createBlock('adminhtml/widget_button')
42
  ->setData(array(
43
  'id' => 'straker_clear_button',
44
+ 'label' => $this->helper('adminhtml')->__('Clear All Language Settings'),
45
  'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl('adminhtml/straker_new/clearSettings').'\');'
46
  ));
47
 
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/System/Config/Form/Store.php CHANGED
@@ -42,7 +42,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_System_Config_
42
  }
43
  else{
44
 
45
- return '<div class="empty-button">'.$this->__('No settings found.').'</div>';
46
  }
47
  }
48
  }
42
  }
43
  else{
44
 
45
+ return '<div class="empty-button">'.$this->__('No language settings applied').'</div>';
46
  }
47
  }
48
  }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/Action.php CHANGED
@@ -6,7 +6,7 @@ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_
6
  {
7
  if (get_class($row) == get_class(Mage::getModel('strakertranslations_easytranslationplatform/job'))) {
8
 
9
- $buttonText = $row->getStatusId() == 4 ? $this->__('Publish') : $this->__('View');
10
 
11
  $out = '<button id="button-update-'.$row->getId().'" style="margin: 5px; display: block;" onclick="event.stopPropagation(); setLocation(\'' . Mage::helper("adminhtml")->getUrl("adminhtml/straker_".strtolower($row->getTypeName()).'/', array('job_id' => $row->getId())) . '\')" title="View" type="button" style="">'.$buttonText.'</button>';
12
  return $out;
6
  {
7
  if (get_class($row) == get_class(Mage::getModel('strakertranslations_easytranslationplatform/job'))) {
8
 
9
+ $buttonText = $row->getStatusId() == 4 ? $this->__('Confirm') : $this->__('View');
10
 
11
  $out = '<button id="button-update-'.$row->getId().'" style="margin: 5px; display: block;" onclick="event.stopPropagation(); setLocation(\'' . Mage::helper("adminhtml")->getUrl("adminhtml/straker_".strtolower($row->getTypeName()).'/', array('job_id' => $row->getId())) . '\')" title="View" type="button" style="">'.$buttonText.'</button>';
12
  return $out;
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeOriginalLabel.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeOriginalLabel
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ public function render(Varien_Object $row){
6
+ $original = $this->xml2array(simplexml_load_string($row->getOriginal()));
7
+
8
+ return !empty($original['title']) ? $original['title'] : 'N/A';
9
+ }
10
+
11
+ public function xml2array ( $xmlObject, $out = array () )
12
+ {
13
+ foreach ( (array) $xmlObject as $index => $node )
14
+ $out[$index] = ( is_object ( $node ) ) ? $this->xml2array ( $node ) : $node;
15
+
16
+ return $out;
17
+ }
18
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeOriginalOption.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeOriginalOption
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+
6
+ public function render(Varien_Object $row){
7
+ $original = $this->xml2array(simplexml_load_string($row->getOriginal()));
8
+
9
+ return !empty($original['option']) ? implode(', ', $original['option']) : 'N/A';
10
+ }
11
+
12
+ public function xml2array ( $xmlObject, $out = array () )
13
+ {
14
+ foreach ( (array) $xmlObject as $index => $node )
15
+ $out[$index] = ( is_object ( $node ) ) ? $this->xml2array ( $node ) : $node;
16
+
17
+ return $out;
18
+ }
19
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeTranslateLabel.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeTranslateLabel
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ public function render(Varien_Object $row){
6
+ $original = $this->xml2array(simplexml_load_string($row->getTranslate()));
7
+
8
+ return !empty($original['title']) ? $original['title'] : 'N/A';
9
+ }
10
+
11
+ public function xml2array ( $xmlObject, $out = array () )
12
+ {
13
+ foreach ( (array) $xmlObject as $index => $node )
14
+ $out[$index] = ( is_object ( $node ) ) ? $this->xml2array ( $node ) : $node;
15
+
16
+ return $out;
17
+ }
18
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/AttributeTranslateOption.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_AttributeTranslateOption
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+
6
+ public function render(Varien_Object $row){
7
+ $original = $this->xml2array(simplexml_load_string($row->getTranslate()));
8
+
9
+ return !empty($original['option']) ? implode(', ', $original['option']) : 'N/A';
10
+ }
11
+
12
+ public function xml2array ( $xmlObject, $out = array () )
13
+ {
14
+ foreach ( (array) $xmlObject as $index => $node )
15
+ $out[$index] = ( is_object ( $node ) ) ? $this->xml2array ( $node ) : $node;
16
+
17
+ return $out;
18
+ }
19
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/ConfirmTranslateLabel.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_ConfirmTranslateLabel
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ protected $_storeId;
6
+
7
+ protected $_label;
8
+
9
+ public function render(Varien_Object $row){
10
+ $id = $row->getAttributeId();
11
+ $html = '<input disabled type="checkbox" name="option" value="' . $id . '" class="checkbox-option"';
12
+ if (in_array($id, $this->_getLabel())) {
13
+ $html .= ' checked="checked" >';
14
+ }
15
+ else{
16
+ $html .= ' >';
17
+ }
18
+ return $html;
19
+ }
20
+
21
+ protected function _getLabel(){
22
+ if(!$this->_label){
23
+ $this->_label = $this->getRequest()->getParam('attribute');
24
+ }
25
+ return $this->_label;
26
+ }
27
+
28
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/ConfirmTranslateOptions.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_ConfirmTranslateOptions
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ protected $_storeId;
6
+
7
+ protected $_option;
8
+
9
+ public function render(Varien_Object $row){
10
+ $id = $row->getAttributeId();
11
+ if ($row->getFrontendInput()=='select') {
12
+ $html = '<input disabled type="checkbox" name="option" value="' . $id . '" class="checkbox-option"';
13
+ if (in_array($id, $this->_getOption())) {
14
+ $html .= ' checked="checked" >';
15
+ }
16
+ else{
17
+ $html .= ' >';
18
+ }
19
+ }
20
+ else{
21
+ $html = 'N/A';
22
+ }
23
+ return $html;
24
+ }
25
+
26
+ protected function _getOption(){
27
+ if(!$this->_option){
28
+ $this->_option = explode(',' ,$this->getRequest()->getParam('option'));
29
+ }
30
+ return $this->_option;
31
+ }
32
+
33
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/Selected.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Selected
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ public function render(Varien_Object $row){
6
+
7
+ if (get_class($row) == get_class(Mage::getModel('strakertranslations_easytranslationplatform/job') )) {
8
+
9
+ switch ($row->getTypeName()) {
10
+ case 'Product':
11
+
12
+ $productAttrubuteCollection =
13
+ Mage::getModel('strakertranslations_easytranslationplatform/product_attributes')
14
+ ->getCollection()->addFieldToFilter('job_id', $row->getId());
15
+
16
+ $output =array();
17
+
18
+ foreach ($productAttrubuteCollection as $productAttrubute) {
19
+ $output[] = $this->_getAttributeLabel($productAttrubute->getAttributeId());
20
+ }
21
+ $html = implode(', ', $output);
22
+
23
+ break;
24
+
25
+ case 'Category':
26
+
27
+ $categoryAttrubuteCollection =
28
+ Mage::getModel('strakertranslations_easytranslationplatform/category_attributes')
29
+ ->getCollection()->addFieldToFilter('job_id', $row->getId());
30
+
31
+ $output =array();
32
+
33
+ foreach ($categoryAttrubuteCollection as $categoryAttrubute) {
34
+ $output[] = $this->_getAttributeLabel($categoryAttrubute->getAttributeId());
35
+ }
36
+ $html = implode(', ', $output);
37
+
38
+ break;
39
+
40
+ case 'Attribute':
41
+
42
+ $AttributeCollection =
43
+ Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')
44
+ ->getCollection()->addFieldToFilter('job_id', $row->getId());
45
+
46
+ $output = count($AttributeCollection);
47
+
48
+ $html = $output > 1 ? "$output Attributes" : '1 Attribute';
49
+
50
+ break;
51
+
52
+ default:
53
+ $html = '';
54
+
55
+ }
56
+
57
+ return $html;
58
+ }
59
+
60
+ }
61
+
62
+ private function _getAttributeLabel($attributeId) {
63
+ return Mage::getModel('eav/entity_attribute')->load($attributeId)->getFrontendLabel();
64
+ }
65
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/TranslateOptions.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_TranslateOptions
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ protected $_storeId;
6
+
7
+ public function render(Varien_Object $row){
8
+ if ($row->getFrontendInput()=='select') {
9
+ $html = '<input type="checkbox" name="option" value="' . $row->getAttributeId() . '" class="checkbox-option">';
10
+ }
11
+ else{
12
+ $html = 'N/A';
13
+ }
14
+ return $html;
15
+ }
16
+
17
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Block/Adminhtml/Template/Grid/Renderer/Translated.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated
3
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ public function render(Varien_Object $row)
6
+ {
7
+ if($row->getVersion()){
8
+ return 'Translated';
9
+ }
10
+ else{
11
+ return 'Not Translated';
12
+ }
13
+ }
14
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Helper/Data.php CHANGED
@@ -20,4 +20,15 @@ class StrakerTranslations_EasyTranslationPlatform_Helper_Data extends Mage_Core_
20
  $result['to'] = Mage::getStoreConfig('straker/general/to', $storeId);
21
  return ($result['source'] && $result['from'] && $result['to']) ? $result : false;
22
  }
 
 
 
 
 
 
 
 
 
 
 
23
  }
20
  $result['to'] = Mage::getStoreConfig('straker/general/to', $storeId);
21
  return ($result['source'] && $result['from'] && $result['to']) ? $result : false;
22
  }
23
+
24
+ public function renderNewJobHeading($storeId){
25
+ $destinationStore = Mage::getModel('core/store')->load($storeId);
26
+ $destinationText = $destinationStore->getFrontendName().' ('.$destinationStore->getName().')';
27
+
28
+ $config = $this->getStoreSetup($storeId);
29
+ $sourceStore = Mage::getModel('core/store')->load($config['source']);
30
+ $sourceText = $sourceStore->getFrontendName().' ('.$sourceStore->getName().')';
31
+
32
+ return $sourceText . ' > ' . $destinationText;
33
+ }
34
  }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Attribute/Translate.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: WlliamZhao
5
+ * Date: 18/01/16
6
+ * Time: 7:41 PM
7
+ */
8
+ class StrakerTranslations_EasyTranslationPlatform_Model_Attribute_Translate extends Mage_Core_Model_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('strakertranslations_easytranslationplatform/attribute_translate');
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
+ $writeConnection->query("
34
+ INSERT INTO `" . $prefix . "eav_attribute_label` ( `attribute_id`, `store_id`, `value`)
35
+ SELECT {$attributeId}, {$storeId}, '{$attribute}'
36
+ FROM (select 1) as a
37
+ WHERE NOT EXISTS(
38
+ select `attribute_label_id`
39
+ from `" . $prefix . "eav_attribute_label`
40
+ where `attribute_id`={$attributeId} and `store_id` ={$storeId});");
41
+
42
+ $writeConnection->query("
43
+ UPDATE `" . $prefix . "eav_attribute_label` SET `value` = '{$attribute}'
44
+ where `attribute_id`={$attributeId} and `store_id` ={$storeId} limit 1;");
45
+
46
+ }
47
+
48
+ if ($k = 'option'){
49
+ foreach ($attribute as $optionId => $optionValue) {
50
+
51
+ $optionId = str_replace('id_', '',$optionId);
52
+
53
+ $writeConnection->query("
54
+ INSERT INTO `" . $prefix . "eav_attribute_option_value` ( `option_id`, `store_id`, `value`)
55
+ SELECT {$optionId}, {$storeId}, '{$optionValue}'
56
+ FROM (select 1) as a
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
+ $writeConnection->query("
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
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Job.php CHANGED
@@ -33,7 +33,7 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
33
 
34
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
35
 
36
- $query = 'INSERT INTO `straker_job_product` (`product_id`, `job_id`) VALUES ';
37
  $queryVals = array();
38
  foreach ($productIds as $productId) {
39
  $queryVals[] = '(' . (int) $productId . ', ' . $this->getId() . ')';
@@ -50,7 +50,7 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
50
 
51
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
52
 
53
- $query = 'INSERT INTO `straker_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) {
@@ -79,7 +79,7 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
79
 
80
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
81
 
82
- $query = 'INSERT INTO `straker_job_category` (`category_id`, `job_id`) VALUES ';
83
  $queryVals = array();
84
  foreach ($categoryIds as $categoryId) {
85
  $queryVals[] = '(' . (int) $categoryId . ', ' . $this->getId() . ')';
@@ -96,7 +96,7 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
96
 
97
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
98
 
99
- $query = 'INSERT INTO `straker_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) {
@@ -108,6 +108,87 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
108
  return $this;
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  public function addProducts($productAttributeIds,$productIds){
112
 
113
  if (!$this->getId()){
@@ -192,6 +273,23 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
192
  return $this;
193
  }
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  protected function _createProductTranslateFile() {
196
 
197
  $_xml = '<?xml version="1.0" encoding="utf-8"?><root>';
@@ -250,10 +348,56 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
250
  return $this;
251
  }
252
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  protected function _summitJob(){
254
 
255
  $request = array();
256
 
 
 
 
 
 
257
  $request['title'] = $this->getTitle();
258
  $request['sl'] = $this->getSl();
259
  $request['tl'] = $this->getTl();
@@ -302,6 +446,16 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
302
  return $this;
303
  }
304
 
 
 
 
 
 
 
 
 
 
 
305
  public function updateQuote(){
306
 
307
  if ($this->getJobKey()){
@@ -386,11 +540,40 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
386
 
387
  $data = simplexml_load_string($xml);
388
 
 
 
389
  foreach ($data->children() as $_translation) {
390
 
391
  $_entityTranslationId = (string) $_translation->attributes()->content_id;
392
- $_entityTranslation = Mage::getModel('strakertranslations_easytranslationplatform/'.$this->_getType().'_translate')->load($_entityTranslationId);
393
- $_entityTranslation->setTranslate((string) $_translation->value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  $_entityTranslation->save();
395
  $_entityTranslation->clearInstance();
396
  }
@@ -437,7 +620,8 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Job extends Mage_Core_Mo
437
 
438
  if (!$updatedIds[$entityId]){
439
  $updatedIds[$entityId] = true;
440
- $writeConnection->update('straker_job_'.$this->_getType() ,array('version' => 1), $this->_getType()."_id = {$entityId} and job_id ={$this->getId()}" );
 
441
  }
442
  }
443
 
33
 
34
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
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
  $queryVals[] = '(' . (int) $productId . ', ' . $this->getId() . ')';
50
 
51
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
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) {
79
 
80
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
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
  $queryVals[] = '(' . (int) $categoryId . ', ' . $this->getId() . ')';
96
 
97
  $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
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) {
108
  return $this;
109
  }
110
 
111
+ public function array_to_xml( $data, &$xml_data ) {
112
+ foreach( $data as $key => $value ) {
113
+ if( is_array($value) ) {
114
+ if( is_numeric($key) ){
115
+ $key = 'item'.$key; //dealing with <0/>..<n/> issues
116
+ }
117
+ $subnode = $xml_data->addChild($key);
118
+ $this->array_to_xml($value, $subnode);
119
+ } else {
120
+ $xml_data->addChild("$key",htmlspecialchars("$value"));
121
+ }
122
+ }
123
+ }
124
+
125
+ protected function addAttributeTranslateOriginal($attributeData){
126
+
127
+ $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
128
+
129
+ $query = 'INSERT INTO `'.Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/straker_attribute_translate').'` (`job_id`, `attribute_id`, `original`) VALUES ';
130
+ $queryVals = array();
131
+
132
+ foreach ($attributeData as $attributeId => $translate) {
133
+
134
+ $original = array();
135
+
136
+ $original['title'] = $translate['label'] ? Mage::getModel('catalog/resource_eav_attribute')->load($attributeId)->getStoreLabel($this->getSourceStore()) : '';
137
+
138
+
139
+ if ($translate['option'] ){
140
+ $attributeOptioinCollection = Mage::getModel('eav/entity_attribute_option')
141
+ ->getCollection()
142
+ ->setStoreFilter($this->getSourceStore())
143
+ ->setAttributeFilter($attributeId);
144
+
145
+ foreach ($attributeOptioinCollection as $attributeOptioin) {
146
+ $original['option']['id_'.$attributeOptioin->getoptionId()] = $attributeOptioin->getValue();
147
+ }
148
+ }
149
+
150
+ $xml = new SimpleXMLElement('<attribute/>');
151
+
152
+ $this->array_to_xml($original, $xml);
153
+
154
+
155
+ $queryVals[] = '(' . $this->getId() . ', ' . $attributeId . ', \'' . addslashes($xml->asXML()). '\')';
156
+
157
+
158
+
159
+ }
160
+
161
+ $writeConnection->query( $query . implode(',', $queryVals));
162
+
163
+ return $this;
164
+
165
+
166
+
167
+ }
168
+
169
+
170
+
171
+
172
+ protected function addAttributeIds($attributeData){
173
+
174
+
175
+ $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
176
+
177
+ $query = 'INSERT INTO `'.Mage::getSingleton('core/resource')->getTableName('strakertranslations_easytranslationplatform/job_attribute').'` (`attribute_id`, `translate_lable`, `translate_option`, `job_id` ) VALUES ';
178
+ $queryVals = array();
179
+
180
+ foreach ($attributeData as $attributeId => $translate) {
181
+
182
+ $queryVals[] = '(' . (int) $attributeId . ', '. $translate['label'] .', '. $translate['option'] .', '. $this->getId() . ')';
183
+ }
184
+
185
+ $writeConnection->query( $query . implode(',', $queryVals));
186
+
187
+ return $this;
188
+
189
+ }
190
+
191
+
192
  public function addProducts($productAttributeIds,$productIds){
193
 
194
  if (!$this->getId()){
273
  return $this;
274
  }
275
 
276
+ public function addAttributes($attributeData){
277
+
278
+ if (!$this->getId()){
279
+ if (!$this->getStoreId()){
280
+ Mage::throwException('Error: Missing Store Id');
281
+ }
282
+ $this->setSourceStore(Mage::getStoreConfig('straker/general/source',$this->getStoreId()));
283
+ $this->save();
284
+ }
285
+
286
+ $this->addAttributeIds($attributeData);
287
+
288
+ $this->addAttributeTranslateOriginal($attributeData);
289
+
290
+ return $this;
291
+ }
292
+
293
  protected function _createProductTranslateFile() {
294
 
295
  $_xml = '<?xml version="1.0" encoding="utf-8"?><root>';
348
  return $this;
349
  }
350
 
351
+ protected function _createAttributeTranslateFile() {
352
+
353
+ $_xml = '<?xml version="1.0" encoding="utf-8"?><root>';
354
+
355
+ $attributeTranslateCollection = Mage::getModel('strakertranslations_easytranslationplatform/attribute_translate')->getCollection();
356
+ $attributeTranslateCollection->addFieldToFilter('job_id',$this->getId());
357
+
358
+ foreach ($attributeTranslateCollection as $attributeTranslate ){
359
+
360
+ $dataInJson = json_encode(simplexml_load_string($attributeTranslate->getOriginal()));
361
+ $data = json_decode($dataInJson,true);
362
+
363
+ foreach ($data as $k => $attribute ){
364
+ if ($k == 'title' && $attribute){
365
+ $_xml .= '<data name="' .$this->getTypeId(). '_' . $this->getStoreId().'_'. $attributeTranslate->getAttributeId().'" ' ;
366
+ $_xml .= 'content_context="product attribute title" ';
367
+ $_xml .= 'content_id="'. $attributeTranslate->getId() .'">';
368
+ $_xml .= '<value><![CDATA['.$attribute.']]></value></data>';
369
+ }
370
+
371
+ if ($k = 'option'){
372
+ foreach ($attribute as $optionId => $optionValue) {
373
+ $_xml .= '<data name="' .$this->getTypeId(). '_' . $this->getStoreId().'_'. $attributeTranslate->getAttributeId().'" ' ;
374
+ $_xml .= 'content_context="product attribute option" ';
375
+ $_xml .= 'option_id="'. $optionId .'" ';
376
+ $_xml .= 'content_id="'. $attributeTranslate->getId() .'">';
377
+ $_xml .= '<value><![CDATA['.$optionValue.']]></value></data>';
378
+ }
379
+
380
+ }
381
+
382
+ }
383
+ }
384
+ $_xml .='</root>';
385
+
386
+ file_put_contents(Mage::getBaseDir().$this->_translateFilePath.'job'.$this->getId().'.xml',$_xml);
387
+ $this->setSourceFile('job'.$this->getId().'.xml')->save() ;
388
+
389
+ return $this;
390
+ }
391
+
392
  protected function _summitJob(){
393
 
394
  $request = array();
395
 
396
+ if (!$this->getTitle()){
397
+ $store = Mage::getModel('core/store')->load($this->getStoreId());
398
+ $defaultTitle = $store->getFrontendName().'_'.$store->getName().'_'.Mage::getModel('core/date')->timestamp();
399
+ $this->setTitle($defaultTitle);
400
+ }
401
  $request['title'] = $this->getTitle();
402
  $request['sl'] = $this->getSl();
403
  $request['tl'] = $this->getTl();
446
  return $this;
447
  }
448
 
449
+ public function submitAttributes($attributeData){
450
+
451
+ //category
452
+ $this->setTypeId(4);
453
+ $this->addAttributes($attributeData)
454
+ ->_createAttributeTranslateFile()
455
+ ->_summitJob();
456
+ return $this;
457
+ }
458
+
459
  public function updateQuote(){
460
 
461
  if ($this->getJobKey()){
540
 
541
  $data = simplexml_load_string($xml);
542
 
543
+ $_translationValueGroup = array();
544
+
545
  foreach ($data->children() as $_translation) {
546
 
547
  $_entityTranslationId = (string) $_translation->attributes()->content_id;
548
+ if ($this->_getType() == 'attribute'){
549
+ if ($_translation->attributes()->content_context =="product attribute title"){
550
+ $_translationValueGroup[$_entityTranslationId]['title'] = (string) $_translation->value;
551
+ }
552
+
553
+ if ($_translation->attributes()->content_context =="product attribute option"){
554
+ $_translationValueGroup[$_entityTranslationId]['option']['id_'. $_translation->attributes()->option_id] = (string) $_translation->value;
555
+ }
556
+
557
+ }
558
+ else {
559
+ $_translationValueGroup[$_entityTranslationId] = (string)$_translation->value;
560
+ }
561
+
562
+ }
563
+
564
+ foreach ($_translationValueGroup as $content_id => $_translationValue ){
565
+
566
+ $value = $_translationValue;
567
+
568
+ if (is_array($_translationValue)){
569
+ $xml = new SimpleXMLElement('<attribute/>');
570
+ $this->array_to_xml($_translationValue,$xml);
571
+ $value = (string) $xml->asXML();
572
+ }
573
+
574
+
575
+ $_entityTranslation = Mage::getModel('strakertranslations_easytranslationplatform/'.$this->_getType().'_translate')->load($content_id);
576
+ $_entityTranslation->setTranslate($value);
577
  $_entityTranslation->save();
578
  $_entityTranslation->clearInstance();
579
  }
620
 
621
  if (!$updatedIds[$entityId]){
622
  $updatedIds[$entityId] = true;
623
+ $prefix = Mage::getConfig()->getTablePrefix()->__toString();
624
+ $writeConnection->update($prefix.'straker_job_'.$this->_getType() ,array('version' => 1), $this->_getType()."_id = {$entityId} and job_id ={$this->getId()}" );
625
  }
626
  }
627
 
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Job/Attribute.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: WlliamZhao
5
+ * Date: 18/01/16
6
+ * Time: 7:39 PM
7
+ */
8
+ class StrakerTranslations_EasyTranslationPlatform_Model_Job_Attribute extends Mage_Core_Model_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('strakertranslations_easytranslationplatform/job_attribute');
14
+ }
15
+
16
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Product/Translate.php CHANGED
@@ -15,15 +15,21 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Product_Translate extend
15
 
16
  public function importTranslation(){
17
 
 
 
 
 
 
 
18
  $product = Mage::getModel('catalog/product')->setStoreId($this->getStoreId())->load($this->getProductId());
19
 
20
  $productAttributeCode = $this->_getAttributeCode($this->getAttributeId());
21
 
22
  $this->setBackup($product->getData($productAttributeCode));
23
 
24
- $product->setData($productAttributeCode, $this->getTranslate())
25
- ->getResource()
26
- ->saveAttribute($product, $productAttributeCode);
27
  $this->setIsImported(1)->save();
28
 
29
  $product->clearInstance();
15
 
16
  public function importTranslation(){
17
 
18
+ //if translated value is null, skip
19
+ $translatedValue = $this->getTranslate();
20
+ if (is_null($translatedValue)){
21
+ return;
22
+ }
23
+
24
  $product = Mage::getModel('catalog/product')->setStoreId($this->getStoreId())->load($this->getProductId());
25
 
26
  $productAttributeCode = $this->_getAttributeCode($this->getAttributeId());
27
 
28
  $this->setBackup($product->getData($productAttributeCode));
29
 
30
+ $product->setData($productAttributeCode, $translatedValue)
31
+ ->getResource()
32
+ ->saveAttribute($product, $productAttributeCode);
33
  $this->setIsImported(1)->save();
34
 
35
  $product->clearInstance();
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Attribute/Translate.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: WlliamZhao
5
+ * Date: 18/01/16
6
+ * Time: 7:41 PM
7
+ */
8
+ class StrakerTranslations_EasyTranslationPlatform_Model_Resource_Attribute_Translate extends Mage_Core_Model_Resource_Db_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('strakertranslations_easytranslationplatform/straker_attribute_translate', 'id');
14
+ }
15
+
16
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Attribute/Translate/Collection.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: WlliamZhao
5
+ * Date: 18/01/16
6
+ * Time: 7:41 PM
7
+ */
8
+ class StrakerTranslations_EasyTranslationPlatform_Model_Resource_Attribute_Translate_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('strakertranslations_easytranslationplatform/attribute_translate');
14
+ }
15
+
16
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job.php CHANGED
@@ -13,13 +13,14 @@ class StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job extends Mag
13
  }
14
 
15
  protected function _getLoadSelect($field, $value, $object) {
 
16
  $select = parent::_getLoadSelect($field, $value, $object)
17
  ->join(array('t' => $this->getTable('strakertranslations_easytranslationplatform/job_type')),
18
- 'straker_job.type_id=t.type_id',
19
  array('type_name')
20
  )
21
  ->join(array('s' => $this->getTable('strakertranslations_easytranslationplatform/job_status')),
22
- 'straker_job.status_id=s.status_id',
23
  array('status_name')
24
  );
25
 
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
+ $prefix.'straker_job.type_id=t.type_id',
20
  array('type_name')
21
  )
22
  ->join(array('s' => $this->getTable('strakertranslations_easytranslationplatform/job_status')),
23
+ $prefix.'straker_job.status_id=s.status_id',
24
  array('status_name')
25
  );
26
 
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job/Attribute.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: WlliamZhao
5
+ * Date: 18/01/16
6
+ * Time: 7:39 PM
7
+ */
8
+ class StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute extends Mage_Core_Model_Resource_Db_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('strakertranslations_easytranslationplatform/job_attribute', 'id');
14
+ }
15
+
16
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/Model/Resource/Job/Attribute/Collection.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: WlliamZhao
5
+ * Date: 18/01/16
6
+ * Time: 7:39 PM
7
+ */
8
+ class StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('strakertranslations_easytranslationplatform/job_attribute');
14
+ }
15
+
16
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/AttributeController.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_AttributeController extends Mage_Adminhtml_Controller_Action{
3
+ protected function _isAllowed()
4
+ {
5
+ return Mage::getSingleton('admin/session')->isAllowed('admin/straker/job');
6
+ }
7
+
8
+ protected function _initAction()
9
+ {
10
+ $this
11
+ ->loadLayout()
12
+ ->_setActiveMenu('straker/job')
13
+ ;
14
+
15
+ return $this;
16
+ }
17
+
18
+ protected function _initNewAction()
19
+ {
20
+ $this
21
+ ->loadLayout()
22
+ ->_setActiveMenu('straker/new')
23
+ ;
24
+
25
+ return $this;
26
+ }
27
+
28
+
29
+ public function indexAction(){
30
+
31
+ if (!$this->getRequest()->getParam('job_id')){
32
+ Mage::getSingleton('adminhtml/session')->addError('Job ID missing');
33
+ $this->_redirect('*/straker_job/');
34
+ return;
35
+ }
36
+
37
+ $this->_title($this->__('Straker Translations'))
38
+ ->_title($this->__('Manage Jobs'));
39
+
40
+ $this->loadLayout()->_setActiveMenu('straker/job');
41
+ $this->renderLayout();
42
+
43
+ }
44
+
45
+ public function newAction(){
46
+ $params = $this->getRequest()->getParams();
47
+ if (empty($params['store'])) {
48
+ $this->_redirect('*/straker_new');
49
+ return;
50
+ }
51
+ else{
52
+ return $this->_initNewAction()
53
+ ->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_attribute','strakertranslations_easytranslationplatform_new_attribute',array('setup_store_id' => $params['store'])))
54
+ ->renderLayout();
55
+ }
56
+ }
57
+
58
+ public function addtoconfirmAction(){
59
+ $data = $this->getRequest()->getParams();
60
+ if( $data['store'] && ($data['attribute'] || $data['option']) ){
61
+ return $this->_initAction()
62
+ ->_addContent(Mage::getSingleton('core/layout')->createBlock('strakertranslations_easytranslationplatform/adminhtml_new_attribute_confirm', 'strakertranslations_easytranslationplatform_new_attribute_confirm', array('store' => $data['store'], 'attribute' => $data['attribute']?$data['attribute']:array(), 'option' => $data['option']?$data['option']:array())))
63
+ ->renderLayout();
64
+ }
65
+ else {
66
+ $this->_redirect('*/straker_new/', $data);
67
+ }
68
+ }
69
+
70
+ public function submitjobAction(){
71
+ $data = $this->getRequest()->getParams();
72
+ if( $data['store'] && isset($data['attribute']) && isset($data['option']) ){
73
+ $attribute = !empty($data['attribute'])?explode(',', $data['attribute']):array();
74
+ $option = !empty($data['option'])?explode(',', $data['option']):array();
75
+ //prepare attribute array in nested
76
+ foreach( array_unique( array_merge(
77
+ $attribute,
78
+ $option
79
+ ) ) as $attributeId) {
80
+
81
+ $attributeData[$attributeId]['label'] = in_array($attributeId, $attribute, true) ? 1 : 0;
82
+ $attributeData[$attributeId]['option'] = in_array($attributeId, $option, true) ? 1 : 0;
83
+
84
+ }
85
+
86
+
87
+
88
+
89
+
90
+ //todo: insert model submit job from here
91
+ // var_dump($attributeData); die();
92
+
93
+ $jobModel = Mage::getModel('strakertranslations_easytranslationplatform/job');
94
+ try {
95
+ $jobModel->checkAndCreateFolder();
96
+ }
97
+ catch (Mage_Core_Exception $e){
98
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
99
+ $this->_redirect('*/*/', array(
100
+ 'store' => $data['store'],
101
+ 'attr' => $data['attr']
102
+ ));
103
+ return;
104
+ }
105
+ foreach(explode(',', $data['attr']) as $attributeCode){
106
+ $attr_ids[] = $attribute = Mage::getSingleton('eav/config')
107
+ ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $attributeCode)->getAttributeId();
108
+ }
109
+ $helper = Mage::helper('strakertranslations_easytranslationplatform');
110
+ $storeSetup = $helper->getStoreSetup($data['store']);
111
+ $jobModel->setStoreId($data['store']);
112
+ $jobModel->setSl($storeSetup['from']);
113
+ $jobModel->setTl($storeSetup['to']);
114
+ $jobModel->setToken('Token');
115
+ $jobModel->submitAttributes($attributeData);
116
+ if ($jobModel->getLastStatus()) {
117
+ Mage::getSingleton('adminhtml/session')->addSuccess('New job created');
118
+ $this->_redirect('*/straker_job/');
119
+ }
120
+ else{
121
+ Mage::getSingleton('adminhtml/session')->addError($jobModel->getLastMessage());
122
+ $this->_redirect('*/*/new');
123
+ }
124
+ }
125
+ else {
126
+ $this->_redirect('*/*/new', $data);
127
+ }
128
+ }
129
+
130
+ public function copyAllAction(){
131
+ $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($this->getRequest()->getParam('job_id'));
132
+
133
+ if (!$job->getId()){
134
+ Mage::getSingleton('adminhtml/session')->addError('Job ID missing');
135
+ $this->_redirect('*/straker_job/');
136
+ return;
137
+ }
138
+
139
+ if($job->applyTranslation()) {
140
+ Mage::getSingleton('adminhtml/session')->addSuccess('Translation has been applied.');
141
+ $this->_redirect('*/straker_job/');
142
+ return;
143
+ } else {
144
+ Mage::getSingleton('adminhtml/session')->addError('Error when applying translation.');
145
+ $this->_redirect('*/straker_job/');
146
+ return;
147
+ }
148
+
149
+ }
150
+
151
+ public function applyTranslationAction(){
152
+ $jobId = $this->getRequest()->getParam('job_id');
153
+ $job = Mage::getModel('strakertranslations_easytranslationplatform/job')->load($jobId);
154
+
155
+ if (!$job->getId()){
156
+ Mage::getSingleton('adminhtml/session')->addError('Job ID missing');
157
+ $this->_redirect('*/straker_job/');
158
+ return;
159
+ }
160
+ $attributeIds = $this->getRequest()->getParam('attribute');
161
+ if(!empty($attributeIds)) {
162
+ if ($job->applyTranslation($attributeIds)) {
163
+ Mage::getSingleton('adminhtml/session')->addSuccess('Translation has been applied.');
164
+ $this->_redirect('*/straker_attribute/',array('job_id' => $jobId));
165
+ return;
166
+ } else {
167
+ Mage::getSingleton('adminhtml/session')->addError('Error when applying translation.');
168
+ $this->_redirect('*/straker_attribute/',array('job_id' => $jobId));
169
+ return;
170
+ }
171
+ }
172
+ else{
173
+ Mage::getSingleton('adminhtml/session')->addError('Please select attributes to apply the translation.');
174
+ $this->_redirect('*/straker_attribute/',array('job_id' => $jobId));
175
+ return;
176
+ }
177
+
178
+ }
179
+ }
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/CategoryController.php CHANGED
@@ -94,7 +94,6 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_CategoryCont
94
  $jobModel->setStoreId($data['store']);
95
  $jobModel->setSl($storeSetup['from']);
96
  $jobModel->setTl($storeSetup['to']);
97
- $jobModel->setTitle('Title');
98
  $jobModel->setToken('Token');
99
  $jobModel->submitCategories($attr_ids, explode(',',$data['category']));
100
  if ($jobModel->getLastStatus()) {
94
  $jobModel->setStoreId($data['store']);
95
  $jobModel->setSl($storeSetup['from']);
96
  $jobModel->setTl($storeSetup['to']);
 
97
  $jobModel->setToken('Token');
98
  $jobModel->submitCategories($attr_ids, explode(',',$data['category']));
99
  if ($jobModel->getLastStatus()) {
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/JobController.php CHANGED
@@ -16,6 +16,16 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_JobControlle
16
  }
17
 
18
  public function indexAction(){
 
 
 
 
 
 
 
 
 
 
19
  $this->_title($this->__('Straker Translations'))
20
  ->_title($this->__('Manage Jobs'));
21
 
16
  }
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', 2)
24
+ ->addFieldToFilter('quote', array('null' => true));
25
+ foreach($collection as $job){
26
+ $job->updateQuote();
27
+ }
28
+
29
  $this->_title($this->__('Straker Translations'))
30
  ->_title($this->__('Manage Jobs'));
31
 
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/NewController.php CHANGED
@@ -16,7 +16,11 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_NewControlle
16
  }
17
 
18
  public function accountAction(){
19
- $this->_redirectUrl("http://myaccount.strakertranslations.com/");
 
 
 
 
20
  }
21
 
22
  public function indexAction(){
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(){
app/code/community/StrakerTranslations/EasyTranslationPlatform/controllers/Adminhtml/Straker/ProductController.php CHANGED
@@ -116,7 +116,6 @@ Class StrakerTranslations_EasyTranslationPlatform_Adminhtml_Straker_ProductContr
116
  $jobModel->setStoreId($data['store']);
117
  $jobModel->setSl($storeSetup['from']);
118
  $jobModel->setTl($storeSetup['to']);
119
- $jobModel->setTitle('Title');
120
  $jobModel->setToken('Token');
121
  $jobModel->submitProducts($attr_ids, explode(',',$data['product']));
122
  if ($jobModel->getLastStatus()) {
116
  $jobModel->setStoreId($data['store']);
117
  $jobModel->setSl($storeSetup['from']);
118
  $jobModel->setTl($storeSetup['to']);
 
119
  $jobModel->setToken('Token');
120
  $jobModel->submitProducts($attr_ids, explode(',',$data['product']));
121
  if ($jobModel->getLastStatus()) {
app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/adminhtml.xml CHANGED
@@ -3,7 +3,6 @@
3
  <menu>
4
  <straker>
5
  <title>Straker Translations</title>
6
- <class>test</class>
7
  <label><![CDATA[<div style="position: absolute;"><img id="straker_logo" src="" alt="" border="0" /></div>&nbsp;<script>
8
  var n = SKIN_URL.indexOf("adminhtml");
9
  $('straker_logo').src = SKIN_URL.substring(0, n) + "adminhtml/default/straker/images/straker/straker-translations-logo.png";
@@ -30,6 +29,11 @@
30
  <action>adminhtml/straker_new/account</action>
31
  <sort_order>30</sort_order>
32
  </account>
 
 
 
 
 
33
  </children>
34
  </straker>
35
  </menu>
3
  <menu>
4
  <straker>
5
  <title>Straker Translations</title>
 
6
  <label><![CDATA[<div style="position: absolute;"><img id="straker_logo" src="" alt="" border="0" /></div>&nbsp;<script>
7
  var n = SKIN_URL.indexOf("adminhtml");
8
  $('straker_logo').src = SKIN_URL.substring(0, n) + "adminhtml/default/straker/images/straker/straker-translations-logo.png";
29
  <action>adminhtml/straker_new/account</action>
30
  <sort_order>30</sort_order>
31
  </account>
32
+ <terms translate="title">
33
+ <title><![CDATA[Terms & Conditions]]></title>
34
+ <action>adminhtml/straker_new/terms</action>
35
+ <sort_order>40</sort_order>
36
+ </terms>
37
  </children>
38
  </straker>
39
  </menu>
app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <StrakerTranslations_EasyTranslationPlatform>
5
- <version>1.0.0</version>
6
  </StrakerTranslations_EasyTranslationPlatform>
7
  </modules>
8
  <global>
@@ -44,6 +44,12 @@
44
  <category_attributes>
45
  <table>straker_category_attributes</table>
46
  </category_attributes>
 
 
 
 
 
 
47
  </entities>
48
  </strakertranslations_easytranslationplatform_resource>
49
  </models>
@@ -123,4 +129,4 @@
123
  </api_url>
124
  </straker>
125
  </default>
126
- </config>
2
  <config>
3
  <modules>
4
  <StrakerTranslations_EasyTranslationPlatform>
5
+ <version>1.2.0</version>
6
  </StrakerTranslations_EasyTranslationPlatform>
7
  </modules>
8
  <global>
44
  <category_attributes>
45
  <table>straker_category_attributes</table>
46
  </category_attributes>
47
+ <job_attribute>
48
+ <table>straker_job_attribute</table>
49
+ </job_attribute>
50
+ <straker_attribute_translate>
51
+ <table>straker_attribute_translate</table>
52
+ </straker_attribute_translate>
53
  </entities>
54
  </strakertranslations_easytranslationplatform_resource>
55
  </models>
129
  </api_url>
130
  </straker>
131
  </default>
132
+ </config>
app/code/community/StrakerTranslations/EasyTranslationPlatform/etc/system.xml CHANGED
@@ -8,7 +8,7 @@
8
  </tabs>
9
  <sections>
10
  <straker>
11
- <label>Easy Translation Platform</label>
12
  <tab>straker</tab>
13
  <frontend_type>text</frontend_type>
14
  <sort_order>20</sort_order>
@@ -33,15 +33,15 @@
33
  <show_in_store>1</show_in_store>
34
  </access_token>
35
  <!--<application_key translate="label comment" >-->
36
- <!--<label>Application Key</label>-->
37
- <!--<frontend_type>text</frontend_type>-->
38
- <!--<sort_order>20</sort_order>-->
39
- <!--<show_in_default>1</show_in_default>-->
40
- <!--<show_in_website>1</show_in_website>-->
41
- <!--<show_in_store>1</show_in_store>-->
42
  <!--</application_key>-->
43
  <clear translate="label">
44
- <label>Clear All Settings</label>
45
  <frontend_type>button</frontend_type>
46
  <frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_button</frontend_model>
47
  <sort_order>30</sort_order>
@@ -59,90 +59,90 @@
59
  <show_in_store>1</show_in_store>
60
  </store>
61
  <!--<backup translate="label">-->
62
- <!--<label>Backup Product Data</label>-->
63
- <!--<frontend_type>button</frontend_type>-->
64
- <!--<frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_backupbutton</frontend_model>-->
65
- <!--<sort_order>40</sort_order>-->
66
- <!--<show_in_default>1</show_in_default>-->
67
- <!--<show_in_website>1</show_in_website>-->
68
- <!--<show_in_store>1</show_in_store>-->
69
  <!--</backup>-->
70
  <!--<restore translate="label">-->
71
- <!--<label>Backup Product Data</label>-->
72
- <!--<frontend_type>button</frontend_type>-->
73
- <!--<frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_restorebutton</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
  <!--</restore>-->
79
  </fields>
80
  </general>
81
  <!--<api_url translate="label">-->
82
- <!--<label>Api Url</label>-->
83
- <!--<frontend_type>text</frontend_type>-->
84
- <!--<sort_order>100</sort_order>-->
85
- <!--<show_in_default>1</show_in_default>-->
86
- <!--<show_in_website>1</show_in_website>-->
87
- <!--<show_in_store>1</show_in_store>-->
88
- <!--<fields>-->
89
- <!--<register translate="label comment" >-->
90
- <!--<label>Register</label>-->
91
- <!--<frontend_type>text</frontend_type>-->
92
- <!--<sort_order>10</sort_order>-->
93
- <!--<show_in_default>1</show_in_default>-->
94
- <!--<show_in_website>1</show_in_website>-->
95
- <!--<show_in_store>1</show_in_store>-->
96
- <!--</register>-->
97
- <!--<languages translate="label comment" >-->
98
- <!--<label>Languages</label>-->
99
- <!--<frontend_type>text</frontend_type>-->
100
- <!--<sort_order>30</sort_order>-->
101
- <!--<show_in_default>1</show_in_default>-->
102
- <!--<show_in_website>1</show_in_website>-->
103
- <!--<show_in_store>1</show_in_store>-->
104
- <!--</languages>-->
105
- <!--<translate translate="label comment" >-->
106
- <!--<label>Translate</label>-->
107
- <!--<frontend_type>text</frontend_type>-->
108
- <!--<sort_order>40</sort_order>-->
109
- <!--<show_in_default>1</show_in_default>-->
110
- <!--<show_in_website>1</show_in_website>-->
111
- <!--<show_in_store>1</show_in_store>-->
112
- <!--</translate>-->
113
- <!--<countries translate="label comment" >-->
114
- <!--<label>Countries</label>-->
115
- <!--<frontend_type>text</frontend_type>-->
116
- <!--<sort_order>20</sort_order>-->
117
- <!--<show_in_default>1</show_in_default>-->
118
- <!--<show_in_website>1</show_in_website>-->
119
- <!--<show_in_store>1</show_in_store>-->
120
- <!--</countries>-->
121
- <!--<quote translate="label comment" >-->
122
- <!--<label>Quote</label>-->
123
- <!--<frontend_type>text</frontend_type>-->
124
- <!--<sort_order>20</sort_order>-->
125
- <!--<show_in_default>1</show_in_default>-->
126
- <!--<show_in_website>1</show_in_website>-->
127
- <!--<show_in_store>1</show_in_store>-->
128
- <!--</quote>-->
129
- <!--<payment translate="label comment" >-->
130
- <!--<label>Payment</label>-->
131
- <!--<frontend_type>text</frontend_type>-->
132
- <!--<sort_order>50</sort_order>-->
133
- <!--<show_in_default>1</show_in_default>-->
134
- <!--<show_in_website>1</show_in_website>-->
135
- <!--<show_in_store>1</show_in_store>-->
136
- <!--</payment>-->
137
- <!--<payment_page translate="label comment" >-->
138
- <!--<label>Payment Page</label>-->
139
- <!--<frontend_type>text</frontend_type>-->
140
- <!--<sort_order>50</sort_order>-->
141
- <!--<show_in_default>1</show_in_default>-->
142
- <!--<show_in_website>1</show_in_website>-->
143
- <!--<show_in_store>1</show_in_store>-->
144
- <!--</payment_page>-->
145
- <!--</fields>-->
146
  <!--</api_url>-->
147
  </groups>
148
  </straker>
8
  </tabs>
9
  <sections>
10
  <straker>
11
+ <label>Straker Translation Extension</label>
12
  <tab>straker</tab>
13
  <frontend_type>text</frontend_type>
14
  <sort_order>20</sort_order>
33
  <show_in_store>1</show_in_store>
34
  </access_token>
35
  <!--<application_key translate="label comment" >-->
36
+ <!--<label>Application Key</label>-->
37
+ <!--<frontend_type>text</frontend_type>-->
38
+ <!--<sort_order>20</sort_order>-->
39
+ <!--<show_in_default>1</show_in_default>-->
40
+ <!--<show_in_website>1</show_in_website>-->
41
+ <!--<show_in_store>1</show_in_store>-->
42
  <!--</application_key>-->
43
  <clear translate="label">
44
+ <label>Clear All Language Settings</label>
45
  <frontend_type>button</frontend_type>
46
  <frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_button</frontend_model>
47
  <sort_order>30</sort_order>
59
  <show_in_store>1</show_in_store>
60
  </store>
61
  <!--<backup translate="label">-->
62
+ <!--<label>Backup Product Data</label>-->
63
+ <!--<frontend_type>button</frontend_type>-->
64
+ <!--<frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_backupbutton</frontend_model>-->
65
+ <!--<sort_order>40</sort_order>-->
66
+ <!--<show_in_default>1</show_in_default>-->
67
+ <!--<show_in_website>1</show_in_website>-->
68
+ <!--<show_in_store>1</show_in_store>-->
69
  <!--</backup>-->
70
  <!--<restore translate="label">-->
71
+ <!--<label>Backup Product Data</label>-->
72
+ <!--<frontend_type>button</frontend_type>-->
73
+ <!--<frontend_model>strakertranslations_easytranslationplatform/adminhtml_system_config_form_restorebutton</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
  <!--</restore>-->
79
  </fields>
80
  </general>
81
  <!--<api_url translate="label">-->
82
+ <!--<label>Api Url</label>-->
83
+ <!--<frontend_type>text</frontend_type>-->
84
+ <!--<sort_order>100</sort_order>-->
85
+ <!--<show_in_default>1</show_in_default>-->
86
+ <!--<show_in_website>1</show_in_website>-->
87
+ <!--<show_in_store>1</show_in_store>-->
88
+ <!--<fields>-->
89
+ <!--<register translate="label comment" >-->
90
+ <!--<label>Register</label>-->
91
+ <!--<frontend_type>text</frontend_type>-->
92
+ <!--<sort_order>10</sort_order>-->
93
+ <!--<show_in_default>1</show_in_default>-->
94
+ <!--<show_in_website>1</show_in_website>-->
95
+ <!--<show_in_store>1</show_in_store>-->
96
+ <!--</register>-->
97
+ <!--<languages translate="label comment" >-->
98
+ <!--<label>Languages</label>-->
99
+ <!--<frontend_type>text</frontend_type>-->
100
+ <!--<sort_order>30</sort_order>-->
101
+ <!--<show_in_default>1</show_in_default>-->
102
+ <!--<show_in_website>1</show_in_website>-->
103
+ <!--<show_in_store>1</show_in_store>-->
104
+ <!--</languages>-->
105
+ <!--<translate translate="label comment" >-->
106
+ <!--<label>Translate</label>-->
107
+ <!--<frontend_type>text</frontend_type>-->
108
+ <!--<sort_order>40</sort_order>-->
109
+ <!--<show_in_default>1</show_in_default>-->
110
+ <!--<show_in_website>1</show_in_website>-->
111
+ <!--<show_in_store>1</show_in_store>-->
112
+ <!--</translate>-->
113
+ <!--<countries translate="label comment" >-->
114
+ <!--<label>Countries</label>-->
115
+ <!--<frontend_type>text</frontend_type>-->
116
+ <!--<sort_order>20</sort_order>-->
117
+ <!--<show_in_default>1</show_in_default>-->
118
+ <!--<show_in_website>1</show_in_website>-->
119
+ <!--<show_in_store>1</show_in_store>-->
120
+ <!--</countries>-->
121
+ <!--<quote translate="label comment" >-->
122
+ <!--<label>Quote</label>-->
123
+ <!--<frontend_type>text</frontend_type>-->
124
+ <!--<sort_order>20</sort_order>-->
125
+ <!--<show_in_default>1</show_in_default>-->
126
+ <!--<show_in_website>1</show_in_website>-->
127
+ <!--<show_in_store>1</show_in_store>-->
128
+ <!--</quote>-->
129
+ <!--<payment translate="label comment" >-->
130
+ <!--<label>Payment</label>-->
131
+ <!--<frontend_type>text</frontend_type>-->
132
+ <!--<sort_order>50</sort_order>-->
133
+ <!--<show_in_default>1</show_in_default>-->
134
+ <!--<show_in_website>1</show_in_website>-->
135
+ <!--<show_in_store>1</show_in_store>-->
136
+ <!--</payment>-->
137
+ <!--<payment_page translate="label comment" >-->
138
+ <!--<label>Payment Page</label>-->
139
+ <!--<frontend_type>text</frontend_type>-->
140
+ <!--<sort_order>50</sort_order>-->
141
+ <!--<show_in_default>1</show_in_default>-->
142
+ <!--<show_in_website>1</show_in_website>-->
143
+ <!--<show_in_store>1</show_in_store>-->
144
+ <!--</payment_page>-->
145
+ <!--</fields>-->
146
  <!--</api_url>-->
147
  </groups>
148
  </straker>
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-install-1.0.0.php CHANGED
@@ -11,7 +11,7 @@ $installer = $this;
11
  $installer->startSetup();
12
 
13
  try {
14
- $installer->run(" CREATE TABLE `straker_actionlog` (
15
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
16
  `user_id` int(10) NOT NULL,
17
  `action` varchar(255) DEFAULT NULL,
@@ -23,7 +23,7 @@ try {
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 `straker_apilog` (
27
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
28
  `method` varchar(255) NOT NULL DEFAULT '',
29
  `request` text,
@@ -32,7 +32,7 @@ CREATE TABLE `straker_apilog` (
32
  PRIMARY KEY (`id`)
33
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
34
 
35
- CREATE TABLE `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,
@@ -62,7 +62,7 @@ CREATE TABLE `straker_job` (
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 `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,
@@ -73,30 +73,30 @@ CREATE TABLE `straker_job_product` (
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 `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
- INSERT 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 `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
- INSERT INTO `straker_job_type` (`type_id`, `type_name`)
96
  VALUES
97
  (1,'Product');
98
 
99
- CREATE TABLE `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,
@@ -107,7 +107,7 @@ CREATE TABLE `straker_product_attributes` (
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 `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,
@@ -124,12 +124,10 @@ CREATE TABLE `straker_product_translate` (
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
- ");
128
- $installer->run("
129
- INSERT INTO `straker_job_type` (`type_id`, `type_name`)
130
- VALUES (2,'Category');
131
 
132
- CREATE TABLE `straker_job_category` (
133
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
134
  `category_id` int(10) unsigned NOT NULL,
135
  `job_id` int(11) unsigned NOT NULL,
@@ -141,7 +139,7 @@ CREATE TABLE `straker_job_category` (
141
  CONSTRAINT `straker_job_category_ibfk_2` FOREIGN KEY (`job_id`) REFERENCES `straker_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
142
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
143
 
144
- CREATE TABLE `straker_category_attributes` (
145
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
146
  `job_id` int(10) unsigned NOT NULL,
147
  `attribute_id` smallint(5) unsigned NOT NULL,
@@ -152,7 +150,7 @@ CREATE TABLE `straker_category_attributes` (
152
  CONSTRAINT `straker_category_attributes_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
153
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
154
 
155
- CREATE TABLE `straker_category_translate` (
156
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
157
  `job_id` int(11) unsigned NOT NULL,
158
  `category_id` int(10) unsigned NOT NULL,
@@ -169,15 +167,11 @@ CREATE TABLE `straker_category_translate` (
169
  CONSTRAINT `straker_category_translate_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
170
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
171
 
172
- ");
173
- $installer->run("
174
-
175
- INSERT INTO `straker_job_status` (`status_id`, `status_name`)
176
  VALUES
177
  (5, 'PUBLISHED');
 
178
 
179
-
180
- ");
181
  } catch (Exception $e) {
182
  Mage::logException($e);
183
  }
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,
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,
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,
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,
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,
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,
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,
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,
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,
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
  }
app/code/community/StrakerTranslations/EasyTranslationPlatform/sql/strakertranslations_easytranslationplatform_setup/mysql4-upgrade-1.0.0-1.1.0.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/design/adminhtml/default/straker/layout/straker.xml CHANGED
@@ -61,4 +61,15 @@
61
  <block type="strakertranslations_easytranslationplatform/adminhtml_job_category" name="strakertranslations_easytranslationplatform_job_category" />
62
  </reference>
63
  </adminhtml_straker_category_index>
 
 
 
 
 
 
 
 
 
 
 
64
  </layout>
61
  <block type="strakertranslations_easytranslationplatform/adminhtml_job_category" name="strakertranslations_easytranslationplatform_job_category" />
62
  </reference>
63
  </adminhtml_straker_category_index>
64
+ <adminhtml_straker_attribute_index>
65
+ <referense name="head">
66
+ <action method="setTitle" translate="title"><title>Manage Jobs</title></action>
67
+ </referense>
68
+ <reference name="menu">
69
+ <action method="setActive"><menupath>straker/job</menupath></action>
70
+ </reference>
71
+ <reference name="content">
72
+ <block type="strakertranslations_easytranslationplatform/adminhtml_job_attribute" name="strakertranslations_easytranslationplatform_job_attribute" />
73
+ </reference>
74
+ </adminhtml_straker_attribute_index>
75
  </layout>
app/design/adminhtml/default/straker/template/straker/job/attribute.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="content-header">
2
+ <table cellspacing="0">
3
+ <tr>
4
+ <td style="width:80%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Manage Jobs') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getJob()->getStoreId()) ?></h3></td>
5
+ <td class="a-right">
6
+ <?php echo $this->getButtonsHtml() ?>
7
+ </td>
8
+ </tr>
9
+ </table>
10
+ </div>
11
+ <div class="container">
12
+ <input type="button" class="form-button left" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_job'); ?>'">
13
+ </div>
14
+ <div>
15
+ <?php echo $this->getGridHtml() ?>
16
+ </div>
17
+ <div id="dispute-container" style="display: none">
18
+ <a id="dispute-container-close">X</a>
19
+ <form id="straker-dispute-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_job/dispute") ?>" method="post">
20
+ <h4 id="dispute-form-title"><?php echo $this->__('If you have any issues, please provide comments below. You must provide specific examples of the source and translation. You can edit translations after you published them to your site.') ?></h4>
21
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
22
+ <input type="hidden" name="job_id">
23
+ <div class="input-box"><label for="message">Message</label><em class="required">*</em><br />
24
+ <textarea id="message" name="message" value="" class="required-entry input-text" rows="16" cols="90"></textarea></div>
25
+ <div class="form-buttons">
26
+ <input type="submit" onclick="disputeForm.submit()" class="form-button" value="Submit" title="Submit">
27
+ </div>
28
+ </form>
29
+ <script>
30
+ var disputeForm = new varienForm('straker-dispute-form');
31
+ disputeForm.show = function(jobId){
32
+ $$('#straker-dispute-form input[name=\'job_id\']')[0].value = jobId;
33
+ $('dispute-container').show();
34
+ };
35
+ $('dispute-container-close').observe('click', function(){
36
+ $('dispute-container').hide();
37
+ });
38
+ </script>
39
+ </div>
app/design/adminhtml/default/straker/template/straker/job/attribute/massaction.phtml ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@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 design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="<?php echo $this->getHtmlId() ?>">
28
+ <table cellspacing="0" cellpadding="0" class="massaction">
29
+ <tr>
30
+ <td><?php if ($this->getUseSelectAll()):?>
31
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectAll()"><?php echo $this->__('Select All') ?></a>
32
+ <span class="separator">|</span>
33
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectAll()"><?php echo $this->__('Unselect All') ?></a>
34
+ <span class="separator">|</span>
35
+ <?php endif; ?>
36
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectVisible()"><?php echo $this->__('Select Visible') ?></a>
37
+ <span class="separator">|</span>
38
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectVisible()"><?php echo $this->__('Unselect Visible') ?></a>
39
+ <span class="separator">|</span>
40
+ <strong id="<?php echo $this->getHtmlId() ?>-count">0</strong> <?php echo $this->__('items selected') ?>
41
+ </td>
42
+ <td>
43
+ <div class="right">
44
+ <div class="entry-edit">
45
+ <?php if ($this->getHideFormElement() !== true):?>
46
+ <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post">
47
+ <?php endif ?>
48
+ <?php echo $this->getBlockHtml('formkey')?>
49
+ <?php echo $this->getHiddenParams() ?>
50
+ <fieldset>
51
+ <span class="field-row">
52
+ <label><?php echo $this->__('Actions') ?></label>
53
+ <select id="<?php echo $this->getHtmlId() ?>-select" class="required-entry select absolute-advice local-validation">
54
+ <option value=""></option>
55
+ <?php foreach($this->getItems() as $_item): ?>
56
+ <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option>
57
+ <?php endforeach; ?>
58
+ </select>
59
+ </span>
60
+ <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span>
61
+ <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span>
62
+ <span class="field-row">
63
+ <?php echo $this->getApplyButtonHtml() ?>
64
+ </span>
65
+ </fieldset>
66
+ <?php if ($this->getHideFormElement() !== true):?>
67
+ </form>
68
+ <?php endif ?>
69
+ </div>
70
+
71
+ <div class="no-display">
72
+ <?php foreach($this->getItems() as $_item): ?>
73
+ <div id="<?php echo $this->getHtmlId() ?>-item-<?php echo $_item->getId() ?>-block">
74
+ <?php echo $_item->getAdditionalActionBlockHtml() ?>
75
+ </div>
76
+ <?php endforeach; ?>
77
+ </div>
78
+ </div>
79
+ </td>
80
+ </tr>
81
+ </table>
82
+ <?php if(!$this->getParentBlock()->canDisplayContainer()): ?>
83
+ <script type="text/javascript">
84
+ <?php echo $this->getJsObjectName() ?>.setGridIds('<?php echo $this->getGridIdsJson() ?>');
85
+ </script>
86
+ <?php endif; ?>
87
+ </div>
app/design/adminhtml/default/straker/template/straker/job/category.phtml CHANGED
@@ -1,13 +1,16 @@
1
  <div class="content-header">
2
  <table cellspacing="0">
3
  <tr>
4
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Manage Jobs') ?></h3></td>
5
  <td class="a-right">
6
  <?php echo $this->getButtonsHtml() ?>
7
  </td>
8
  </tr>
9
  </table>
10
  </div>
 
 
 
11
  <div>
12
  <?php echo $this->getGridHtml() ?>
13
  </div>
1
  <div class="content-header">
2
  <table cellspacing="0">
3
  <tr>
4
+ <td style="width:80%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Manage Jobs') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getJob()->getStoreId()) ?></h3></td>
5
  <td class="a-right">
6
  <?php echo $this->getButtonsHtml() ?>
7
  </td>
8
  </tr>
9
  </table>
10
  </div>
11
+ <div class="container">
12
+ <input type="button" class="form-button left" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_job'); ?>'">
13
+ </div>
14
  <div>
15
  <?php echo $this->getGridHtml() ?>
16
  </div>
app/design/adminhtml/default/straker/template/straker/job/product.phtml CHANGED
@@ -1,13 +1,16 @@
1
  <div class="content-header">
2
  <table cellspacing="0">
3
  <tr>
4
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Manage Jobs') ?></h3></td>
5
  <td class="a-right">
6
  <?php echo $this->getButtonsHtml() ?>
7
  </td>
8
  </tr>
9
  </table>
10
  </div>
 
 
 
11
  <div>
12
  <?php echo $this->getGridHtml() ?>
13
  </div>
1
  <div class="content-header">
2
  <table cellspacing="0">
3
  <tr>
4
+ <td style="width:80%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Manage Jobs') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getJob()->getStoreId()) ?></h3></td>
5
  <td class="a-right">
6
  <?php echo $this->getButtonsHtml() ?>
7
  </td>
8
  </tr>
9
  </table>
10
  </div>
11
+ <div class="container">
12
+ <input type="button" class="form-button left" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_job'); ?>'">
13
+ </div>
14
  <div>
15
  <?php echo $this->getGridHtml() ?>
16
  </div>
app/design/adminhtml/default/straker/template/straker/new/attribute.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products
4
+ */
5
+ ?>
6
+ <div class="content-header">
7
+ <table cellspacing="0">
8
+ <tr>
9
+ <td style="width:80%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Select Attributes to Translate') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3></td>
10
+ <td class="a-right">
11
+ <?php echo $this->getButtonsHtml() ?>
12
+ </td>
13
+ </tr>
14
+ </table>
15
+ </div>
16
+ <ol class="wizard" data-wizard-steps="4">
17
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
18
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
19
+ <li class="wizard-todo"><?php echo $this->__('Select Content') ?></li>
20
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
21
+ </ol>
22
+ <div>
23
+ <?php echo $this->getGridHtml() ?>
24
+ </div>
25
+ <script>
26
+ Event.observe(window, "load", function() {
27
+ var buttonHtml = '<button title="Submit" type="button" class="right" onclick="attributeGrid_massactionJsObject.apply()" style=""><span><span><span>Submit</span></span></span></button>';
28
+ $('attributeGrid').insert({after: buttonHtml});
29
+ $$('.content-header-floating .content-header td.a-right')[0].insert(buttonHtml);
30
+ });
31
+ </script>
app/design/adminhtml/default/straker/template/straker/new/attribute/confirm.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_New_Products
4
+ */
5
+ ?>
6
+ <div class="content-header">
7
+ <table cellspacing="0">
8
+ <tr>
9
+ <td style="width:80%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Attributes to Translate') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3></td>
10
+ <td class="a-right">
11
+ <?php echo $this->getButtonsHtml() ?>
12
+ </td>
13
+ </tr>
14
+ </table>
15
+ </div>
16
+ <ol class="wizard" data-wizard-steps="4">
17
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
18
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
19
+ <li class="wizard-done"><?php echo $this->__('Select Content') ?></li>
20
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
21
+ </ol>
22
+ <?php $params = $this->getRequest()->getParams(); ?>
23
+ <a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_attribute/new", array(
24
+ 'store'=>$params['store'],
25
+ 'internal_attribute'=>implode(',', $this->getAttribute()),
26
+ 'internal_option'=>$this->getOption()
27
+ ) ) ?>"><?php echo $this->__('Edit Attributes') ?></a>
28
+ <form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_attribute/submitjob") ?>" method="post">
29
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
30
+ <input type="hidden" name="attribute" value="<?php echo implode(',', $this->getAttribute()) ?>" >
31
+ <input type="hidden" name="option" value="<?php echo $this->getOption() ?>" >
32
+ <input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
33
+ </form>
34
+ <div>
35
+ <?php echo $this->getGridHtml() ?>
36
+ </div>
37
+ <script>
38
+ Event.observe(window, "load", function() {
39
+ var buttonHtml = '<button title="Submit" type="button" class="right" onclick="$(\'submit-new-job-form\').submit();" style=""><span><span><span>Submit</span></span></span></button>';
40
+ $('strakerAttribute').insert({after: buttonHtml});
41
+ });
42
+ </script>
app/design/adminhtml/default/straker/template/straker/new/attribute/massaction.phtml ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@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 design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="<?php echo $this->getHtmlId() ?>">
28
+ <table cellspacing="0" cellpadding="0" class="massaction">
29
+ <tr>
30
+ <td>
31
+ <div id="massaction-attribute-label-wrapper">
32
+ <?php if ($this->getUseSelectAll()):?>
33
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectAll()"><?php echo $this->__('Select All') ?></a>
34
+ <span class="separator">|</span>
35
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectAll()"><?php echo $this->__('Unselect All') ?></a>
36
+ <span class="separator">|</span>
37
+ <?php endif; ?>
38
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.selectVisible()"><?php echo $this->__('Select Visible') ?></a>
39
+ <span class="separator">|</span>
40
+ <a href="#" onclick="return <?php echo $this->getJsObjectName() ?>.unselectVisible()"><?php echo $this->__('Unselect Visible') ?></a>
41
+ <span class="separator">|</span><br />
42
+ <strong id="<?php echo $this->getHtmlId() ?>-count">0</strong> <?php echo $this->__('items selected') ?>
43
+ </div>
44
+ <div id="massaction-attribute-option-wrapper">
45
+ <?php if ($this->getUseSelectAll()):?>
46
+ <a href="#" onclick="selectAllMassActionOptions()"><?php echo $this->__('Select All') ?></a>
47
+ <span class="separator">|</span>
48
+ <a href="#" onclick="unselectAllMassActionOptions()"><?php echo $this->__('Unselect All') ?></a>
49
+ <span class="separator">|</span>
50
+ <?php endif; ?>
51
+ <a href="#" onclick="selectVisibleMassActionOptions()"><?php echo $this->__('Select Visible') ?></a>
52
+ <span class="separator">|</span>
53
+ <a href="#" onclick="unselectVisibleMassActionOptions()"><?php echo $this->__('Unselect Visible') ?></a>
54
+ <span class="separator">|</span><br />
55
+ <strong id="mass-action-options-count">0</strong> <?php echo $this->__('items selected') ?>
56
+ </div>
57
+ </td>
58
+ <td>
59
+ <div class="right">
60
+ <div class="entry-edit">
61
+ <?php if ($this->getHideFormElement() !== true):?>
62
+ <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post">
63
+ <?php endif ?>
64
+ <?php echo $this->getBlockHtml('formkey')?>
65
+ <?php echo $this->getHiddenParams() ?>
66
+ <fieldset>
67
+ <span class="field-row">
68
+ <label><?php echo $this->__('Actions') ?></label>
69
+ <select id="<?php echo $this->getHtmlId() ?>-select" class="required-entry select absolute-advice local-validation">
70
+ <option value=""></option>
71
+ <?php foreach($this->getItems() as $_item): ?>
72
+ <option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option>
73
+ <?php endforeach; ?>
74
+ </select>
75
+ </span>
76
+ <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span>
77
+ <span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span>
78
+ <span class="field-row">
79
+ <?php echo $this->getApplyButtonHtml() ?>
80
+ </span>
81
+ </fieldset>
82
+ <?php if ($this->getHideFormElement() !== true):?>
83
+ </form>
84
+ <?php endif ?>
85
+ </div>
86
+
87
+ <div class="no-display">
88
+ <?php foreach($this->getItems() as $_item): ?>
89
+ <div id="<?php echo $this->getHtmlId() ?>-item-<?php echo $_item->getId() ?>-block">
90
+ <?php echo $_item->getAdditionalActionBlockHtml() ?>
91
+ </div>
92
+ <?php endforeach; ?>
93
+ </div>
94
+ </div>
95
+ </td>
96
+ </tr>
97
+ </table>
98
+ <?php if(!$this->getParentBlock()->canDisplayContainer()): ?>
99
+ <script type="text/javascript">
100
+ <?php echo $this->getJsObjectName() ?>.setGridIds('<?php echo $this->getGridIdsJson() ?>');
101
+ </script>
102
+ <?php endif; ?>
103
+ <script>
104
+ <?php //JS to control attribute option checkboxes ?>
105
+ var allAttributesWithOptions = <?php echo json_encode( $this->getParentBlock()->getAttributesWithOption() ) ?>;
106
+ selectAllMassActionOptions = function(){
107
+ $$('.checkbox-option').each(function(checkbox) {
108
+ if(allAttributesWithOptions.indexOf(checkbox.value) !== -1){
109
+ checkbox.checked = 1
110
+ }
111
+ });
112
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = allAttributesWithOptions;
113
+ $('mass-action-options-count').update(allAttributesWithOptions.length);
114
+ };
115
+ unselectAllMassActionOptions = function(){
116
+ $$('.checkbox-option').each(function(checkbox) {
117
+ if(allAttributesWithOptions.indexOf(checkbox.value) !== -1){
118
+ checkbox.checked = 0;
119
+ }
120
+ });
121
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = '';
122
+ $('mass-action-options-count').update(0);
123
+ };
124
+ selectVisibleMassActionOptions = function(){
125
+
126
+ var optionArray = $$('#attributeGrid_massaction-form input[name=option]')[0].value === '' ? [] : $$('#attributeGrid_massaction-form input[name=option]')[0].value.split(',');
127
+
128
+ $$('.checkbox-option').each(function(checkbox) {
129
+ if(optionArray.indexOf(checkbox.value) === -1){
130
+ optionArray.push(checkbox.value);
131
+ checkbox.checked = 1;
132
+ }
133
+ });
134
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = optionArray;
135
+ $('mass-action-options-count').update(optionArray.length);
136
+ };
137
+ unselectVisibleMassActionOptions = function(){
138
+ var optionArray = $$('#attributeGrid_massaction-form input[name=option]')[0].value.split(',');
139
+
140
+ $$('.checkbox-option').each(function(checkbox) {
141
+ if(optionArray.indexOf(checkbox.value) !== -1){
142
+ optionArray.splice(optionArray.indexOf(checkbox.value), 1);
143
+ checkbox.checked = 0;
144
+ }
145
+ });
146
+ if (optionArray == ""){
147
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = '';
148
+ $('mass-action-options-count').update(0);
149
+ }
150
+ else {
151
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = optionArray;
152
+ $('mass-action-options-count').update(optionArray.length);
153
+ }
154
+ };
155
+
156
+ document.observe("dom:loaded", function() {
157
+ $$('#attributeGrid_table tr.filter th:nth(1)')[0].update($('massaction-attribute-label-wrapper'));
158
+ $$('#attributeGrid_table tr.filter th:nth(3)')[0].update($('massaction-attribute-option-wrapper'));
159
+ $$('.checkbox-option').each(function(element) {
160
+ element.observe('click', function(e){
161
+ var optionArray = $$('#attributeGrid_massaction-form input[name=option]')[0].value === '' ? [] : $$('#attributeGrid_massaction-form input[name=option]')[0].value.split(',');
162
+
163
+ if(this.checked && optionArray.indexOf(this.value) === -1){
164
+ optionArray.push(this.value);
165
+ this.checked = 1;
166
+ }
167
+ else if(!this.checked && optionArray.indexOf(this.value) !== -1){
168
+ optionArray.splice(optionArray.indexOf(this.value), 1);
169
+ this.checked = 0;
170
+ }
171
+ if (optionArray == ""){
172
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = '';
173
+ $('mass-action-options-count').update(0);
174
+
175
+ }
176
+ else {
177
+ $$('#attributeGrid_massaction-form input[name=option]')[0].value = optionArray;
178
+ $('mass-action-options-count').update(optionArray.length);
179
+ }
180
+ });
181
+ });
182
+
183
+
184
+ var initOptionArray = $$('#attributeGrid_massaction-form input[name=option]')[0].value === '' ? [] : $$('#attributeGrid_massaction-form input[name=option]')[0].value.split(',');
185
+ $$('.checkbox-option').each(function(checkbox) {
186
+ if(initOptionArray.indexOf(checkbox.value) !== -1){
187
+ checkbox.checked = 1;
188
+ }
189
+ else{
190
+ checkbox.checked = 0;
191
+ }
192
+ });
193
+ $('mass-action-options-count').update(initOptionArray.length);
194
+
195
+ $$('.massaction-checkbox').each(function(element) {
196
+ element.observe('click', function(e){
197
+ if( typeof(e.target.up('tr').down('.checkbox-option')) !== 'undefined' && !e.target.up('tr').down('.checkbox-option').checked){
198
+ e.target.up('tr').down('.checkbox-option').click();
199
+ }
200
+ });
201
+ });
202
+
203
+ $$('.checkbox-option').each(function(element) {
204
+ element.observe('click', function(e){
205
+ if(!e.target.up('tr').down('.massaction-checkbox').checked){
206
+ e.target.up('tr').down('.massaction-checkbox').click();
207
+ }
208
+ });
209
+ });
210
+
211
+ });
212
+
213
+ varienGrid.prototype.rowMouseClick = function(){
214
+ if(event.element().matches('input[type=checkbox]') && this.rowClickCallback){
215
+ try{
216
+ this.rowClickCallback(this, event);
217
+ }
218
+ catch(e){}
219
+ }
220
+ varienGlobalEvents.fireEvent('gridRowClick', event);
221
+ };
222
+ varienGrid.prototype.setPage = function(pageNumber){
223
+ this.addVarToUrl('internal_option', $$('#attributeGrid_massaction-form input[name=option]')[0].value)
224
+ this.reload(this.addVarToUrl(this.pageVar, pageNumber));
225
+ };
226
+
227
+ varienGrid.prototype.addVarToUrl = function(varName, varValue){
228
+ this.url = this._addVarToUrl(this.url, varName, varValue);
229
+ return this.url;
230
+ }
231
+
232
+ varienGridMassaction.prototype.apply = function() {
233
+ if(varienStringArray.count(this.checkedString) == 0 && varienStringArray.count($$('#attributeGrid_massaction-form input[name=option]')[0].value) == 0) {
234
+ alert(this.errorText);
235
+ return;
236
+ }
237
+
238
+ var item = this.getSelectedItem();
239
+ if(!item) {
240
+ this.validator.validate();
241
+ return;
242
+ }
243
+ this.currentItem = item;
244
+ var fieldName = (item.field ? item.field : this.formFieldName);
245
+ var fieldsHtml = '';
246
+
247
+ if(this.currentItem.confirm && !window.confirm(this.currentItem.confirm)) {
248
+ return;
249
+ }
250
+
251
+ this.formHiddens.update('');
252
+ new Insertion.Bottom(this.formHiddens, this.fieldTemplate.evaluate({name: fieldName, value: this.checkedString}));
253
+ new Insertion.Bottom(this.formHiddens, this.fieldTemplate.evaluate({name: 'massaction_prepare_key', value: fieldName}));
254
+
255
+ if(!this.validator.validate()) {
256
+ return;
257
+ }
258
+
259
+ if(this.useAjax && item.url) {
260
+ new Ajax.Request(item.url, {
261
+ 'method': 'post',
262
+ 'parameters': this.form.serialize(true),
263
+ 'onComplete': this.onMassactionComplete.bind(this)
264
+ });
265
+ } else if(item.url) {
266
+ this.form.action = item.url;
267
+ this.form.submit();
268
+ }
269
+ }
270
+ </script>
271
+ </div>
app/design/adminhtml/default/straker/template/straker/new/attributes.phtml DELETED
@@ -1,31 +0,0 @@
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/category/attributes.phtml CHANGED
@@ -1,10 +1,11 @@
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 Category Details</li>
6
- <li class="wizard-todo">Select Categories</li>
7
- <li class="wizard-todo">Confirm Categories</li>
 
8
  </ol>
9
  <div class="straker-main-container border">
10
  <h1><?php echo $this->__('Categories Details') ?></h1>
@@ -29,6 +30,8 @@
29
  <label for="meta_title"><?php echo $this->__('Meta Title') ?></label><br></div>
30
  <div class="clear"></div>
31
  <input type="submit" class="form-button right" value="Next" title="Next">
 
 
32
  </div>
33
  </form>
34
  </div>
1
  <div class="content-header">
2
+ <h3><?php echo $this->__('Create New Job') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3>
3
  </div>
4
+ <ol class="wizard" data-wizard-steps="4">
5
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
6
+ <li class="wizard-todo"><?php echo $this->__('Select Details') ?></li>
7
+ <li class="wizard-todo"><?php echo $this->__('Select Content') ?></li>
8
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
9
  </ol>
10
  <div class="straker-main-container border">
11
  <h1><?php echo $this->__('Categories Details') ?></h1>
30
  <label for="meta_title"><?php echo $this->__('Meta Title') ?></label><br></div>
31
  <div class="clear"></div>
32
  <input type="submit" class="form-button right" value="Next" title="Next">
33
+ <input type="button" class="form-button right" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_new', array('store'=> $this->getSetupStoreId())); ?>'">
34
+
35
  </div>
36
  </form>
37
  </div>
app/design/adminhtml/default/straker/template/straker/new/category/confirm.phtml CHANGED
@@ -6,17 +6,15 @@
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Categories to be translated') ?></h3></td>
10
- <td class="a-right">
11
- <?php echo $this->getButtonsHtml() ?>
12
- </td>
13
  </tr>
14
  </table>
15
  </div>
16
- <ol class="wizard" data-wizard-steps="3">
17
- <li class="wizard-done">Select Category Details</li>
18
- <li class="wizard-done">Select Categories</li>
19
- <li class="wizard-todo">Confirm Categories</li>
 
20
  </ol>
21
  <?php $params = Mage::app()->getRequest()->getParams(); ?>
22
  <a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_category/new", array('store'=>$params['store'], 'attr'=>$params['attr'], 'internal_category'=> implode(',', $this->getCategory()))) ?>"><?php echo $this->__('Edit Categories') ?></a>
@@ -26,6 +24,9 @@
26
  <input type="hidden" name="attr" value="<?php echo $this->getAttr() ?>" >
27
  <input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
28
  </form>
 
 
 
29
  <div>
30
  <?php echo $this->getGridHtml() ?>
31
  </div>
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
+ <td><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Categories to Translate') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3></td>
 
 
 
10
  </tr>
11
  </table>
12
  </div>
13
+ <ol class="wizard" data-wizard-steps="4">
14
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
15
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
16
+ <li class="wizard-done"><?php echo $this->__('Select Content') ?></li>
17
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
18
  </ol>
19
  <?php $params = Mage::app()->getRequest()->getParams(); ?>
20
  <a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_category/new", array('store'=>$params['store'], 'attr'=>$params['attr'], 'internal_category'=> implode(',', $this->getCategory()))) ?>"><?php echo $this->__('Edit Categories') ?></a>
24
  <input type="hidden" name="attr" value="<?php echo $this->getAttr() ?>" >
25
  <input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
26
  </form>
27
+ <div class="right">
28
+ <?php echo $this->getButtonsHtml() ?>
29
+ </div>
30
  <div>
31
  <?php echo $this->getGridHtml() ?>
32
  </div>
app/design/adminhtml/default/straker/template/straker/new/category/tree.phtml CHANGED
@@ -1,14 +1,18 @@
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-done">Select Category Details</li>
6
- <li class="wizard-todo">Select Categories</li>
7
- <li class="wizard-todo">Confirm Categories</li>
 
 
 
 
8
  </ol>
9
  <div class="straker-main-container border">
10
  <h1><?php echo $this->__('Select Categories') ?></h1>
11
- <p><?php echo $this->__('Select categories to be translated') ?></p>
12
  <form method="post" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_category/confirmCategory") ?>" >
13
  <div style="padding:0; margin-bottom: 30px;">
14
  <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
@@ -61,6 +65,9 @@
61
  tree.on('check', function(node) {
62
  if(node.attributes.checked) {
63
  categoryAdd(node.id);
 
 
 
64
  } else {
65
  categoryRemove(node.id);
66
  }
@@ -116,6 +123,11 @@
116
  return;
117
  }
118
  node.getUI().check(!node.getUI().checked());
 
 
 
 
 
119
  varienElementMethods.setHasChanges(Event.element(e), e);
120
  };
121
  function categoryAdd(id) {
1
  <div class="content-header">
2
+ <h3><?php echo $this->__('Create New Job') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3>
3
  </div>
4
+ <div class="container">
5
+ <input type="button" class="form-button left" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_category/new', array('store'=> $this->getSetupStoreId())); ?>'">
6
+ </div>
7
+ <ol class="wizard" data-wizard-steps="4">
8
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
9
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
10
+ <li class="wizard-todo"><?php echo $this->__('Select Content') ?></li>
11
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
12
  </ol>
13
  <div class="straker-main-container border">
14
  <h1><?php echo $this->__('Select Categories') ?></h1>
15
+ <p><?php echo $this->__('Select categories to Translate') ?></p>
16
  <form method="post" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_category/confirmCategory") ?>" >
17
  <div style="padding:0; margin-bottom: 30px;">
18
  <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
65
  tree.on('check', function(node) {
66
  if(node.attributes.checked) {
67
  categoryAdd(node.id);
68
+ node.childNodes.each(function(c){
69
+ c.getUI().check(1);
70
+ });
71
  } else {
72
  categoryRemove(node.id);
73
  }
123
  return;
124
  }
125
  node.getUI().check(!node.getUI().checked());
126
+ if(node.getUI().checked()){
127
+ node.childNodes.each(function(c){
128
+ c.getUI().check(1);
129
+ });
130
+ }
131
  varienElementMethods.setHasChanges(Event.element(e), e);
132
  };
133
  function categoryAdd(id) {
app/design/adminhtml/default/straker/template/straker/new/confirm.phtml CHANGED
@@ -6,17 +6,18 @@
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Products to be translated') ?></h3></td>
10
  <td class="a-right">
11
  <?php echo $this->getButtonsHtml() ?>
12
  </td>
13
  </tr>
14
  </table>
15
  </div>
16
- <ol class="wizard" data-wizard-steps="3">
17
- <li class="wizard-done">Select Product Details</li>
18
- <li class="wizard-done">Select Products</li>
19
- <li class="wizard-todo">Confirm Products</li>
 
20
  </ol>
21
  <form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("straker/adminhtml_new/submitjob") ?>" method="post">
22
  <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Products to Translate') ?></h3></td>
10
  <td class="a-right">
11
  <?php echo $this->getButtonsHtml() ?>
12
  </td>
13
  </tr>
14
  </table>
15
  </div>
16
+ <ol class="wizard" data-wizard-steps="4">
17
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
18
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
19
+ <li class="wizard-done"><?php echo $this->__('Select Content') ?></li>
20
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
21
  </ol>
22
  <form id="submit-new-job-form" action="<?php echo Mage::helper("adminhtml")->getUrl("straker/adminhtml_new/submitjob") ?>" method="post">
23
  <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
app/design/adminhtml/default/straker/template/straker/new/products.phtml CHANGED
@@ -6,17 +6,21 @@
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Select Products to Translate') ?></h3></td>
10
  <td class="a-right">
11
  <?php echo $this->getButtonsHtml() ?>
12
  </td>
13
  </tr>
14
  </table>
15
  </div>
16
- <ol class="wizard" data-wizard-steps="3">
17
- <li class="wizard-done">Select Product Details</li>
18
- <li class="wizard-todo">Select Products</li>
19
- <li class="wizard-todo">Confirm Products</li>
 
 
 
 
20
  </ol>
21
  <div>
22
  <?php echo $this->getGridHtml() ?>
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
+ <td style="width:80%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Select Products to Translate') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3></td>
10
  <td class="a-right">
11
  <?php echo $this->getButtonsHtml() ?>
12
  </td>
13
  </tr>
14
  </table>
15
  </div>
16
+ <div class="container">
17
+ <input type="button" class="form-button left" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_product/new', array('store'=> $this->getSetupStoreId())); ?>'">
18
+ </div>
19
+ <ol class="wizard" data-wizard-steps="4">
20
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
21
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
22
+ <li class="wizard-todo"><?php echo $this->__('Select Content') ?></li>
23
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
24
  </ol>
25
  <div>
26
  <?php echo $this->getGridHtml() ?>
app/design/adminhtml/default/straker/template/straker/new/products/attributes.phtml CHANGED
@@ -1,10 +1,11 @@
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>
@@ -26,6 +27,7 @@
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>
1
  <div class="content-header">
2
+ <h3><?php echo $this->__('Create New Job') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3>
3
  </div>
4
+ <ol class="wizard" data-wizard-steps="4">
5
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
6
+ <li class="wizard-todo"><?php echo $this->__('Select Details') ?></li>
7
+ <li class="wizard-todo"><?php echo $this->__('Select Content') ?></li>
8
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
9
  </ol>
10
  <div class="straker-main-container border">
11
  <h1><?php echo $this->__('Product Details') ?></h1>
27
  <label for="meta_title"><?php echo $this->__('Meta Title') ?></label><br></div>
28
  <div class="clear"></div>
29
  <input type="submit" class="form-button right" value="Next" title="Next">
30
+ <input type="button" class="form-button right" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/straker_new', array('store'=> $this->getSetupStoreId())); ?>'">
31
  </div>
32
  </form>
33
  </div>
app/design/adminhtml/default/straker/template/straker/new/products/confirm.phtml CHANGED
@@ -6,17 +6,15 @@
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
- <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Products to be translated') ?></h3></td>
10
- <td class="a-right">
11
- <?php echo $this->getButtonsHtml() ?>
12
- </td>
13
  </tr>
14
  </table>
15
  </div>
16
- <ol class="wizard" data-wizard-steps="3">
17
- <li class="wizard-done">Select Product Details</li>
18
- <li class="wizard-done">Select Products</li>
19
- <li class="wizard-todo">Confirm Products</li>
 
20
  </ol>
21
  <?php $params = $this->getRequest()->getParams(); ?>
22
  <a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_product/new", array('store'=>$params['store'], 'attr'=>$params['attr'], 'internal_product'=>implode(',', $params['product']))) ?>"><?php echo $this->__('Edit Products') ?></a>
@@ -26,6 +24,9 @@
26
  <input type="hidden" name="attr" value="<?php echo $this->getAttr() ?>" >
27
  <input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
28
  </form>
 
 
 
29
  <div>
30
  <?php echo $this->getGridHtml() ?>
31
  </div>
6
  <div class="content-header">
7
  <table cellspacing="0">
8
  <tr>
9
+ <td><h3 class="icon-head head-products"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->__('Confirm Products to Translate') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3></td>
 
 
 
10
  </tr>
11
  </table>
12
  </div>
13
+ <ol class="wizard" data-wizard-steps="4">
14
+ <li class="wizard-done"><?php echo $this->__('Select Job Type') ?></li>
15
+ <li class="wizard-done"><?php echo $this->__('Select Details') ?></li>
16
+ <li class="wizard-done"><?php echo $this->__('Select Content') ?></li>
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'=>$params['store'], 'attr'=>$params['attr'], 'internal_product'=>implode(',', $params['product']))) ?>"><?php echo $this->__('Edit Products') ?></a>
24
  <input type="hidden" name="attr" value="<?php echo $this->getAttr() ?>" >
25
  <input type="hidden" name="store" value="<?php echo $this->getStore() ?>" >
26
  </form>
27
+ <div class="right">
28
+ <?php echo $this->getButtonsHtml() ?>
29
+ </div>
30
  <div>
31
  <?php echo $this->getGridHtml() ?>
32
  </div>
app/design/adminhtml/default/straker/template/straker/new/register.phtml CHANGED
@@ -6,8 +6,8 @@
6
  <form id="straker-create-account-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_new/register") ?>" method="post">
7
  <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
8
  <div id="register-content" style="padding:0; margin-bottom: 30px;">
9
- <h3><?php echo $this->__('Register new account') ?></h3>
10
- <p><?php echo $this->__('As it is your first time using Easy Translation Platform, you will need to create a new account.') ?></p>
11
  <div class="col-left">
12
  <div class="input-box"><label for="first_name">First Name</label><em class="required">*</em><br>
13
  <input type="text" id="first_name" name="first_name" value="" class="required-entry input-text"></div>
6
  <form id="straker-create-account-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_new/register") ?>" method="post">
7
  <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
8
  <div id="register-content" style="padding:0; margin-bottom: 30px;">
9
+ <h3><?php echo $this->__('Register a New Account') ?></h3>
10
+ <p><?php echo $this->__('As this is your first time using the Straker Translation Extension please register an account with us.') ?></p>
11
  <div class="col-left">
12
  <div class="input-box"><label for="first_name">First Name</label><em class="required">*</em><br>
13
  <input type="text" id="first_name" name="first_name" value="" class="required-entry input-text"></div>
app/design/adminhtml/default/straker/template/straker/new/selectstore.phtml CHANGED
@@ -2,12 +2,12 @@
2
  <h3><?php echo $this->__('Create New Job') ?></h3>
3
  </div>
4
  <div class="straker-main-container">
5
- <h1><?php echo $this->__('Select Destination Store') ?></h1>
6
- <p><?php echo $this->__('Please select the destination store for this translation job.') ?></p>
7
- <form action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_new/selectstore") ?>" >
8
- <div class="destination-container input-box input-left"><label for="store"><?php echo $this->__('Destination Store') ?></label>
9
- <select class="validate-select" name="store" onchange="this.form.submit()">
10
- <option value=""><?php echo $this->__('Pick a store') ?></option>
11
  <?php foreach (Mage::app()->getWebsites() as $website): ?>
12
  <?php $showWebsite = false; ?>
13
  <?php foreach ($website->getGroups() as $group): ?>
@@ -29,6 +29,12 @@
29
  <?php endforeach; ?>
30
  <?php endforeach; ?>
31
  </select>
 
 
 
32
  </div>
33
  </form>
34
  </div>
 
 
 
2
  <h3><?php echo $this->__('Create New Job') ?></h3>
3
  </div>
4
  <div class="straker-main-container">
5
+ <h1><?php echo $this->__('Select your Destination Store View') ?></h1>
6
+ <p><?php echo $this->__('Please select the destination Store View where you would like this translation to show.') ?></p>
7
+ <form id="selectstore-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_new/selectstore") ?>" >
8
+ <div class="destination-container input-box input-left"><label for="store"><?php echo $this->__('Destination Store View') ?></label>
9
+ <select class="validate-select" name="store">
10
+ <option value=""><?php echo $this->__('Pick a store view') ?></option>
11
  <?php foreach (Mage::app()->getWebsites() as $website): ?>
12
  <?php $showWebsite = false; ?>
13
  <?php foreach ($website->getGroups() as $group): ?>
29
  <?php endforeach; ?>
30
  <?php endforeach; ?>
31
  </select>
32
+ <div class="form-buttons">
33
+ <input type="submit" onchange="selectstoreForm.submit()" class="form-button" value="Next" title="Next">
34
+ </div>
35
  </div>
36
  </form>
37
  </div>
38
+ <script>
39
+ var selectstoreForm = new varienForm('selectstore-form');
40
+ </script>
app/design/adminhtml/default/straker/template/straker/new/setupstore.phtml CHANGED
@@ -1,16 +1,20 @@
 
 
 
 
1
  <div class="content-header">
2
- <h3><?php echo $this->__('Create New Job') ?></h3>
3
  </div>
4
  <div class="straker-main-container">
5
- <h1><?php echo $this->__('Select Languages') ?></h1>
6
- <p><?php echo $this->__('Tell us your source and destination store and languages') ?></p>
7
  <form id="setupstore-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_new/setupstore") ?>" >
8
  <div class="store-select-container">
9
  <h2><?php echo $this->__('Source') ?></h2>
10
  <p><?php echo $this->__('Where would you like us to take your content from?') ?></p>
11
- <div class="input-box"><label for="source"><?php echo $this->__('Source Store:') ?></label>
12
  <select name="source" class="validate-select">
13
- <option value=""><?php echo $this->__('Pick a store') ?></option>
14
  <?php foreach (Mage::app()->getWebsites() as $website): ?>
15
  <?php $showWebsite = false; ?>
16
  <?php foreach ($website->getGroups() as $group): ?>
@@ -38,7 +42,7 @@
38
  </div>
39
  <div class="down-arrow"></div>
40
  <div class="store-select-container">
41
- <h2><?php echo $this->__('Destination') ?></h2>
42
  <p><?php echo $this->__('Where would you like us to put the translated content?') ?></p>
43
  <div class="input-box"><label for="destination"><?php echo $this->__('Destination Store:') ?></label>
44
  <select name="destination" disabled class="disabled">
@@ -46,11 +50,12 @@
46
  </select>
47
  <input name="store" type="hidden" value="<?php echo $this->getSetupStoreId() ?>" />
48
  </div>
49
- <div class="input-box"><label for="to"><?php echo $this->__('Destination Language:') ?></label>
50
  <?php echo $this->renderLanguageSelect('to') ?></div>
51
  </div>
52
  <div class="form-buttons">
53
  <input type="submit" class="form-button right" value="Next" title="Next" onclick="setupstoreForm.submit()">
 
54
  </div>
55
  </form>
56
  </div>
1
+ <?php
2
+ $store = Mage::getModel('core/store')->load($this->getSetupStoreId());
3
+ $storeTitleText = $store->getFrontendName().'('.$store->getName().')';
4
+ ?>
5
  <div class="content-header">
6
+ <h3><?php echo $this->__('Create New Job') ?></h3><h3 class="store-info-heading"><?php echo $storeTitleText; ?></h3>
7
  </div>
8
  <div class="straker-main-container">
9
+ <h1><?php echo $this->__('Select your Languages Pairs') ?></h1>
10
+ <p><?php echo $this->__('Select your Source and Destination Store Views and languages for this language pair. This is a one time setup process for each Store View.') ?></p>
11
  <form id="setupstore-form" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/straker_new/setupstore") ?>" >
12
  <div class="store-select-container">
13
  <h2><?php echo $this->__('Source') ?></h2>
14
  <p><?php echo $this->__('Where would you like us to take your content from?') ?></p>
15
+ <div class="input-box"><label for="source"><?php echo $this->__('Source Store View:') ?></label>
16
  <select name="source" class="validate-select">
17
+ <option value=""><?php echo $this->__('Pick a store view') ?></option>
18
  <?php foreach (Mage::app()->getWebsites() as $website): ?>
19
  <?php $showWebsite = false; ?>
20
  <?php foreach ($website->getGroups() as $group): ?>
42
  </div>
43
  <div class="down-arrow"></div>
44
  <div class="store-select-container">
45
+ <h2><?php echo $this->__('Destination Store View') ?></h2>
46
  <p><?php echo $this->__('Where would you like us to put the translated content?') ?></p>
47
  <div class="input-box"><label for="destination"><?php echo $this->__('Destination Store:') ?></label>
48
  <select name="destination" disabled class="disabled">
50
  </select>
51
  <input name="store" type="hidden" value="<?php echo $this->getSetupStoreId() ?>" />
52
  </div>
53
+ <div class="input-box"><label for="to"><?php echo $this->__('Target Language:') ?></label>
54
  <?php echo $this->renderLanguageSelect('to') ?></div>
55
  </div>
56
  <div class="form-buttons">
57
  <input type="submit" class="form-button right" value="Next" title="Next" onclick="setupstoreForm.submit()">
58
+ <input type="button" class="form-button right" value="Back" title="Back" onclick="window.location.href = '<?php echo $this->getUrl('*/*'); ?>'">
59
  </div>
60
  </form>
61
  </div>
app/design/adminhtml/default/straker/template/straker/new/type.phtml CHANGED
@@ -1,6 +1,15 @@
 
 
 
 
 
 
 
 
 
1
  <div class="straker-main-container border">
2
- <h1><?php echo $this->__('Job Type') ?></h1>
3
- <p><?php echo $this->__('What type of job do you want to create?') ?></p>
4
  <div class="job-type-btn-wrap" style="padding:0; margin-bottom: 30px;">
5
  <?php echo $this->renderTypes(); ?>
6
  </div>
1
+ <div class="content-header">
2
+ <h3><?php echo $this->__('Job Type') ?></h3><h3 class="store-info-heading"><?php echo Mage::helper('strakertranslations_easytranslationplatform')->renderNewJobHeading($this->getRequest()->getParam('store')) ?></h3>
3
+ </div>
4
+ <ol class="wizard" data-wizard-steps="4">
5
+ <li class="wizard-todo"><?php echo $this->__('Select Job Type') ?></li>
6
+ <li class="wizard-todo"><?php echo $this->__('Select Details') ?></li>
7
+ <li class="wizard-todo"><?php echo $this->__('Select Content') ?></li>
8
+ <li class="wizard-todo"><?php echo $this->__('Confirm Content') ?></li>
9
+ </ol>
10
  <div class="straker-main-container border">
11
+ <h1><?php echo $this->__('Select Job Type') ?></h1>
12
+ <p><?php echo $this->__('Select the content type you would like to send for translation.') ?></p>
13
  <div class="job-type-btn-wrap" style="padding:0; margin-bottom: 30px;">
14
  <?php echo $this->renderTypes(); ?>
15
  </div>
js/straker/translations.js CHANGED
@@ -1,6 +1,18 @@
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="amasty_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
- });
 
 
 
 
 
 
 
 
 
 
 
 
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);
17
+ });
18
+ });
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>straker-translations-easy-translation-platform</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
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>Initial Stable release</notes>
12
  <authors><author><name>Chris </name><user>Straker_support</user><email>extensions@strakertranslations.com</email></author></authors>
13
- <date>2016-01-11</date>
14
- <time>03:54:01</time>
15
- <contents><target name="magecommunity"><dir name="StrakerTranslations"><dir name="EasyTranslationPlatform"><dir name="Block"><dir name="Adminhtml"><dir name="Job"><dir name="Category"><file name="Grid.php" hash="85c8665aae723ab004dcdce4f38d8eb3"/></dir><file name="Category.php" hash="bdd86f858dd7ca8c77cc1db52361ef64"/><file name="Grid.php" hash="a0047d807b29b3a6762b9f680724ff93"/><dir name="Product"><file name="Grid.php" hash="416e189648ccdb3707c07c252e80bd07"/></dir><file name="Product.php" hash="4efd1f43887a468deda49ec66fd19ff3"/></dir><file name="Job.php" hash="bf5ad4cd596a3a93a54447ee112c0a23"/><dir name="New"><file name="Attribute.php" hash="f7705a1fc16c7844a0cffd3e237dbb7a"/><dir name="Category"><file name="Attribute.php" hash="b6698a36ee449853edff1815fca6a56f"/><dir name="Confirm"><file name="Grid.php" hash="6dae0cfcb1b91e3fdea45a521f263afa"/></dir><file name="Confirm.php" hash="b710371dceb26866857a62f9d19425e7"/><file name="Tree.php" hash="b405b4bf4969812e13d63d752cd89c23"/></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="4aab6c02b883d138205db19c021dba1f"/><dir name="Confirm"><file name="Grid.php" hash="a00382ca90618800d6be0e889521d14a"/></dir><file name="Confirm.php" hash="d4dddb499ff29d646fcd48246666126a"/><file name="Grid.php" hash="b2ce18933176e0c5c41f47b618ceef51"/></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="9552bdb41b0dd5acd20f4e5c5928393a"/></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Backupbutton.php" hash="8bfae419ddceed0553db1f5dc5322356"/><file name="Button.php" hash="9604001bfb931ce0674785937a5766c2"/><file name="Restorebutton.php" hash="e98058e6769f5308fa9f48fa19a22704"/><file name="Store.php" hash="d962cfad8b87dfbe988beda890d5790d"/></dir></dir></dir><dir name="Template"><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="1f8e6a90be07b3eef6ea303fef9d45e4"/><file name="Backend.php" hash="6ca085c9a5c50e635f8f4aa41d3314e1"/><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="Status.php" hash="5a2f7bce9d4a07d342a69d5e7b454ce3"/><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="e4ebcaf86721cfa7b2c699ec844e3460"/></dir><dir name="Model"><file name="Actionlog.php" hash="bd8a61e14712e32937e0622376b07ae7"/><file name="Api.php" hash="28967043b3073fb37fc3cbdc69c3bd99"/><dir name="Category"><file name="Attributes.php" hash="31639770ebe8f2aa4b320d686786f716"/><file name="Translate.php" hash="63888c2d229d1cc860b2d3555470f597"/></dir><dir name="Job"><file name="Category.php" hash="37079e7131a4d10a9577afb499c6d7b6"/><file name="Product.php" hash="9f02ce34f909df6dd26c3414356ad565"/><file name="Status.php" hash="64c766deaf33bd0460c739f04544f8db"/><file name="Type.php" hash="c5010524e83e0c3c56595bcd72bba97d"/></dir><file name="Job.php" hash="93c678827087c5ca0b426645a0e5de7e"/><dir name="Product"><file name="Attributes.php" hash="f8539bb8a73a59017b811bea7d99835b"/><file name="Translate.php" hash="b2d3d28d48dbeebafb9406d5b2920290"/></dir><dir name="Resource"><dir name="Actionlog"><file name="Collection.php" hash="a60fb59aa09d55b5e5d4f41d58e20e6f"/></dir><file name="Actionlog.php" hash="5742408ecac5dce23b3492d118d6ca41"/><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="Job"><dir name="Category"><file name="Collection.php" hash="6e29696c703503c821fb4fbeb04f7169"/></dir><file name="Category.php" hash="5cb332770a4600be8d82d5440a42a2a6"/><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="b0b4460e3ca9dd9493cbc2548b43f052"/><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="CategoryController.php" hash="910a02d1c27af7178584311f57705646"/><file name="JobController.php" hash="8fb3b3bced0b90cad7a1f0518a8de2d9"/><file name="NewController.php" hash="96ae111d8fad3b0b32cdc11c805e5a71"/><file name="ProductController.php" hash="f4742ae9e313f6fcf080a953a3251c75"/></dir></dir><file name="CallbackController.php" hash="c9abd6304f6f071940735a47ab658633"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e4088d77ea6561acd41d15c737f1f1b"/><file name="config.xml" hash="c56aa3ae2bf69d5cb7a393fb8b5a7df5"/><file name="system.xml" hash="f501acec468fce2d1928eddf0142171b"/></dir><dir name="sql"><dir name="strakertranslations_easytranslationplatform_setup"><file name="mysql4-install-1.0.0.php" hash="58049841b021020aefbb3e6acce88b74"/></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="d1faabffeea1fc63a922a22c059ef832"/></dir><dir name="template"><dir name="straker"><dir name="job"><dir name="category"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="category.phtml" hash="b291de6217ced6b7cc9df49f90506fe5"/><dir name="product"><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="product.phtml" hash="b291de6217ced6b7cc9df49f90506fe5"/></dir><file name="job.phtml" hash="63c7a5b66b969635ee9996638878d63c"/><dir name="new"><file name="attributes.phtml" hash="a2b5136923f2afad369185077a3c4c53"/><dir name="category"><file name="attributes.phtml" hash="f8a91a330273d18e168d75d460c920c4"/><file name="confirm.phtml" hash="651d98be32a0fd2f768cbeee1907a843"/><file name="tree.phtml" hash="376c21aa034258af888dc03d8f9f5dd8"/></dir><file name="confirm.phtml" hash="defc2a26d6eb659a312e83c884270c4d"/><dir name="products"><file name="attributes.phtml" hash="6f53969076d404bc0fafe71c3ea0de72"/><file name="confirm.phtml" hash="a46c670c32070216772cc8108ef834d0"/><file name="massaction.phtml" hash="1c3b4ce443f6e4086bcc362d43f75354"/></dir><file name="products.phtml" hash="faf17e8b26f9270758c5cc19d77f4384"/><file name="register.phtml" hash="3fbc5e22e54cfc98000c14cfbd824a75"/><file name="selectstore.phtml" hash="beb08c491221afca55d4c7cf7525d6d4"/><file name="setupstore.phtml" hash="86954fb6c02e62dee9e17e71b074e585"/><file name="type.phtml" hash="65089368178025d6a164cc5c34884950"/></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="17041d76dba1d87442f2e9439d7ff26d"/><file name="straker.less" hash="e3b1f672521faf5f65280ffe03f6221c"/></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="69717bb0023ff1516cefa1ef483789b4"/></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.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
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>Initial Stable release</notes>
12
  <authors><author><name>Chris </name><user>Straker_support</user><email>extensions@strakertranslations.com</email></author></authors>
13
+ <date>2016-03-02</date>
14
+ <time>12:46:12</time>
15
+ <contents><target name="magecommunity"><dir name="StrakerTranslations"><dir name="EasyTranslationPlatform"><dir name="Block"><dir name="Adminhtml"><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"/><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="7914b3ad7b8397623ed6475bb3c6310b"/></dir><file name="Confirm.php" hash="b710371dceb26866857a62f9d19425e7"/><file name="Tree.php" hash="b405b4bf4969812e13d63d752cd89c23"/></dir><dir name="Products"><file name="Attribute.php" hash="4aab6c02b883d138205db19c021dba1f"/><dir name="Confirm"><file name="Grid.php" hash="e35a967bf2e3d9882889a67d7de26e09"/></dir><file name="Confirm.php" hash="d4dddb499ff29d646fcd48246666126a"/><file name="Grid.php" hash="6f7bd418b0d7dc3c30fd2440cdce5143"/></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="9552bdb41b0dd5acd20f4e5c5928393a"/></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="084ee85e3779a0d202594dd3212849d0"/><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="ConfirmTranslateLabel.php" hash="cb94414d8fb1b214b5149d947984b0b7"/><file name="ConfirmTranslateOptions.php" hash="76791e48c056e42ba1b71ca0b6ef347e"/><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="5a2f7bce9d4a07d342a69d5e7b454ce3"/><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="be98f30a9ea8975f97f0996cd9a9a932"/></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="Job"><file name="Attribute.php" hash="6bc9221934346093ec6054704625808e"/><file name="Category.php" hash="37079e7131a4d10a9577afb499c6d7b6"/><file name="Product.php" hash="9f02ce34f909df6dd26c3414356ad565"/><file name="Status.php" hash="64c766deaf33bd0460c739f04544f8db"/><file name="Type.php" hash="c5010524e83e0c3c56595bcd72bba97d"/></dir><file name="Job.php" hash="ed17c0c4f6e274d8f04807a09e259ec0"/><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="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"/><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="bf7877e6947fefbe1c0dfb6f8c8f8e24"/><file name="CategoryController.php" hash="58081c3b019ea91c05b05970de2a501a"/><file name="JobController.php" hash="1e80dd802e2dd70f246ca4155bc05e14"/><file name="NewController.php" hash="e0f9dea7319a788ae45f7df70e4ccf9f"/><file name="ProductController.php" hash="b0e545070c393d56bf6aed62b236c13d"/></dir></dir><file name="CallbackController.php" hash="c9abd6304f6f071940735a47ab658633"/></dir><dir name="etc"><file name="adminhtml.xml" hash="802ab54b889201efd9318ec11f220f18"/><file name="config.xml" hash="4cedfb3da05c201fb8b139e053797d32"/><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"/></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="dff9e3ff88cf6494676f1be6f9297075"/></dir><dir name="template"><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="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="c3ac09c8c8fad9370e3ff5d123b8da43"/><file name="massaction.phtml" hash="01ebe5a6214dc13fddec28aaa9dd69bb"/></dir><file name="attribute.phtml" hash="9f327fe0551b9d39e455b361d662ce08"/><dir name="category"><file name="attributes.phtml" hash="c92f98e8397ae9143c17c87e2e468758"/><file name="confirm.phtml" hash="67cd87045de78b34855197267e63aff7"/><file name="tree.phtml" hash="6cdd2bccd0288ced068218624031ddcc"/></dir><file name="confirm.phtml" hash="72552d8f56335eb644a4c0ffe314f12b"/><dir name="products"><file name="attributes.phtml" hash="7e5328f2995d48b9fae436dc7dd7ab34"/><file name="confirm.phtml" hash="134fdca9aed015d6ab28778d523c01d6"/><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="57016d58d283fb99ce355e3787c4569f"/><file name="straker.less" hash="c7da66380b98c31653054fd2f27c03c1"/></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>
skin/adminhtml/default/straker/css/straker.css CHANGED
@@ -54,7 +54,7 @@
54
  display: inline-block;
55
  }
56
  .straker-main-container .store-select-container .validation-advice {
57
- margin-left: 49%;
58
  }
59
  .straker-main-container .form-buttons {
60
  margin-top: 20px;
@@ -365,6 +365,7 @@ Temp UI Updates : Yogi
365
  border: 1px solid #FF8E3C;
366
  font-size: 13px;
367
  color: #fff !important;
 
368
  }
369
  .straker-main-container label {
370
  color: #565656;
@@ -452,3 +453,15 @@ ol.wizard {
452
  .straker-store-settings-wrapper .straker-store-settings-row > .empty-button {
453
  display: inline-block;
454
  }
 
 
 
 
 
 
 
 
 
 
 
 
54
  display: inline-block;
55
  }
56
  .straker-main-container .store-select-container .validation-advice {
57
+ margin-left: 25%;
58
  }
59
  .straker-main-container .form-buttons {
60
  margin-top: 20px;
365
  border: 1px solid #FF8E3C;
366
  font-size: 13px;
367
  color: #fff !important;
368
+ margin-left: 10px;
369
  }
370
  .straker-main-container label {
371
  color: #565656;
453
  .straker-store-settings-wrapper .straker-store-settings-row > .empty-button {
454
  display: inline-block;
455
  }
456
+ .adminhtml-straker-new-index .straker-main-container .form-buttons {
457
+ overflow: hidden;
458
+ }
459
+ .adminhtml-straker-new-index .straker-main-container .form-buttons input.form-button {
460
+ float: right;
461
+ }
462
+ .content-header h3.store-info-heading {
463
+ margin-left: 30px;
464
+ }
465
+ #selectstore-form .validation-advice {
466
+ margin-left: 25%;
467
+ }
skin/adminhtml/default/straker/css/straker.less CHANGED
@@ -51,7 +51,7 @@
51
  }
52
  }
53
  .validation-advice{
54
- margin-left: 49%;
55
  }
56
  }
57
  .form-buttons{
@@ -395,6 +395,7 @@ Temp UI Updates : Yogi
395
  border: 1px solid #FF8E3C;
396
  font-size: 13px;
397
  color: #fff !important;
 
398
  }
399
  .straker-main-container label{
400
  color: #565656;
@@ -483,4 +484,21 @@ ol.wizard{
483
  display: inline-block;
484
  }
485
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
  }
51
  }
52
  }
53
  .validation-advice{
54
+ margin-left: 25%;
55
  }
56
  }
57
  .form-buttons{
395
  border: 1px solid #FF8E3C;
396
  font-size: 13px;
397
  color: #fff !important;
398
+ margin-left: 10px;
399
  }
400
  .straker-main-container label{
401
  color: #565656;
484
  display: inline-block;
485
  }
486
  }
487
+ }
488
+
489
+ //register page button fix
490
+ .adminhtml-straker-new-index{
491
+ .straker-main-container .form-buttons{
492
+ overflow: hidden;
493
+ input.form-button{
494
+ float: right;
495
+ }
496
+ }
497
+ }
498
+
499
+ .content-header h3.store-info-heading{
500
+ margin-left: 30px;
501
+ }
502
+ #selectstore-form .validation-advice{
503
+ margin-left: 25%;
504
  }