eurotext_translationMANAGER - Version 3.2.13

Version Notes

# Installation
We STRONGLY recommend installing and testing the plugin in a test environment before going live. Please back up your database before installing.
Further information can be found at http://eurotext.screenstepslive.com/s/translationmanager

# Update
Only install once all ongoing projects have been completed / successfully imported.
We STRONGLY recommend installing and testing the update in a test environment before going live. Please back up your database before installing.
Further information can be found at http://eurotext.screenstepslive.com/s/translationmanager

# General terms & conditions for Eurotext AG software applications
http://eurotext.de/en/contact/terms-and-conditions/

---------------------------
## Version 3.2.13 - 2017-02-09
### IMPROVED
- Updated translation

## Version 3.2.12 - 2017-01-17
### NEW
- Complete refactoring of the source code
- Completely revamped user interface
- Magento Grid introduced to the selection dialogs
- New category tree navigation for product selection
- You can now view the selections even after exporting
- Select multiple products in a text field by comma-separated SKU lists
- New: email templates from the database can now be translated as well
- Enhanced compatibility with third-party plugins and processes
- Improved performance and stability when exporting and importing
- The debug mode has been revised and updated with options to retain export packages on the server when they cannot be sent to Eurotext
- Improved checks and enhanced compatibility when creating zip files
- New: If an export fails, the untransferred ZIP file is copied to var/export/
- Enhanced checks of various system components (rights, directories, modules) to guarantee the stability of the plugin.
- Improved behavior when importing translations into source-language content that has already been deleted, including lists of non-imported content in import dialog and logging.
- Completely revised documentation (http://eurotext.screenstepslive.com/s/translationmanager/m/translationmanager-magento19)

### FIXED
- Image labels were not being exported
- Fixed a rights administration bug which occurred after updating to Magento 1.14 EE/1.9 CE
- Language files were being exported from the wrong source language
- The language file of custom themes (translate.csv) was not being exported
- General improvements to the export format
- General improvements to user registration
- General improvements to ZIP file creation
- Improved security for database write access
- Improved logging in standard mode and debug mode

### REMOVED
- Removed the feature to automatically export untranslated content

## Version 1.1.2.2
### NEW
- Translate your custom category attributes: export your custom attributes

## Version 1.1.2.1
### FIXED
- Duplicate URL key error during import fixed

## Version 1.1.2.0
### NEW
- Revamped DEBUG mode. Can now be activated in the back end (System -> Configuration -> Developer -> Log)
- Log file created in /var/log/eurotext.log, critical errors saved in eurotext_fatal.log even when DEBUG mode is deactivated
- Base directory changed from /eurotext to /var/eurotext
- Added logging for FTP check in DEBUG mode
### FIXED
- Various improvements to the usability of Magento directories

## Version 1.1.1.0
### FIXED
- Now only the selected language files will be exported
- Small bug fixes

## Version 1.1.0.0
### NEW
- Translate your custom product attributes: export your custom attributes
- Backup: in the event of transfer errors to the Eurotext server, data packages are saved to /var/export.
### FIXED
- Bug fixes and security updates
- Improved software performance and stability

## Version 1.0.0.9
### FIXED
- The Stock Availability will now be displayed for 'virtual' products/main products according to the setup in the back end

## Version 1.0.0.8
### NEW
- You can now filter the product selection by product type

## Version 1.0.0.7
### FIXED
- JavaScript error fixed
- The update script now works in a more tolerant manner

## Version 1.0.0.6
### NEW
- Two additional filters (status and stock availability) are now available in the product selection
- Static blocks can now be exported and imported. The static blocks are displayed with the CMS page selection

## Version 1.0.0.5
### NEW
- More project information is now displayed in the comment field of the control.xml
- The last action in a project can now be 'undone'
### FIXED
- The correct plugin version is now shown in the control.xml

## Version 1.0.0.4
### FIXED
- The module now exports attributes even if there is no name available for the source storeview. It simply exports the admin default text.

## Version 1.0.0.3
### FIXED
- The URL key will only be set in the target storeview (based on the product/category name) if there was previously no value there (i.e. "Use default values" was enabled). Previously, the URL key was set if the value was empty or equal to the default value
The "Use default values" setting is no longer lost in fields that are not present in the translation files.

## Version 1.0.0.2
### FIXED
- Imports would fail if product images, for which translations had been generated, were deleted in the Magento back end between import and export
- Product images missing from the import are now simply skipped

## Version 1.0.0.1
### NEW
- The product selection has been expanded to include an option to filter by categories, allowing for quick translations of entire categories
### FIXED
- URL fields not included in an export were being reset to their default values during import, instead of being generated based on the (translated) names

## Version 1.0.0.0
- Release Version 1.0.0.0

Download this release

Release Info

Developer Eurotext AG
Extension eurotext_translationMANAGER
Version 3.2.13
Comparing to
See all releases


Code changes from version 1.1.2.2 to 3.2.13

Files changed (217) hide show
  1. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Export/Overview.php +28 -0
  2. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Grid/OverwriteCheckboxRenderer.php +11 -0
  3. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Grid/Renderer/Checkbox.php +17 -0
  4. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Grid/Renderer/StoreviewWithLocale.php +18 -0
  5. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Import/Overview.php +36 -0
  6. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project.php +14 -0
  7. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit.php +58 -0
  8. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Form.php +28 -0
  9. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Categories.php +168 -0
  10. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/CmsBlock.php +104 -0
  11. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/CmsPage.php +108 -0
  12. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Emails/Note.php +16 -0
  13. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Grid/Massaction.php +58 -0
  14. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Main.php +273 -0
  15. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Main/Single.php +45 -0
  16. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Main/Uploader.php +31 -0
  17. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products.php +321 -0
  18. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products/CategoryTree.php +38 -0
  19. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products/CategoryTreeAjax.php +25 -0
  20. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products/Script.php +53 -0
  21. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/TransactionEmailFiles.php +155 -0
  22. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/TransactionEmailsDatabase.php +78 -0
  23. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/TranslateFiles.php +157 -0
  24. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tabs.php +84 -0
  25. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Grid.php +90 -0
  26. app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Grid/Renderer/StoreviewWithLocale.php +18 -0
  27. app/code/community/Eurotext/TranslationManager/Block/Projects.php +0 -158
  28. app/code/community/Eurotext/TranslationManager/Block/Register.php +0 -39
  29. app/code/community/Eurotext/TranslationManager/Block/Response/Ajax.php +27 -4
  30. app/code/community/Eurotext/TranslationManager/Block/Selectcategories.php +0 -139
  31. app/code/community/Eurotext/TranslationManager/Block/Selectcmspages.php +0 -116
  32. app/code/community/Eurotext/TranslationManager/Block/Selectemails.php +0 -81
  33. app/code/community/Eurotext/TranslationManager/Block/Selectlangfiles.php +0 -65
  34. app/code/community/Eurotext/TranslationManager/Block/Selectproducts.php +0 -329
  35. app/code/community/Eurotext/TranslationManager/Block/Settings.php +0 -34
  36. app/code/community/Eurotext/TranslationManager/Block/Status.php +270 -0
  37. app/code/community/Eurotext/TranslationManager/Block/System/Config/Form/Field/Registration/Status.php +38 -0
  38. app/code/community/Eurotext/TranslationManager/Block/System/Config/Form/Field/Text.php +15 -0
  39. app/code/community/Eurotext/TranslationManager/Exception/FtpException.php +6 -0
  40. app/code/community/Eurotext/TranslationManager/Helper/Category.php +24 -0
  41. app/code/community/Eurotext/TranslationManager/Helper/Config.php +271 -0
  42. app/code/community/Eurotext/TranslationManager/Helper/Data.php +82 -524
  43. app/code/community/Eurotext/TranslationManager/Helper/Eurotext.php +167 -228
  44. app/code/community/Eurotext/TranslationManager/Helper/Filesystem.php +102 -0
  45. app/code/community/Eurotext/TranslationManager/Helper/Project.php +35 -0
  46. app/code/community/Eurotext/TranslationManager/Helper/String.php +13 -0
  47. app/code/community/Eurotext/TranslationManager/Helper/Xml.php +29 -0
  48. app/code/community/Eurotext/TranslationManager/Model/Catalog/Product/Attribute/Backend/Media/OnlyStoreValues.php +12 -0
  49. app/code/community/Eurotext/TranslationManager/Model/Controller/Exception.php +12 -0
  50. app/code/community/Eurotext/TranslationManager/Model/Eav/Attribute/Label.php +11 -0
  51. app/code/community/Eurotext/TranslationManager/Model/Eav/Attribute/Option/Value.php +9 -0
  52. app/code/community/Eurotext/TranslationManager/Model/EurotextLanguages.php +146 -0
  53. app/code/community/Eurotext/TranslationManager/Model/Export/Project.php +300 -0
  54. app/code/community/Eurotext/TranslationManager/Model/Export/Project/Attribute.php +123 -0
  55. app/code/community/Eurotext/TranslationManager/Model/Export/Project/Category.php +293 -0
  56. app/code/community/Eurotext/TranslationManager/Model/Export/Project/CmsBlock.php +201 -0
  57. app/code/community/Eurotext/TranslationManager/Model/Export/Project/CmsPage.php +197 -0
  58. app/code/community/Eurotext/TranslationManager/Model/Export/Project/CreateControlFile.php +309 -0
  59. app/code/community/Eurotext/TranslationManager/Model/Export/Project/EmailDatabaseTemplates.php +167 -0
  60. app/code/community/Eurotext/TranslationManager/Model/Export/Project/EmailFileTemplates.php +223 -0
  61. app/code/community/Eurotext/TranslationManager/Model/Export/Project/Exporter.php +8 -0
  62. app/code/community/Eurotext/TranslationManager/Model/Export/Project/FtpUpload.php +262 -0
  63. app/code/community/Eurotext/TranslationManager/Model/Export/Project/LocaleCsvFiles.php +232 -0
  64. app/code/community/Eurotext/TranslationManager/Model/Export/Project/Product.php +452 -0
  65. app/code/community/Eurotext/TranslationManager/Model/Extractor.php +60 -0
  66. app/code/community/Eurotext/TranslationManager/Model/Factory.php +35 -0
  67. app/code/community/Eurotext/TranslationManager/Model/Import/Project.php +188 -0
  68. app/code/community/Eurotext/TranslationManager/Model/Import/Project/Attributes.php +78 -0
  69. app/code/community/Eurotext/TranslationManager/Model/Import/Project/Categories.php +118 -0
  70. app/code/community/Eurotext/TranslationManager/Model/Import/Project/CmsBlocks.php +141 -0
  71. app/code/community/Eurotext/TranslationManager/Model/Import/Project/CmsPages.php +129 -0
  72. app/code/community/Eurotext/TranslationManager/Model/Import/Project/CollectSkipped.php +25 -0
  73. app/code/community/Eurotext/TranslationManager/Model/Import/Project/EmailTemplates.php +127 -0
  74. app/code/community/Eurotext/TranslationManager/Model/Import/Project/Exception/MissingEntity.php +29 -0
  75. app/code/community/Eurotext/TranslationManager/Model/Import/Project/Importer.php +16 -0
  76. app/code/community/Eurotext/TranslationManager/Model/Import/Project/LocaleCsvFiles.php +171 -0
  77. app/code/community/Eurotext/TranslationManager/Model/Import/Project/Product.php +335 -0
  78. app/code/community/Eurotext/TranslationManager/Model/Import/Queue.php +44 -0
  79. app/code/community/Eurotext/TranslationManager/Model/Import/Validator.php +80 -0
  80. app/code/community/Eurotext/TranslationManager/Model/Observer.php +268 -0
  81. app/code/community/Eurotext/TranslationManager/Model/ProductLoader.php +41 -0
  82. app/code/community/Eurotext/TranslationManager/Model/Project.php +346 -0
  83. app/code/community/Eurotext/TranslationManager/Model/Project/Category.php +11 -0
  84. app/code/community/Eurotext/TranslationManager/Model/Project/Cmsblock.php +11 -0
  85. app/code/community/Eurotext/TranslationManager/Model/Project/Cmspage.php +11 -0
  86. app/code/community/Eurotext/TranslationManager/Model/Project/Csv.php +9 -0
  87. app/code/community/Eurotext/TranslationManager/Model/Project/EmailtemplateDatabase.php +11 -0
  88. app/code/community/Eurotext/TranslationManager/Model/Project/EmailtemplateFile.php +19 -0
  89. app/code/community/Eurotext/TranslationManager/Model/Project/Import.php +30 -0
  90. app/code/community/Eurotext/TranslationManager/Model/Project/Product.php +11 -0
  91. app/code/community/Eurotext/TranslationManager/Model/Project/Source/Status.php +30 -0
  92. app/code/community/Eurotext/TranslationManager/Model/Renderer/Filesystem.php +15 -0
  93. app/code/community/Eurotext/TranslationManager/Model/Renderer/Filesystem/RelativeToAppDirectory.php +19 -0
  94. app/code/community/Eurotext/TranslationManager/Model/Renderer/Filesystem/RelativeToLocaleTemplateDirectory.php +21 -0
  95. app/code/community/Eurotext/TranslationManager/Model/Resource/Catalog/Product/Attribute/Backend/Media/OnlyStoreValues.php +38 -0
  96. app/code/community/Eurotext/TranslationManager/Model/Resource/Catalog/Product/Option/Title.php +26 -0
  97. app/code/community/Eurotext/TranslationManager/Model/Resource/Catalog/Product/Option/Type/Title.php +25 -0
  98. app/code/community/Eurotext/TranslationManager/Model/Resource/Csv/Collection.php +100 -0
  99. app/code/community/Eurotext/TranslationManager/Model/Resource/Eav/Attribute/Label.php +9 -0
  100. app/code/community/Eurotext/TranslationManager/Model/Resource/Eav/Attribute/Label/Collection.php +11 -0
  101. app/code/community/Eurotext/TranslationManager/Model/Resource/Eav/Attribute/Option/Value.php +9 -0
  102. app/code/community/Eurotext/TranslationManager/Model/Resource/Eav/Attribute/Option/Value/Collection.php +28 -0
  103. app/code/community/Eurotext/TranslationManager/Model/Resource/Emailtemplate/Filesystem/Collection.php +41 -0
  104. app/code/community/Eurotext/TranslationManager/Model/Resource/Filesystem/Collection.php +42 -0
  105. app/code/community/Eurotext/TranslationManager/Model/Resource/Project.php +187 -0
  106. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Category.php +11 -0
  107. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Category/Collection.php +12 -0
  108. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Cmsblock.php +11 -0
  109. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Cmsblock/Collection.php +12 -0
  110. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Cmspage.php +11 -0
  111. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Cmspage/Collection.php +12 -0
  112. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Collection.php +12 -0
  113. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Csv.php +9 -0
  114. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Csv/Collection.php +9 -0
  115. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/EmailtemplateDatabase.php +11 -0
  116. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/EmailtemplateDatabase/Collection.php +11 -0
  117. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/EmailtemplateFile.php +9 -0
  118. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/EmailtemplateFile/Collection.php +10 -0
  119. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Import.php +20 -0
  120. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Import/Collection.php +10 -0
  121. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Product.php +11 -0
  122. app/code/community/Eurotext/TranslationManager/Model/Resource/Project/Product/Collection.php +10 -0
  123. app/code/community/Eurotext/TranslationManager/Model/Source/StoreViewWithLocale.php +29 -0
  124. app/code/community/Eurotext/TranslationManager/Model/System/Config/Source/Salutation.php +17 -0
  125. app/code/community/Eurotext/TranslationManager/Model/Updater/MediaGalleryValue.php +22 -0
  126. app/code/community/Eurotext/TranslationManager/Model/Xml/Import/Cms/Block.php +6 -0
  127. app/code/community/Eurotext/TranslationManager/Model/Xml/Import/Cms/BlockReader.php +63 -0
  128. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/HelpController.php +18 -0
  129. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Project/ExportController.php +67 -0
  130. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Project/ImportController.php +387 -0
  131. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/ProjectController.php +462 -0
  132. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/StatusController.php +36 -0
  133. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/HelpController.php +0 -17
  134. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/ProjectsController.php +0 -3240
  135. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/RegisterController.php +0 -230
  136. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/SelectcategoriesController.php +0 -134
  137. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/SelectcmspagesController.php +0 -123
  138. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/SelectemailsController.php +0 -88
  139. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/SelectlangfilesController.php +0 -89
  140. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/SelectproductsController.php +0 -224
  141. app/code/community/Eurotext/TranslationManager/controllers/Adminhtml/Eurotext/Translationmanager/SettingsController.php +0 -72
  142. app/code/community/Eurotext/TranslationManager/data/eurotext_translationmanager_setup/data-install-3.0.0.php +5 -0
  143. app/code/community/Eurotext/TranslationManager/data/eurotext_translationmanager_setup/data-upgrade-1.2.0.4-1.2.1.php +17 -0
  144. app/code/community/Eurotext/TranslationManager/data/eurotext_translationmanager_setup/data-upgrade-1.2.1-1.2.2.php +28 -0
  145. app/code/community/Eurotext/TranslationManager/data/eurotext_translationmanager_setup/data-upgrade-3.1.1-3.1.2.php +29 -0
  146. app/code/community/Eurotext/TranslationManager/etc/adminhtml.xml +25 -16
  147. app/code/community/Eurotext/TranslationManager/etc/config.xml +104 -20
  148. app/code/community/Eurotext/TranslationManager/etc/jstranslator.xml +31 -19
  149. app/code/community/Eurotext/TranslationManager/etc/system.xml +249 -3
  150. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/install-3.0.0.php +455 -0
  151. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-1.1.2.1-1.2.0.0.php +58 -0
  152. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-1.2.0.0-1.2.0.1.php +41 -0
  153. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-1.2.0.1-1.2.0.2.php +40 -0
  154. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-1.2.0.2-1.2.0.3.php +62 -0
  155. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-1.2.1-1.2.2.php +17 -0
  156. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-1.2.2-2.0.0.php +18 -0
  157. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.0-2.0.1.php +18 -0
  158. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.1-2.0.2.php +20 -0
  159. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.10-3.0.0.php +85 -0
  160. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.3-2.0.4.php +11 -0
  161. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.4-2.0.5.php +11 -0
  162. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.5-2.0.6.php +27 -0
  163. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.6-2.0.7.php +26 -0
  164. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.7-2.0.8.php +18 -0
  165. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.8-2.0.9.php +20 -0
  166. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-2.0.9-2.0.10.php +13 -0
  167. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-3.0.0-3.0.1.php +34 -0
  168. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-3.0.1-3.0.2.php +10 -0
  169. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-3.0.2-3.1.1.php +23 -0
  170. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-3.1.5-3.1.6.php +19 -0
  171. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-3.1.6-3.1.7.php +14 -0
  172. app/code/community/Eurotext/TranslationManager/sql/eurotext_translationmanager_setup/upgrade-3.1.7-3.1.8.php +60 -0
  173. app/code/community/Eurotext/Uploader/Block/Abstract.php +234 -0
  174. app/code/community/Eurotext/Uploader/Block/Single.php +28 -0
  175. app/code/community/Eurotext/Uploader/Helper/Data.php +6 -0
  176. app/code/community/Eurotext/Uploader/Helper/File.php +728 -0
  177. app/code/community/Eurotext/Uploader/Model/Config/Abstract.php +50 -0
  178. app/code/community/Eurotext/Uploader/Model/Config/Browsebutton.php +39 -0
  179. app/code/community/Eurotext/Uploader/Model/Config/Misc.php +21 -0
  180. app/code/community/Eurotext/Uploader/Model/Config/Uploader.php +97 -0
  181. app/code/community/Eurotext/Uploader/etc/config.xml +25 -0
  182. app/code/community/Eurotext/Uploader/etc/jstranslator.xml +19 -0
  183. app/design/adminhtml/base/default/layout/eurotext/translationmanager.xml +250 -83
  184. app/design/adminhtml/base/default/template/eurotext/translationmanager/export/overview.phtml +16 -0
  185. app/design/adminhtml/base/default/template/eurotext/translationmanager/help.phtml +84 -84
  186. app/design/adminhtml/base/default/template/eurotext/translationmanager/import/overview.phtml +63 -0
  187. app/design/adminhtml/base/default/template/eurotext/translationmanager/project/email/note.phtml +22 -0
  188. app/design/adminhtml/base/default/template/eurotext/translationmanager/project/products/bulk_sku.phtml +9 -0
  189. app/design/adminhtml/base/default/template/eurotext/translationmanager/project/products/category_tree.phtml +157 -0
  190. app/design/adminhtml/base/default/template/eurotext/translationmanager/project/products/script.phtml +9 -0
  191. app/design/adminhtml/base/default/template/eurotext/translationmanager/projects.phtml +0 -392
  192. app/design/adminhtml/base/default/template/eurotext/translationmanager/register.phtml +0 -344
  193. app/design/adminhtml/base/default/template/eurotext/translationmanager/selectcategories.phtml +0 -130
  194. app/design/adminhtml/base/default/template/eurotext/translationmanager/selectcmspages.phtml +0 -169
  195. app/design/adminhtml/base/default/template/eurotext/translationmanager/selectemails.phtml +0 -113
  196. app/design/adminhtml/base/default/template/eurotext/translationmanager/selectlangfiles.phtml +0 -129
  197. app/design/adminhtml/base/default/template/eurotext/translationmanager/selectproducts.phtml +0 -351
  198. app/design/adminhtml/base/default/template/eurotext/translationmanager/settings.phtml +0 -202
  199. app/etc/modules/Eurotext_TranslationManager.xml +4 -2
  200. app/locale/de_DE/Eurotext_TranslationManager.csv +181 -221
  201. app/locale/de_DE/Eurotext_Uploader.csv +10 -0
  202. app/locale/en_US/Eurotext_TranslationManager.csv +169 -214
  203. app/locale/en_US/Eurotext_Uploader.csv +10 -0
  204. js/eurotext/uploader/flow.min.js +2 -0
  205. js/eurotext/uploader/fusty-flow-factory.js +14 -0
  206. js/eurotext/uploader/fusty-flow.js +429 -0
  207. js/eurotext/uploader/instance.js +509 -0
  208. package.xml +132 -83
  209. skin/adminhtml/base/default/eurotext/translationmanager/css/help.css +17 -0
  210. skin/adminhtml/base/default/eurotext/translationmanager/css/project.css +133 -0
  211. skin/adminhtml/base/default/eurotext/translationmanager/css/status.css +22 -0
  212. skin/adminhtml/base/default/eurotext/translationmanager/css/styles.css +0 -206
  213. skin/adminhtml/base/default/eurotext/translationmanager/js/eurotext-jquery-1.9.1.js +0 -9597
  214. skin/adminhtml/base/default/eurotext/translationmanager/js/eurotext.js +0 -898
  215. skin/adminhtml/base/default/eurotext/translationmanager/js/eurotext_project.js +93 -0
  216. skin/adminhtml/base/default/eurotext/translationmanager/js/export.js +45 -0
  217. skin/adminhtml/base/default/eurotext/translationmanager/js/system_config.js +12 -0
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Export/Overview.php ADDED
@@ -0,0 +1,28 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Export_Overview extends Mage_Adminhtml_Block_Template
4
+ {
5
+ /**
6
+ * @return int
7
+ */
8
+ public function getProjectId()
9
+ {
10
+ return Mage::registry('project')->getId();
11
+ }
12
+
13
+ /**
14
+ * @return string
15
+ */
16
+ public function getExportUrl()
17
+ {
18
+ return $this->getUrl('*/eurotext_project_export/export');
19
+ }
20
+
21
+ /**
22
+ * @return string
23
+ */
24
+ public function getSuccessUrl()
25
+ {
26
+ return $this->getUrl('*/eurotext_project/edit', ['project_id' => $this->getProjectId()]);
27
+ }
28
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Grid/OverwriteCheckboxRenderer.php ADDED
@@ -0,0 +1,11 @@
1
+ <?php
2
+
3
+ trait Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer
4
+ {
5
+ public function getColumnRenderers()
6
+ {
7
+ return [
8
+ 'checkbox' => 'eurotext_translationmanager/adminhtml_eurotext_grid_renderer_checkbox',
9
+ ];
10
+ }
11
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Grid/Renderer/Checkbox.php ADDED
@@ -0,0 +1,17 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_Renderer_Checkbox
4
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox
5
+ {
6
+ public function getDisabled()
7
+ {
8
+ /** @var $project Eurotext_TranslationManager_Model_Project */
9
+ $project = Mage::registry('project');
10
+
11
+ if (!$project->isEditable()) {
12
+ return 'disabled="disabled"';
13
+ }
14
+
15
+ return '';
16
+ }
17
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Grid/Renderer/StoreviewWithLocale.php ADDED
@@ -0,0 +1,18 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_Renderer_StoreviewWithLocale extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ public function render(Varien_Object $row)
6
+ {
7
+ $storeId = $row->getData($this->getColumn()->getIndex());
8
+ try {
9
+ $store = Mage::app()->getStore($storeId);
10
+
11
+ return sprintf('%s (%s)', $store->getName(), Mage::getStoreConfig('general/locale/code', $store));
12
+ } catch (Mage_Core_Model_Store_Exception $e) {
13
+ // store not found (happens if $storeId = -1)
14
+ }
15
+
16
+ return '';
17
+ }
18
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Import/Overview.php ADDED
@@ -0,0 +1,36 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Import_Overview extends Mage_Adminhtml_Block_Template
4
+ {
5
+ /**
6
+ * @return int
7
+ */
8
+ public function getProjectId()
9
+ {
10
+ return Mage::registry('project')->getId();
11
+ }
12
+
13
+ /**
14
+ * @return string
15
+ */
16
+ public function getSuccessUrl()
17
+ {
18
+ return $this->getUrl('*/eurotext_project/edit', ['project_id' => $this->getProjectId()]);
19
+ }
20
+
21
+ /**
22
+ * @return string
23
+ */
24
+ public function getAddFilesToImportQueueUrl()
25
+ {
26
+ return $this->getUrl('*/*/addFilesToImportQueue');
27
+ }
28
+
29
+ /**
30
+ * @return string
31
+ */
32
+ public function getProcessFilesFromQueueUrl()
33
+ {
34
+ return $this->getUrl('*/*/processFilesFromQueue');
35
+ }
36
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project.php ADDED
@@ -0,0 +1,14 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project
4
+ extends Mage_Adminhtml_Block_Widget_Grid_Container
5
+ {
6
+ public function __construct()
7
+ {
8
+ $this->_blockGroup = 'eurotext_translationmanager';
9
+ $this->_controller = 'adminhtml_eurotext_project';
10
+ $this->_headerText = $this->__('Projects');
11
+
12
+ parent::__construct();
13
+ }
14
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit.php ADDED
@@ -0,0 +1,58 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit
4
+ extends Mage_Adminhtml_Block_Widget_Form_Container
5
+ {
6
+ public function __construct()
7
+ {
8
+ /** @var $project Eurotext_TranslationManager_Model_Project */
9
+ $project = Mage::registry('project');
10
+ $this->_objectId = 'project_id';
11
+
12
+ parent::__construct();
13
+
14
+ $this->_controller = 'adminhtml_eurotext_project';
15
+ $this->_blockGroup = 'eurotext_translationmanager';
16
+
17
+ $this->_updateButton('save', 'label', Mage::helper('eurotext_translationmanager')->__('Save Project'));
18
+
19
+ $projectId = $project->getId();
20
+
21
+ $exportUrl = $this->getUrl('*/eurotext_project_export', ['project_id' => $projectId]);
22
+ if (!$project->isObjectNew()) {
23
+ $this->_addButton(
24
+ 'export',
25
+ [
26
+ 'label' => $this->__('Export to Eurotext AG'),
27
+ 'onclick' => "setLocation('$exportUrl')",
28
+ 'class' => 'go export',
29
+ 'id' => 'export_button'
30
+ ]
31
+ );
32
+ }
33
+
34
+ if (!$project->isEditable()) {
35
+ $this->_removeButton('save');
36
+ $this->_removeButton('export');
37
+ $this->_removeButton('reset');
38
+
39
+ $url = $this->getUrl('*/eurotext_project/reset', ['project_id' => $projectId]);
40
+ $this->_addButton(
41
+ 'step_back',
42
+ [
43
+ 'label' => $this->__('Reset to last status'),
44
+ 'onclick' => "setLocation('$url');",
45
+ 'class' => 'cancel'
46
+ ]
47
+ );
48
+ }
49
+ }
50
+
51
+ /**
52
+ * @return string
53
+ */
54
+ public function getHeaderText()
55
+ {
56
+ return Mage::helper('eurotext_translationmanager')->__('New project');
57
+ }
58
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Form.php ADDED
@@ -0,0 +1,28 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('edit_form');
10
+ $this->setTitle($this->__('Project Information'));
11
+ }
12
+
13
+ protected function _prepareForm()
14
+ {
15
+ $form = new Varien_Data_Form(
16
+ [
17
+ 'id' => 'edit_form',
18
+ 'action' => $this->getUrl('*/*/save'),
19
+ 'method' => 'post',
20
+ 'enctype' => 'multipart/form-data'
21
+ ]
22
+ );
23
+ $form->setUseContainer(true);
24
+ $this->setForm($form);
25
+
26
+ return parent::_prepareForm();
27
+ }
28
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Categories.php ADDED
@@ -0,0 +1,168 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method int[] getSelectedCategories()
5
+ * @method setSelectedCategories(int[] $ids)
6
+ * @method setUseAjax(boolean $useAjax)
7
+ */
8
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Categories
9
+ extends Mage_Adminhtml_Block_Widget_Grid
10
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
11
+ {
12
+ use Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer;
13
+
14
+ public function __construct(array $attributes)
15
+ {
16
+ parent::__construct($attributes);
17
+ $this->setId('categoryGrid');
18
+ $this->setDefaultSort('entity_id');
19
+ $this->setDefaultDir('DESC');
20
+ $this->setSaveParametersInSession(true);
21
+ $this->setUseAjax(true);
22
+ $this->setVarNameFilter('category_filter');
23
+ }
24
+
25
+ protected function _prepareCollection()
26
+ {
27
+ $collection = Mage::getResourceModel('catalog/category_collection');
28
+ $collection->addAttributeToSelect(['name', 'is_active']);
29
+ $collection->addFieldToFilter('path', ['neq' => '1']);
30
+ $collection->setLoadProductCount(true);
31
+ $this->setCollection($collection);
32
+
33
+ return parent::_prepareCollection();
34
+ }
35
+
36
+ protected function _prepareColumns()
37
+ {
38
+ /** @var Eurotext_TranslationManager_Model_Project $project */
39
+ $project = Mage::registry('project');
40
+
41
+ $this->addColumn(
42
+ 'categories',
43
+ [
44
+ 'header_css_class' => 'a-center',
45
+ 'type' => 'checkbox',
46
+ 'name' => 'categories',
47
+ 'values' => $this->_getSelectedCategories(),
48
+ 'align' => 'center',
49
+ 'index' => 'entity_id',
50
+ 'use_index' => true,
51
+ 'filter' => false,
52
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : ''
53
+ ]
54
+ );
55
+
56
+ $this->addColumn(
57
+ 'entity_id',
58
+ [
59
+ 'header' => $this->__('ID'),
60
+ 'width' => '50px',
61
+ 'type' => 'number',
62
+ 'index' => 'entity_id',
63
+ ]
64
+ );
65
+
66
+ $this->addColumn(
67
+ 'name',
68
+ [
69
+ 'header' => $this->__('Name'),
70
+ 'index' => 'name',
71
+ ]
72
+ );
73
+
74
+ $sourceBoolean = Mage::getSingleton('eav/entity_attribute_source_boolean');
75
+ $this->addColumn(
76
+ 'is_active',
77
+ [
78
+ 'header' => $this->__('Active'),
79
+ 'width' => '70px',
80
+ 'index' => 'is_active',
81
+ 'type' => 'options',
82
+ 'options' => $sourceBoolean->getOptionArray(),
83
+ ]
84
+ );
85
+
86
+ $this->addColumn(
87
+ 'product_count',
88
+ [
89
+ 'header' => $this->__('Product Count'),
90
+ 'width' => '30px',
91
+ 'index' => 'product_count',
92
+ 'type' => 'int',
93
+ 'sortable' => false,
94
+ 'filter' => false,
95
+ ]
96
+ );
97
+
98
+ return parent::_prepareColumns();
99
+ }
100
+
101
+ public function _getSelectedCategories()
102
+ {
103
+ $products = $this->getSelectedCategories();
104
+ if (!is_array($products)) {
105
+ $products = $this->getSelectedCategoriesFromDatabase();
106
+ }
107
+
108
+ return $products;
109
+ }
110
+
111
+ private function getSelectedCategoriesFromDatabase()
112
+ {
113
+ /** @var Eurotext_TranslationManager_Model_Project $project */
114
+ $project = Mage::registry('project');
115
+
116
+ return $project->getCategories();
117
+ }
118
+
119
+ /**
120
+ * @return string
121
+ */
122
+ public function getTabLabel()
123
+ {
124
+ return $this->__('Categories');
125
+ }
126
+
127
+ /**
128
+ * @return string
129
+ */
130
+ public function getTabTitle()
131
+ {
132
+ return $this->getTabLabel();
133
+ }
134
+
135
+ /**
136
+ * @return boolean
137
+ */
138
+ public function canShowTab()
139
+ {
140
+ return true;
141
+ }
142
+
143
+ /**
144
+ * @return boolean
145
+ */
146
+ public function isHidden()
147
+ {
148
+ return !$this->canShowTab();
149
+ }
150
+
151
+ /**
152
+ * @param Varien_Object $item
153
+ * @return bool
154
+ */
155
+ public function getMultipleRows($item)
156
+ {
157
+ return false;
158
+ }
159
+
160
+ /**
161
+ * @return string
162
+ */
163
+ public function getGridUrl()
164
+ {
165
+ return $this->getUrl('*/*/categoriesgrid', ['_current' => true]);
166
+ }
167
+
168
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/CmsBlock.php ADDED
@@ -0,0 +1,104 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method setSelectedCmsBlocks(int[] $ids)
5
+ * @method int[] getSelectedCmsBlocks()
6
+ * @method setUseAjax(boolean $useAjax)
7
+ */
8
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_CmsBlock
9
+ extends Mage_Adminhtml_Block_Cms_Block_Grid
10
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
11
+ {
12
+ use Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer;
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+ $this->setSaveParametersInSession(true);
18
+ $this->setUseAjax(true);
19
+ $this->setVarNameFilter('cmsblock_filter');
20
+ }
21
+
22
+ protected function _prepareColumns()
23
+ {
24
+ /** @var Eurotext_TranslationManager_Model_Project $project */
25
+ $project = Mage::registry('project');
26
+
27
+ $this->addColumn(
28
+ 'blocks',
29
+ [
30
+ 'header_css_class' => 'a-center',
31
+ 'type' => 'checkbox',
32
+ 'name' => 'blocks',
33
+ 'values' => $this->_getSelectedCmsBlocks(),
34
+ 'align' => 'center',
35
+ 'index' => 'block_id',
36
+ 'use_index' => true,
37
+ 'filter' => false,
38
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
39
+ ]
40
+ );
41
+
42
+ return parent::_prepareColumns();
43
+ }
44
+
45
+ public function _getSelectedCmsBlocks()
46
+ {
47
+ $products = $this->getSelectedCmsBlocks();
48
+ if (!is_array($products)) {
49
+ $products = $this->getSelectedCmsBlocksFromDatabase();
50
+ }
51
+
52
+ return $products;
53
+ }
54
+
55
+ private function getSelectedCmsBlocksFromDatabase()
56
+ {
57
+ /** @var Eurotext_TranslationManager_Model_Project $project */
58
+ $project = Mage::registry('project');
59
+
60
+ return $project->getBlocks();
61
+ }
62
+
63
+ public function getGridUrl()
64
+ {
65
+ return $this->getUrl('*/*/cmsblocksgrid', ['_current' => true]);
66
+ }
67
+
68
+ public function getRowUrl($row)
69
+ {
70
+ return null;
71
+ }
72
+
73
+ /**
74
+ * @return string
75
+ */
76
+ public function getTabLabel()
77
+ {
78
+ return $this->__('CMS Blocks');
79
+ }
80
+
81
+ /**
82
+ * @return string
83
+ */
84
+ public function getTabTitle()
85
+ {
86
+ return $this->getTabLabel();
87
+ }
88
+
89
+ /**
90
+ * @return boolean
91
+ */
92
+ public function canShowTab()
93
+ {
94
+ return true;
95
+ }
96
+
97
+ /**
98
+ * @return boolean
99
+ */
100
+ public function isHidden()
101
+ {
102
+ return !$this->canShowTab();
103
+ }
104
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/CmsPage.php ADDED
@@ -0,0 +1,108 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method int[] getSelectedCmsPages()
5
+ * @method setSelectedCmsPages(int[] $ids)
6
+ * @method setUseAjax(boolean $useAjax)
7
+ */
8
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_CmsPage
9
+ extends Mage_Adminhtml_Block_Cms_Page_Grid
10
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
11
+ {
12
+ use Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer;
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+ $this->setSaveParametersInSession(true);
18
+ $this->setUseAjax(true);
19
+ $this->setVarNameFilter('cmspage_filter');
20
+ }
21
+
22
+ protected function _prepareColumns()
23
+ {
24
+ /** @var Eurotext_TranslationManager_Model_Project $project */
25
+ $project = Mage::registry('project');
26
+
27
+ $this->addColumn(
28
+ 'pages',
29
+ [
30
+ 'header_css_class' => 'a-center',
31
+ 'type' => 'checkbox',
32
+ 'name' => 'pages',
33
+ 'values' => $this->getSelectedCmsPages(),
34
+ 'align' => 'center',
35
+ 'index' => 'page_id',
36
+ 'use_index' => true,
37
+ 'filter' => false,
38
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
39
+ ]
40
+ );
41
+
42
+ parent::_prepareColumns();
43
+
44
+ $this->removeColumn('page_actions');
45
+
46
+ return $this;
47
+ }
48
+
49
+ public function _getSelectedCmsPages()
50
+ {
51
+ $products = $this->getSelectedCmsPages();
52
+ if (!is_array($products)) {
53
+ $products = $this->getSelectedCmsPagesFromDatabase();
54
+ }
55
+
56
+ return $products;
57
+ }
58
+
59
+ private function getSelectedCmsPagesFromDatabase()
60
+ {
61
+ /** @var Eurotext_TranslationManager_Model_Project $project */
62
+ $project = Mage::registry('project');
63
+
64
+ return $project->getPages();
65
+ }
66
+
67
+ public function getGridUrl()
68
+ {
69
+ return $this->getUrl('*/*/cmspagesgrid', ['_current' => true]);
70
+ }
71
+
72
+ public function getRowUrl($row)
73
+ {
74
+ return null;
75
+ }
76
+
77
+ /**
78
+ * @return string
79
+ */
80
+ public function getTabLabel()
81
+ {
82
+ return $this->__('CMS Pages');
83
+ }
84
+
85
+ /**
86
+ * @return string
87
+ */
88
+ public function getTabTitle()
89
+ {
90
+ return $this->getTabLabel();
91
+ }
92
+
93
+ /**
94
+ * @return boolean
95
+ */
96
+ public function canShowTab()
97
+ {
98
+ return true;
99
+ }
100
+
101
+ /**
102
+ * @return boolean
103
+ */
104
+ public function isHidden()
105
+ {
106
+ return !$this->canShowTab();
107
+ }
108
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Emails/Note.php ADDED
@@ -0,0 +1,16 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Emails_Note
4
+ extends Mage_Adminhtml_Block_Template
5
+ {
6
+ /**
7
+ * @return string
8
+ */
9
+ public function getLanguageFromProject()
10
+ {
11
+ /** @var Eurotext_TranslationManager_Model_Project $project */
12
+ $project = Mage::registry('project');
13
+
14
+ return $project->getStoreviewDstLocale();
15
+ }
16
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Grid/Massaction.php ADDED
@@ -0,0 +1,58 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Grid_Massaction
4
+ extends Mage_Adminhtml_Block_Widget_Grid_Massaction
5
+ {
6
+ /**
7
+ * @return string
8
+ */
9
+ public function getJavaScript()
10
+ {
11
+ return " {$this->getJsObjectName()} = new varienGridMassaction('{$this->getHtmlId()}', "
12
+ . "{$this->getGridJsObjectName()}, '{$this->getSelectedJson()}'"
13
+ . ", '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}');"
14
+ . "{$this->getJsObjectName()}.setItems({$this->getItemsJson()}); "
15
+ . "{$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}');"
16
+ . ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '')
17
+ . ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '')
18
+ . "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';";
19
+ }
20
+
21
+ /**
22
+ * Retrieve JSON string of selected checkboxes
23
+ *
24
+ * @return string
25
+ */
26
+ public function getSelectedJson()
27
+ {
28
+ $internalField = $this->getRequest()->getParam($this->getFormFieldNameInternal());
29
+ $selected = array_merge(
30
+ is_array($internalField) ? $internalField : [],
31
+ $this->getParentBlock()->getSelected()
32
+ );
33
+ if ($selected) {
34
+ return join(',', $selected);
35
+ } else {
36
+ return '';
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Retrieve array of selected checkboxes
42
+ *
43
+ * @return array
44
+ */
45
+ public function getSelected()
46
+ {
47
+ $internalField = $this->getRequest()->getParam($this->getFormFieldNameInternal());
48
+ $selected = $internalField . implode(',', $this->getParentBlock()->getSelected());
49
+
50
+ if ($selected) {
51
+ $selected = explode(',', $selected);
52
+
53
+ return $selected;
54
+ } else {
55
+ return [];
56
+ }
57
+ }
58
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Main.php ADDED
@@ -0,0 +1,273 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method setTitle(string $title)
5
+ */
6
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Main
7
+ extends Mage_Adminhtml_Block_Widget_Form
8
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
9
+ {
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->setId('project_id');
14
+ $this->setTitle(Mage::helper('eurotext_translationmanager')->__('Project Information'));
15
+ }
16
+
17
+ protected function _prepareForm()
18
+ {
19
+ $helper = Mage::helper('eurotext_translationmanager');
20
+ /** @var Eurotext_TranslationManager_Model_Project $project */
21
+ $project = Mage::registry('project');
22
+
23
+ $form = new Varien_Data_Form(
24
+ [
25
+ 'id' => 'edit_form',
26
+ 'action' => $this->getUrl('*/*/save'),
27
+ 'method' => 'post',
28
+ ]
29
+ );
30
+
31
+ $form->setHtmtIdPrefix('project_');
32
+
33
+ if ($project->isTranslationImportable()) {
34
+ $fieldset = $form->addFieldset('translation', ['legend' => $helper->__('Import translations')]);
35
+ $fieldset->addType(
36
+ 'uploader',
37
+ Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Main_Uploader::class
38
+ );
39
+ $fieldset->addField(
40
+ 'translation_file',
41
+ 'uploader',
42
+ [
43
+ 'name' => 'translation_file',
44
+ 'comment' => $helper->__('Import the ZIP file containing the finished translations here.'),
45
+ 'label' => $helper->__('Translation'),
46
+ 'class' => 'required-entry',
47
+ ]
48
+ );
49
+ }
50
+
51
+ $fieldset = $form->addFieldset('project', ['legend' => $helper->__('Project Information')]);
52
+
53
+ $fieldset->addField(
54
+ 'project_name',
55
+ 'text',
56
+ [
57
+ 'name' => 'project_name',
58
+ 'label' => $helper->__('Name'),
59
+ 'class' => 'required-entry',
60
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
61
+ ]
62
+ );
63
+
64
+ if (!$project->isObjectNew()) {
65
+ $fieldset->addField(
66
+ 'id',
67
+ 'hidden',
68
+ [
69
+ 'name' => 'id',
70
+ 'class' => 'required-entry',
71
+ ]
72
+ );
73
+ }
74
+
75
+ $fieldset->addField(
76
+ 'storeview_src',
77
+ 'select',
78
+ [
79
+ 'name' => 'storeview_src',
80
+ 'label' => $helper->__('Source StoreView'),
81
+ 'values' => Mage::getModel('eurotext_translationmanager/source_storeViewWithLocale')->toOptionArray(),
82
+ 'class' => 'required-entry',
83
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
84
+ ]
85
+ );
86
+
87
+ $fieldset->addField(
88
+ 'storeview_dst',
89
+ 'select',
90
+ [
91
+ 'name' => 'storeview_dst',
92
+ 'label' => $helper->__('Target StoreView'),
93
+ 'values' => Mage::getModel('eurotext_translationmanager/source_storeViewWithLocale')->toOptionArray(),
94
+ 'class' => 'validate-storeview-different required-entry',
95
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
96
+ ]
97
+ );
98
+
99
+ $fieldset->addField(
100
+ 'customer_comment',
101
+ 'textarea',
102
+ [
103
+ 'name' => 'customer_comment',
104
+ 'label' => $helper->__('Comment'),
105
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
106
+ ]
107
+ );
108
+
109
+ $fieldset = $form->addFieldset(
110
+ 'exported_data',
111
+ [
112
+ 'legend' => $helper->__('Exported data'),
113
+ ]
114
+ );
115
+
116
+ $fieldset->addField(
117
+ 'comment',
118
+ 'note',
119
+ [
120
+ 'text' => '<b>' . $helper->__('Only data is exported, which is not translated yet.') . '</b>',
121
+ ]
122
+ );
123
+
124
+ $fieldset->addField('productmode_hidden', 'hidden', ['name' => 'productmode', 'value' => 0]);
125
+ $fieldset->addField(
126
+ 'productmode',
127
+ 'checkbox',
128
+ [
129
+ 'name' => 'productmode',
130
+ 'label' => $helper->__('Products'),
131
+ 'value' => 1,
132
+ 'checked' => $project->getProductmode(),
133
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
134
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
135
+ ]
136
+ );
137
+
138
+ $fieldset->addField('categorymode_hidden', 'hidden', ['name' => 'categorymode', 'value' => 0]);
139
+ $fieldset->addField(
140
+ 'categorymode',
141
+ 'checkbox',
142
+ [
143
+ 'name' => 'categorymode',
144
+ 'label' => $helper->__('Categories'),
145
+ 'value' => 1,
146
+ 'checked' => $project->getCategorymode(),
147
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
148
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
149
+ ]
150
+ );
151
+
152
+ $fieldset->addField('cmsmode_hidden', 'hidden', ['name' => 'cmsmode', 'value' => 0]);
153
+ $fieldset->addField(
154
+ 'cmsmode',
155
+ 'checkbox',
156
+ [
157
+ 'name' => 'cmsmode',
158
+ 'label' => $helper->__('CMS Pages and Blocks'),
159
+ 'value' => 1,
160
+ 'checked' => $project->getCmsmode(),
161
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
162
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
163
+ ]
164
+ );
165
+
166
+ $fieldset->addField('templatemode_hidden', 'hidden', ['name' => 'templatemode', 'value' => 0]);
167
+ $fieldset->addField(
168
+ 'templatemode',
169
+ 'checkbox',
170
+ [
171
+ 'name' => 'templatemode',
172
+ 'label' => $helper->__('Email Templates'),
173
+ 'value' => 1,
174
+ 'checked' => $project->getTemplatemode(),
175
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
176
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
177
+ ]
178
+ );
179
+
180
+ $fieldset->addField('langfilesmode_hidden', 'hidden', ['name' => 'langfilesmode', 'value' => 0]);
181
+ $fieldset->addField(
182
+ 'langfilesmode',
183
+ 'checkbox',
184
+ [
185
+ 'name' => 'langfilesmode',
186
+ 'label' => $helper->__('Translation files'),
187
+ 'value' => 1,
188
+ 'checked' => $project->getLangfilesmode(),
189
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
190
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
191
+ ]
192
+ );
193
+
194
+ $fieldset->addField('export_attributes_hidden', 'hidden', ['name' => 'export_attributes', 'value' => 0]);
195
+ $fieldset->addField(
196
+ 'export_attributes',
197
+ 'checkbox',
198
+ [
199
+ 'name' => 'export_attributes',
200
+ 'label' => $helper->__('Attributes and attribute options'),
201
+ 'value' => 1,
202
+ 'checked' => $project->getExportAttributes(),
203
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
204
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
205
+ ]
206
+ );
207
+
208
+ $fieldset->addField('export_urlkeys_hidden', 'hidden', ['name' => 'export_urlkeys', 'value' => 0]);
209
+ $fieldset->addField(
210
+ 'export_urlkeys',
211
+ 'checkbox',
212
+ [
213
+ 'name' => 'export_urlkeys',
214
+ 'label' => $helper->__('URL keys'),
215
+ 'value' => 1,
216
+ 'checked' => $project->getExportUrlkeys(),
217
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
218
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
219
+ ]
220
+ );
221
+
222
+ $fieldset->addField('export_seo_hidden', 'hidden', ['name' => 'export_seo', 'value' => 0]);
223
+ $fieldset->addField(
224
+ 'export_seo',
225
+ 'checkbox',
226
+ [
227
+ 'name' => 'export_seo',
228
+ 'label' => $helper->__('SEO content'),
229
+ 'value' => 1,
230
+ 'checked' => $project->getExportSeo(),
231
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
232
+ 'onclick' => 'this.value = this.checked ? 1 : 0;',
233
+ ]
234
+ );
235
+
236
+ $this->setForm($form);
237
+ $form->setValues($project->getData());
238
+
239
+ return parent::_prepareForm();
240
+ }
241
+
242
+ /**
243
+ * @return string
244
+ */
245
+ public function getTabLabel()
246
+ {
247
+ return $this->__('Project Details');
248
+ }
249
+
250
+ /**
251
+ * @return string
252
+ */
253
+ public function getTabTitle()
254
+ {
255
+ return $this->getTabLabel();
256
+ }
257
+
258
+ /**
259
+ * @return boolean
260
+ */
261
+ public function canShowTab()
262
+ {
263
+ return true;
264
+ }
265
+
266
+ /**
267
+ * @return boolean
268
+ */
269
+ public function isHidden()
270
+ {
271
+ return !$this->canShowTab();
272
+ }
273
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Main/Single.php ADDED
@@ -0,0 +1,45 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Main_Single
4
+ extends Eurotext_Uploader_Block_Single
5
+ {
6
+ const DEFAULT_UPLOAD_BUTTON_ID_SUFFIX = 'upload';
7
+
8
+ /**
9
+ * @return $this
10
+ */
11
+ protected function _prepareLayout()
12
+ {
13
+ parent::_prepareLayout();
14
+
15
+ $this->setChild(
16
+ 'upload_button',
17
+ $this->getLayout()->createBlock('adminhtml/widget_button')
18
+ ->addData(
19
+ [
20
+ 'id' => $this->getElementId(self::DEFAULT_UPLOAD_BUTTON_ID_SUFFIX),
21
+ 'label' => Mage::helper('eurotext_uploader')->__('Upload file'),
22
+ 'type' => 'button',
23
+ ]
24
+ )
25
+ );
26
+
27
+ $this->_addElementIdsMapping(
28
+ [
29
+ 'upload' => $this->_prepareElementsIds([self::DEFAULT_UPLOAD_BUTTON_ID_SUFFIX])
30
+ ]
31
+ );
32
+
33
+ return $this;
34
+ }
35
+
36
+ /**
37
+ * Get upload button html
38
+ *
39
+ * @return string
40
+ */
41
+ public function getUploadButtonHtml()
42
+ {
43
+ return $this->getChildHtml('upload_button');
44
+ }
45
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Main/Uploader.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Main_Uploader
4
+ extends Varien_Data_Form_Element_Abstract
5
+ {
6
+ /**
7
+ * @return string
8
+ */
9
+ public function getElementHtml()
10
+ {
11
+ /** @var Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Main_Single $uploader */
12
+ $uploader = Mage::app()
13
+ ->getLayout()
14
+ ->createBlock('eurotext_translationmanager/adminhtml_eurotext_project_edit_tab_main_single');
15
+
16
+ /** @var $config Eurotext_Uploader_Model_Config_Uploader */
17
+ $config = $uploader->getUploaderConfig();
18
+ $config->setTarget(Mage_Adminhtml_Helper_Data::getUrl('*/eurotext_project_import/import'));
19
+ $config->setFileParameterName('translation_file');
20
+ $config->setQuery(
21
+ [
22
+ 'form_key' => Mage::getSingleton('core/session')->getFormKey(),
23
+ 'project_id' => Mage::registry('project')->getId(),
24
+ ]
25
+ );
26
+
27
+ return $uploader->toHtml();
28
+ }
29
+
30
+
31
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products.php ADDED
@@ -0,0 +1,321 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method int[] getSelectedProducts()
5
+ * @method setSelectedProducts(int[] $ids)
6
+ * @method Mage_Catalog_Model_Resource_Product_Collection getCollection()
7
+ * @method setSelected(int[] $ids)
8
+ */
9
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Products
10
+ extends Mage_Adminhtml_Block_Catalog_Product_Grid
11
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
12
+ {
13
+ use Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer;
14
+
15
+ /**
16
+ * @var string
17
+ */
18
+ protected $_massactionBlockName = 'eurotext_translationmanager/adminhtml_eurotext_project_edit_tab_grid_massaction';
19
+
20
+ /**
21
+ * @var string
22
+ */
23
+ protected $_massactionIdField = 'products';
24
+
25
+ /**
26
+ * @return string
27
+ */
28
+ public function getMainButtonsHtml()
29
+ {
30
+ $html = $this->getChildHtml('add_bulk_skus');
31
+ $html .= parent::getMainButtonsHtml();
32
+
33
+ return $html;
34
+ }
35
+
36
+ /**
37
+ * @return int[]
38
+ */
39
+ public function _getSelectedProducts()
40
+ {
41
+ $products = $this->getSelectedProducts();
42
+ if (!is_array($products)) {
43
+ $products = $this->getSelectedProductsFromDatabase();
44
+ }
45
+
46
+ return $products;
47
+ }
48
+
49
+ /**
50
+ * @return string
51
+ */
52
+ public function getGridUrl()
53
+ {
54
+ return $this->getUrl('*/*/productsgrid', ['_current' => true]);
55
+ }
56
+
57
+ /**
58
+ * @param $row
59
+ * @return null
60
+ */
61
+ public function getRowUrl($row)
62
+ {
63
+ return null;
64
+ }
65
+
66
+ /**
67
+ * @return string
68
+ */
69
+ public function getTabLabel()
70
+ {
71
+ return $this->__('Products');
72
+ }
73
+
74
+ /**
75
+ * @return string
76
+ */
77
+ public function getTabTitle()
78
+ {
79
+ return $this->getTabLabel();
80
+ }
81
+
82
+ /**
83
+ * @return boolean
84
+ */
85
+ public function canShowTab()
86
+ {
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * @return boolean
92
+ */
93
+ public function isHidden()
94
+ {
95
+ return !$this->canShowTab();
96
+ }
97
+
98
+ /**
99
+ * @return $this
100
+ */
101
+ protected function _prepareLayout()
102
+ {
103
+ $this->setChild(
104
+ 'add_bulk_skus',
105
+ $this->getLayout()->createBlock('adminhtml/widget_button')
106
+ ->setData(
107
+ [
108
+ 'label' => Mage::helper('adminhtml')->__('Add Bulk Skus'),
109
+ 'onclick' => 'Effect.toggle(\'bulk_sku\', \'blind\')',
110
+ 'class' => 'go'
111
+ ]
112
+ )
113
+ );
114
+
115
+ /** @var Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Products $thisBlock */
116
+ $thisBlock = parent::_prepareLayout();
117
+
118
+ return $thisBlock;
119
+ }
120
+
121
+ /**
122
+ * @return $this
123
+ */
124
+ protected function _prepareColumns()
125
+ {
126
+ parent::_prepareColumns();
127
+ $this->_rssLists = [];
128
+ $this->removeColumn('action');
129
+ $this->removeColumn('websites');
130
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {
131
+ $this->removeColumn('qty');
132
+ $this->addColumn(
133
+ 'is_in_stock',
134
+ [
135
+ 'header' => $this->__('Stock Availability'),
136
+ 'width' => '50px',
137
+ 'type' => 'options',
138
+ 'index' => 'is_in_stock',
139
+ 'options' => [
140
+ Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK => $this->__('In Stock'),
141
+ Mage_CatalogInventory_Model_Stock::STOCK_OUT_OF_STOCK => $this->__('Out of Stock'),
142
+ ]
143
+ ]
144
+ );
145
+ }
146
+ $this->removeColumn('price');
147
+
148
+ return $this;
149
+ }
150
+
151
+ /**
152
+ * @return $this
153
+ */
154
+ protected function _prepareCollection()
155
+ {
156
+ $collection = $this->createCollection();
157
+
158
+ $store = $this->_getStore();
159
+ /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
160
+ $collection->addAttributeToSelect('sku')
161
+ ->addAttributeToSelect('name')
162
+ ->addAttributeToSelect('attribute_set_id')
163
+ ->addAttributeToSelect('type_id');
164
+
165
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {
166
+ $collection->joinField(
167
+ 'qty',
168
+ 'cataloginventory/stock_item',
169
+ 'qty',
170
+ 'product_id=entity_id',
171
+ '{{table}}.stock_id=1',
172
+ 'left'
173
+ );
174
+
175
+ $collection->joinField(
176
+ 'is_in_stock',
177
+ 'cataloginventory/stock_item',
178
+ 'is_in_stock',
179
+ 'product_id=entity_id',
180
+ '{{table}}.stock_id=1',
181
+ 'left'
182
+ );
183
+ }
184
+ if ($store->getId()) {
185
+ //$collection->setStoreId($store->getId());
186
+ $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
187
+ $collection->addStoreFilter($store);
188
+ $collection->joinAttribute(
189
+ 'name',
190
+ 'catalog_product/name',
191
+ 'entity_id',
192
+ null,
193
+ 'inner',
194
+ $adminStore
195
+ );
196
+ $collection->joinAttribute(
197
+ 'custom_name',
198
+ 'catalog_product/name',
199
+ 'entity_id',
200
+ null,
201
+ 'inner',
202
+ $store->getId()
203
+ );
204
+ $collection->joinAttribute(
205
+ 'status',
206
+ 'catalog_product/status',
207
+ 'entity_id',
208
+ null,
209
+ 'inner',
210
+ $store->getId()
211
+ );
212
+ $collection->joinAttribute(
213
+ 'visibility',
214
+ 'catalog_product/visibility',
215
+ 'entity_id',
216
+ null,
217
+ 'inner',
218
+ $store->getId()
219
+ );
220
+ $collection->joinAttribute(
221
+ 'price',
222
+ 'catalog_product/price',
223
+ 'entity_id',
224
+ null,
225
+ 'left',
226
+ $store->getId()
227
+ );
228
+ } else {
229
+ $collection->addAttributeToSelect('price');
230
+ $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
231
+ $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
232
+ }
233
+
234
+ $this->setCollection($collection);
235
+
236
+ Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
237
+ $this->getCollection()->addWebsiteNamesToResult();
238
+
239
+ return $this;
240
+ }
241
+
242
+ /**
243
+ * @return $this
244
+ */
245
+ protected function _prepareMassaction()
246
+ {
247
+ parent::_prepareMassaction();
248
+
249
+ $this->getMassactionBlock()->removeItem('status');
250
+ $this->getMassactionBlock()->removeItem('attributes');
251
+ $this->getMassactionBlock()->setFormFieldName('products');
252
+
253
+ return $this;
254
+ }
255
+
256
+ /**
257
+ * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
258
+ * @return $this
259
+ */
260
+ protected function _addColumnFilterToCollection($column)
261
+ {
262
+ if ($column->getId() == 'products') {
263
+ $productIds = $this->_getSelectedProducts();
264
+ if (empty($productIds)) {
265
+ $productIds = 0;
266
+ }
267
+ if ($column->getFilter()->getValue()) {
268
+ $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
269
+ } else {
270
+ if ($productIds) {
271
+ $this->getCollection()->addFieldToFilter('entity_id', ['nin' => $productIds]);
272
+ }
273
+ }
274
+
275
+ return $this;
276
+ }
277
+
278
+ parent::_addColumnFilterToCollection($column);
279
+
280
+ return $this;
281
+ }
282
+
283
+ /**
284
+ * @return int[]
285
+ */
286
+ private function getSelectedProductsFromDatabase()
287
+ {
288
+ /** @var Eurotext_TranslationManager_Model_Project $project */
289
+ $project = Mage::registry('project');
290
+
291
+ return $project->getProducts();
292
+ }
293
+
294
+ /**
295
+ * @return Mage_Catalog_Model_Resource_Product_Collection
296
+ */
297
+ private function createCollection()
298
+ {
299
+ $collection = Mage::getModel('catalog/product')->getCollection();
300
+
301
+ $category = Mage::getModel('catalog/category')->load($this->getRequest()->getParam('category_id'));
302
+ if (!$category->isObjectNew()) {
303
+ if (!$category->getIsAnchor()) {
304
+ $collection = $category->getProductCollection();
305
+
306
+ return $collection;
307
+ } else {
308
+ $categoryCollection = Mage::getResourceModel('catalog/category_collection')
309
+ ->addPathFilter("^{$category->getPath()}/[0-9]*quot;);
310
+ $categories = $categoryCollection->getAllIds();
311
+ $categories[] = $category->getId();
312
+ $collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id')
313
+ ->addAttributeToFilter('category_id', ['in' => $categories]);
314
+
315
+ return $collection;
316
+ }
317
+ }
318
+
319
+ return $collection;
320
+ }
321
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products/CategoryTree.php ADDED
@@ -0,0 +1,38 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Products_CategoryTree
4
+ extends Mage_Adminhtml_Block_Catalog_Category_Checkboxes_Tree
5
+ {
6
+ protected function _getNodeJson($node, $level = 1)
7
+ {
8
+ $item = [];
9
+ $item['text'] = $this->escapeHtml($node->getName());
10
+
11
+ if ($this->_withProductCount) {
12
+ $item['text'] .= ' (' . $node->getProductCount() . ')';
13
+ }
14
+ $item['id'] = $node->getId();
15
+ $item['path'] = $node->getData('path');
16
+ $item['cls'] = 'category-' . $node->getId() . ' folder ' . ($node->getIsActive(
17
+ ) ? 'active-category' : 'no-active-category');
18
+ $item['allowDrop'] = false;
19
+ $item['allowDrag'] = false;
20
+
21
+ if ($node->hasChildren()) {
22
+ $item['children'] = [];
23
+ foreach ($node->getChildren() as $child) {
24
+ $item['children'][] = $this->_getNodeJson($child, $level + 1);
25
+ }
26
+ }
27
+
28
+ if (empty($item['children']) && (int)$node->getChildrenCount() > 0) {
29
+ $item['children'] = [];
30
+ }
31
+
32
+ if (!empty($item['children'])) {
33
+ $item['expanded'] = true;
34
+ }
35
+
36
+ return $item;
37
+ }
38
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products/CategoryTreeAjax.php ADDED
@@ -0,0 +1,25 @@
1
+ <?php
2
+
3
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Products_CategoryTreeAjax extends
4
+ Mage_Adminhtml_Block_Catalog_Category_Widget_Chooser
5
+ {
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->_withProductCount = true;
10
+ }
11
+
12
+
13
+ protected function _getNodeJson($node, $level = 0)
14
+ {
15
+ $item = parent::_getNodeJson($node, $level);
16
+ if (in_array($node->getId(), $this->getSelectedCategories())) {
17
+ $item['checked'] = true;
18
+ }
19
+ $item['is_anchor'] = (int)$node->getIsAnchor();
20
+ $item['url_key'] = $node->getData('url_key');
21
+ $item['cls'] .= $item['cls'] . ' category-' . $node->getId();
22
+
23
+ return $item;
24
+ }
25
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/Products/Script.php ADDED
@@ -0,0 +1,53 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method int[] getSelectedProducts()
5
+ * @method setSelectedProducts(int[] $products)
6
+ */
7
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_Products_Script
8
+ extends Mage_Adminhtml_Block_Template
9
+ {
10
+ /**
11
+ * @var int[]
12
+ */
13
+ private $productWithCategories;
14
+
15
+ /**
16
+ * @var int[]
17
+ */
18
+ private $categoryWithProducts;
19
+
20
+ public function getCategoriesForProducts()
21
+ {
22
+ $this->createRelations();
23
+
24
+ return $this->productWithCategories;
25
+ }
26
+
27
+ public function getProductForCategoriesFromProducts()
28
+ {
29
+ $this->createRelations();
30
+
31
+ return $this->categoryWithProducts;
32
+ }
33
+
34
+ private function createRelations()
35
+ {
36
+ if ($this->productWithCategories !== null) {
37
+ return;
38
+ }
39
+ $products = Mage::getModel('catalog/product_api_v2')->items(
40
+ ['product_id' => ['in' => $this->getSelectedProducts()]]
41
+ );
42
+
43
+ $this->productWithCategories = [];
44
+ $this->categoryWithProducts = [];
45
+
46
+ foreach ($products as $p) {
47
+ $this->productWithCategories[$p['product_id']] = $p['category_ids'];
48
+ foreach ($p['category_ids'] as $c) {
49
+ $this->categoryWithProducts[$c][] = $p['product_id'];
50
+ }
51
+ }
52
+ }
53
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/TransactionEmailFiles.php ADDED
@@ -0,0 +1,155 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method string[] getSelectedTransactionEmailFiles()
5
+ * @method setSelectedTransactionEmailFiles(string[] $files)
6
+ * @method setUseAjax(boolean $useAjax)
7
+ */
8
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_TransactionEmailFiles
9
+ extends Mage_Adminhtml_Block_Widget_Grid
10
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
11
+ {
12
+ use Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer;
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+ $this->setId('transactionEmailFilesGrid');
18
+ $this->setSaveParametersInSession(true);
19
+ $this->setUseAjax(true);
20
+ $this->setVarNameFilter('transactionEmails_filter');
21
+ }
22
+
23
+ /**
24
+ * @return $this
25
+ */
26
+ protected function _prepareCollection()
27
+ {
28
+ $collection = Mage::getResourceModel('eurotext_translationmanager/emailtemplate_filesystem_collection');
29
+ $renderer = Mage::getModel('eurotext_translationmanager/renderer_filesystem_relativeToLocaleTemplateDirectory');
30
+ $collection->addRenderer($renderer);
31
+
32
+ /** @var Eurotext_TranslationManager_Model_Project $project */
33
+ $project = Mage::registry('project');
34
+ $collection->setLanguage($project->getStoreviewSrcLocale());
35
+ $this->setCollection($collection);
36
+
37
+ /** @var self $collection */
38
+ $collection = parent::_prepareCollection();
39
+
40
+ return $collection;
41
+ }
42
+
43
+ /**
44
+ * @return $this
45
+ */
46
+ protected function _prepareColumns()
47
+ {
48
+ /** @var Eurotext_TranslationManager_Model_Project $project */
49
+ $project = Mage::registry('project');
50
+
51
+ $this->addColumn(
52
+ 'translateFiles',
53
+ [
54
+ 'header_css_class' => 'a-center',
55
+ 'type' => 'checkbox',
56
+ 'name' => 'transactionEmails',
57
+ 'values' => $this->_getSelectedTransactionEmailFiles(),
58
+ 'align' => 'center',
59
+ 'index' => 'relativeToLocaleTemplate',
60
+ 'use_index' => true,
61
+ 'filter' => false,
62
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
63
+ ]
64
+ );
65
+
66
+ $this->addColumn(
67
+ 'relativeToLocaleTemplate',
68
+ [
69
+ 'header' => Mage::helper('cms')->__('Filename'),
70
+ 'align' => 'left',
71
+ 'index' => 'relativeToLocaleTemplate',
72
+ 'use_index' => true,
73
+ ]
74
+ );
75
+
76
+ parent::_prepareColumns();
77
+
78
+ $this->removeColumn('action');
79
+
80
+ return $this;
81
+ }
82
+
83
+ /**
84
+ * @return string[]
85
+ */
86
+ public function _getSelectedTransactionEmailFiles()
87
+ {
88
+ $translateFiles = $this->getSelectedTransactionEmailFiles();
89
+ if (!is_array($translateFiles)) {
90
+ $translateFiles = $this->getSelectedTransactionEmailFilesFromDatabase();
91
+ }
92
+
93
+ return $translateFiles;
94
+ }
95
+
96
+ /**
97
+ * @return string[]
98
+ */
99
+ private function getSelectedTransactionEmailFilesFromDatabase()
100
+ {
101
+ /** @var Eurotext_TranslationManager_Model_Project $project */
102
+ $project = Mage::registry('project');
103
+
104
+ return $project->getTransactionEmailFiles();
105
+ }
106
+
107
+ /**
108
+ * @return string
109
+ */
110
+ public function getGridUrl()
111
+ {
112
+ return $this->getUrl('*/*/transactionEmailFilesGrid', ['_current' => true]);
113
+ }
114
+
115
+ /**
116
+ * @param $row
117
+ * @return null
118
+ */
119
+ public function getRowUrl($row)
120
+ {
121
+ return null;
122
+ }
123
+
124
+ /**
125
+ * @return string
126
+ */
127
+ public function getTabLabel()
128
+ {
129
+ return $this->__('Transaction Email Files');
130
+ }
131
+
132
+ /**
133
+ * @return string
134
+ */
135
+ public function getTabTitle()
136
+ {
137
+ return $this->getTabLabel();
138
+ }
139
+
140
+ /**
141
+ * @return boolean
142
+ */
143
+ public function canShowTab()
144
+ {
145
+ return true;
146
+ }
147
+
148
+ /**
149
+ * @return boolean
150
+ */
151
+ public function isHidden()
152
+ {
153
+ return !$this->canShowTab();
154
+ }
155
+ }
app/code/community/Eurotext/TranslationManager/Block/Adminhtml/Eurotext/Project/Edit/Tab/TransactionEmailsDatabase.php ADDED
@@ -0,0 +1,78 @@
1
+ <?php
2
+
3
+ /**
4
+ * @method int[] getSelectedTransactionEmailDatabase()
5
+ * @method setSelectedTransactionEmailDatabase(int[] $ids)
6
+ * @method setUseAjax(boolean $useAjax)
7
+ */
8
+ class Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Project_Edit_Tab_TransactionEmailsDatabase
9
+ extends Mage_Adminhtml_Block_System_Email_Template_Grid
10
+ {
11
+ use Eurotext_TranslationManager_Block_Adminhtml_Eurotext_Grid_OverwriteCheckboxRenderer;
12
+
13
+ public function __construct()
14
+ {
15
+ parent::__construct();
16
+ $this->setId('transactionEmailsFromDatabaseGrid');
17
+ $this->setSaveParametersInSession(true);
18
+ $this->setUseAjax(true);
19
+ $this->setVarNameFilter('transactionEmailsFromDatabase_filter');
20
+ }
21
+
22
+ protected function _prepareColumns()
23
+ {
24
+ /** @var Eurotext_TranslationManager_Model_Project $project */
25
+ $project = Mage::registry('project');
26
+
27
+ $this->addColumn(
28
+ 'translateFiles',
29
+ [
30
+ 'header_css_class' => 'a-center',
31
+ 'type' => 'checkbox',
32
+ 'name' => 'transactionEmailsDatabase',
33
+ 'values' => $this->_getSelectedTransactionEmailsDatabase(),
34
+ 'align' => 'center',
35
+ 'index' => 'template_id',
36
+ 'use_index' => true,
37
+ 'filter' => false,
38
+ 'disabled' => !$project->isEditable() ? 'disabled="disabled"' : '',
39
+ ]
40
+ );
41
+
42
+ parent::_prepareColumns();
43
+
44
+ $this->removeColumn('action');
45
+ $this->removeColumn('modified_at');
46
+ $this->removeColumn('added_at');
47
+
48
+ return $this;
49
+