Gec_Customimport - Version 2.0.0.1

Version Notes

Major bug-fix and feature release (Tested on Magento 1.9.x)

Bug-fixes:

1. The extension is now independent of any frontend theme changes. Earlier theme changes required porting of frontend section to the new theme.

2. Added missing referential integrity for 'default' attributeset that needs to be associated with products having an empty attributesetid.

3. Fixed attribute value import for text, textarea and boolean attributes.

New Features & Improvements:

1. Default turning off visibility in search results for simple products associated to configurable ones.

2. Import of special price and related dates to enable scheduling of sale pricing.

3. Inventory control - ATP quantity and ability to control back-ordering of products.

4. Several major logging improvements.

5. Improved error-handling, data error tolerance and reporting for missing elements in the import file. Report the issue and continue with the next element instead of aborting the process.

6. Performance improvements related to categories and attributes import.

Download this release

Release Info

Developer Vince Clark
Extension Gec_Customimport
Version 2.0.0.1
Comparing to
See all releases


Code changes from version 1.0.0.1 to 2.0.0.1

Files changed (150) hide show
  1. app/code/community/Gec/Customimport/Block/Customimport.php +0 -1563
  2. app/code/community/Gec/Customimport/Helper/Catalog/Image.php +0 -141
  3. app/code/community/Gec/Customimport/Model/Customimport.php +0 -140
  4. app/code/community/Gec/Customimport/controllers/IndexController.php +0 -29
  5. app/code/{community/Gec/Customimport/Block → local/Gec/Customimport/Block/Adminhtml}/Catalogimport.php +41 -41
  6. app/code/local/Gec/Customimport/Block/Adminhtml/Customimport.php +2127 -0
  7. app/code/{community → local}/Gec/Customimport/Block/Catalog/Product/Attribute/Edit/Tab/Options.php +85 -85
  8. app/code/local/Gec/Customimport/Helper/Catalog/Image.php +221 -0
  9. app/code/local/Gec/Customimport/Helper/Data.php +89 -0
  10. app/code/{community → local}/Gec/Customimport/Model/Attrgroup.php +29 -29
  11. app/code/{community → local}/Gec/Customimport/Model/Attrsetmapping.php +29 -29
  12. app/code/{community → local}/Gec/Customimport/Model/Catalog/Resource/Eav/Mysql4/Attribute.php +105 -105
  13. app/code/{community → local}/Gec/Customimport/Model/Catalogentity.php +29 -29
  14. app/code/local/Gec/Customimport/Model/Customimport.php +181 -0
  15. app/code/{community → local}/Gec/Customimport/Model/Eavattributegroup.php +29 -29
  16. app/code/{community → local}/Gec/Customimport/Model/Eavattributeoption.php +29 -29
  17. app/code/{community → local}/Gec/Customimport/Model/Eaventityattribute.php +29 -29
  18. app/code/{community → local}/Gec/Customimport/Model/Externalcategorymappinginfo.php +29 -29
  19. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrgroup.php +28 -28
  20. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrgroup/Collection.php +26 -26
  21. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrsetmapping.php +31 -31
  22. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrsetmapping/Collection.php +26 -26
  23. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Catalogentity.php +30 -30
  24. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Catalogentity/Collection.php +26 -26
  25. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Customimport.php +27 -27
  26. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Customimport/Collection.php +26 -26
  27. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributegroup.php +28 -28
  28. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributegroup/Collection.php +26 -26
  29. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributeoption.php +30 -30
  30. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributeoption/Collection.php +26 -26
  31. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eaventityattribute.php +30 -30
  32. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eaventityattribute/Collection.php +26 -26
  33. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Externalcategorymappinginfo.php +30 -30
  34. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Externalcategorymappinginfo/Collection.php +26 -26
  35. app/code/{community → local}/Gec/Customimport/Model/Mysql4/Setup.php +21 -21
  36. app/code/{community → local}/Gec/Customimport/Model/Status.php +39 -39
  37. app/code/local/Gec/Customimport/controllers/Adminhtml/IndexController.php +15 -0
  38. app/code/local/Gec/Customimport/etc/adminhtml.xml +23 -0
  39. app/code/{community → local}/Gec/Customimport/etc/config.xml +183 -135
  40. app/code/local/Gec/Customimport/etc/system.xml +97 -0
  41. app/code/{community → local}/Gec/Customimport/sql/customimport_setup/mysql4-install-0.1.0.php +194 -192
  42. app/design/adminhtml/base/default/template/smtppro/view.phtml +27 -0
  43. app/design/adminhtml/default/default/etc/theme.xml +30 -0
  44. app/design/adminhtml/default/default/layout/admin.xml +82 -0
  45. app/design/adminhtml/default/default/layout/adminnotification.xml +38 -0
  46. app/design/adminhtml/default/default/layout/api2.xml +147 -0
  47. app/design/adminhtml/default/default/layout/authorizenet.xml +35 -0
  48. app/design/adminhtml/default/default/layout/bundle.xml +118 -0
  49. app/design/adminhtml/default/default/layout/captcha.xml +48 -0
  50. app/design/adminhtml/default/default/layout/catalog.xml +332 -0
  51. app/design/adminhtml/default/default/layout/centinel.xml +70 -0
  52. app/design/adminhtml/default/default/layout/cms.xml +95 -0
  53. app/design/adminhtml/default/default/layout/compiler.xml +35 -0
  54. app/design/adminhtml/default/default/layout/connect.xml +73 -0
  55. app/design/adminhtml/default/default/layout/currencysymbol.xml +34 -0
  56. app/design/adminhtml/default/default/layout/customer.xml +126 -0
  57. app/{code/community/Gec/Customimport/Helper/Data.php → design/adminhtml/default/default/layout/customimport.xml} +30 -23
  58. app/design/adminhtml/default/default/layout/dataflow.xml +59 -0
  59. app/design/adminhtml/default/default/layout/downloadable.xml +97 -0
  60. app/design/adminhtml/default/default/layout/giftmessage.xml +82 -0
  61. app/design/adminhtml/default/default/layout/importexport.xml +59 -0
  62. app/design/adminhtml/default/default/layout/index.xml +51 -0
  63. app/design/adminhtml/default/default/layout/main.xml +292 -0
  64. app/design/adminhtml/default/default/layout/moneybookers.xml +28 -0
  65. app/design/adminhtml/default/default/layout/newsletter.xml +67 -0
  66. app/design/adminhtml/default/default/layout/oauth.xml +194 -0
  67. app/design/adminhtml/default/default/layout/pagecache.xml +35 -0
  68. app/design/adminhtml/default/default/layout/promo.xml +101 -0
  69. app/design/adminhtml/default/default/layout/report.xml +55 -0
  70. app/design/adminhtml/default/default/layout/rss.xml +45 -0
  71. app/design/adminhtml/default/default/layout/sales.xml +1080 -0
  72. app/design/adminhtml/default/default/layout/search.xml +35 -0
  73. app/design/adminhtml/default/default/layout/tag.xml +88 -0
  74. app/design/adminhtml/default/default/layout/tax.xml +34 -0
  75. app/design/adminhtml/default/default/layout/widget.xml +69 -0
  76. app/design/adminhtml/default/default/layout/xmlconnect.xml +282 -0
  77. app/design/adminhtml/default/default/locale/en_US/translate.csv +201 -0
  78. app/design/adminhtml/default/default/template/access_denied.phtml +40 -0
  79. app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml +105 -0
  80. app/design/adminhtml/default/default/template/api/roleinfo.phtml +47 -0
  81. app/design/adminhtml/default/default/template/api/roles.phtml +37 -0
  82. app/design/adminhtml/default/default/template/api/rolesedit.phtml +143 -0
  83. app/design/adminhtml/default/default/template/api/rolesusers.phtml +28 -0
  84. app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml +85 -0
  85. app/design/adminhtml/default/default/template/api/userinfo.phtml +52 -0
  86. app/design/adminhtml/default/default/template/api/usernroles.phtml +31 -0
  87. app/design/adminhtml/default/default/template/api/userroles.phtml +45 -0
  88. app/design/adminhtml/default/default/template/api/users.phtml +40 -0
  89. app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml +53 -0
  90. app/design/adminhtml/default/default/template/api2/attribute/resource.phtml +158 -0
  91. app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml +59 -0
  92. app/design/adminhtml/default/default/template/api2/role/buttons.phtml +52 -0
  93. app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml +122 -0
  94. app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml +56 -0
  95. app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml +157 -0
  96. app/design/adminhtml/default/default/template/backup/dialogs.phtml +190 -0
  97. app/design/adminhtml/default/default/template/backup/left.phtml +27 -0
  98. app/design/adminhtml/default/default/template/backup/list.phtml +40 -0
  99. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml +95 -0
  100. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/checkbox.phtml +52 -0
  101. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/multi.phtml +49 -0
  102. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/radio.phtml +65 -0
  103. app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/select.phtml +55 -0
  104. app/design/adminhtml/default/default/template/bundle/product/edit/bundle.phtml +85 -0
  105. app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml +235 -0
  106. app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/search.phtml +35 -0
  107. app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/selection.phtml +352 -0
  108. app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml +411 -0
  109. app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml +341 -0
  110. app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml +398 -0
  111. app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml +340 -0
  112. app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml +415 -0
  113. app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml +118 -0
  114. app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml +115 -0
  115. app/design/adminhtml/default/default/template/captcha/zend.phtml +56 -0
  116. app/design/adminhtml/default/default/template/catalog/category/checkboxes/tree.phtml +199 -0
  117. app/design/adminhtml/default/default/template/catalog/category/edit.phtml +198 -0
  118. app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml +258 -0
  119. app/design/adminhtml/default/default/template/catalog/category/tree.phtml +480 -0
  120. app/design/adminhtml/default/default/template/catalog/category/widget/tree.phtml +202 -0
  121. app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml +60 -0
  122. app/design/adminhtml/default/default/template/catalog/product.phtml +47 -0
  123. app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml +338 -0
  124. app/design/adminhtml/default/default/template/catalog/product/attribute/new/created.phtml +54 -0
  125. app/design/adminhtml/default/default/template/catalog/product/attribute/options.phtml +224 -0
  126. app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml +461 -0
  127. app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml +26 -0
  128. app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml +27 -0
  129. app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml +41 -0
  130. app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml +36 -0
  131. app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml +54 -0
  132. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml +60 -0
  133. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml +95 -0
  134. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml +45 -0
  135. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml +106 -0
  136. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml +94 -0
  137. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml +31 -0
  138. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml +103 -0
  139. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml +39 -0
  140. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml +42 -0
  141. app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml +36 -0
  142. app/design/adminhtml/default/default/template/catalog/product/created.phtml +59 -0
  143. app/design/adminhtml/default/default/template/catalog/product/edit.phtml +133 -0
  144. app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml +61 -0
  145. app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml +181 -0
  146. app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml +120 -0
  147. app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml +148 -0
  148. app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml +57 -0
  149. app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml +351 -0
  150. app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml +32 -0
app/code/community/Gec/Customimport/Block/Customimport.php DELETED
@@ -1,1563 +0,0 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Block_Customimport extends Gec_Customimport_Block_Catalogimport
21
- {
22
- public function parseXml($xmlPath){
23
- $this->_store_id = Mage::app()->getWebsite()->getDefaultGroup()->getDefaultStoreId();
24
- $this->_default_category_id = Mage::app()->getStore()->getRootCategoryId();
25
- $xmlObj = new Varien_Simplexml_Config($xmlPath);
26
- $this->_xmlObj = $xmlObj;
27
- }
28
-
29
- public function showCategory(){
30
- $xmlObj = $this->_xmlObj;
31
- $xmlData = $xmlObj->getNode();
32
-
33
- if( $xmlData->categories->category instanceof Varien_Simplexml_Element)
34
- {
35
- return $xmlData->categories->category;
36
- }
37
- else{
38
- return false;
39
- }
40
- }
41
-
42
- public function countAll(){
43
- $xmlObj = $this->_xmlObj;
44
- $xmlData = $xmlObj->getNode();
45
- // $this->_category_list = $xmlData->categories->category;
46
- $this->_category_list = $xmlData->productAssociations->association;
47
- $this->lookup($this->_category_list );
48
- }
49
-
50
- public function countCategory(){
51
- $xmlObj = $this->_xmlObj;
52
- $xmlData = $xmlObj->getNode();
53
- $this->_category_list = $xmlData->categories->category;
54
- return $this->lookup($this->_category_list );
55
- }
56
-
57
- public function countProduct(){
58
- $xmlObj = $this->_xmlObj;
59
- $xmlData = $xmlObj->getNode();
60
- $this->_product_list = $xmlData->products->product;
61
- return $this->lookup($this->_product_list);
62
- }
63
-
64
- public function showProducts(){
65
- $xmlObj = $this->_xmlObj;
66
- $xmlData = $xmlObj->getNode();
67
- $this->_product_list = $xmlData->products->product;
68
- if( $this->_product_list instanceof Varien_Simplexml_Element){
69
- return $this->_product_list;
70
- }else{
71
- return false;
72
- }
73
- }
74
-
75
- public function reindexDB($val){
76
- $process = Mage::getModel('index/process')->load($val);
77
- $process->reindexAll();
78
- }
79
-
80
- public function importAllProducts($products){
81
- $item = array();
82
- foreach($products as $product){
83
- $this->_current_row++;
84
- $this->importItem($product);
85
- }
86
- $this->createLog("Successfully created products: {$this->_created_num}");
87
- $this->createLog("Successfully updated products: {$this->_updated_num}");
88
- $this->_created_num = 0;
89
- $this->_updated_num = 0;
90
- }
91
-
92
- public function importAllCategory($categories){
93
- $this->_created_num = 0;
94
- $this->_updated_num = 0;
95
- foreach($categories as $category){
96
- $this->importCategory($category);
97
- }
98
- $this->createLog("Successfully created categories: {$this->_created_num}");
99
- $this->createLog("Successfully updated categories: {$this->_updated_num}");
100
- Mage::log("Successfully created categories: {$this->_created_num} Successfully updated categories: {$this->_updated_num}",null,'mylog.log');
101
- $this->_created_num = 0;
102
- $this->_updated_num = 0;
103
- }
104
-
105
- public function parseAllCategoryRelation(){
106
- $xmlObj = $this->_xmlObj;
107
- $xmlData = $xmlObj->getNode();
108
- $this->_cat_relation = $xmlData->categoryRelations->categoryRelation;
109
-
110
- foreach($this->_cat_relation as $catRelation){
111
- $parent = (string)$catRelation->parentId;
112
- $externall = $this->checkExternalId($parent);
113
- if($externall){ //check if parent id exists.
114
- if(count($externall) == 1){
115
- reset($externall); //to take 1st key of array
116
- $first_key = key($externall);
117
- foreach($catRelation->subCategory as $sub){
118
- $this->updateCategoryRelation($sub,$first_key,$parent);
119
- }
120
- }
121
- else{
122
- foreach($externall as $systemCatid => $v){
123
- foreach($catRelation->subCategory as $sub){
124
- $this->updateCategoryRelation($sub, $systemCatid, $parent);
125
- }
126
- }
127
- }
128
- }
129
- else{
130
- echo $parent.' category not found to associate products';
131
- Mage::log('category not found: '.$parent,null,'catalogimport.log');
132
- }
133
- }
134
- }
135
-
136
- protected function duplicateCategory($categoryId, $parentId, $status){ //duplicating categoryid
137
- $default_root_category = $this->_default_category_id;
138
- $parent_id = ($parentId)?$parentId:$default_root_category;
139
- $isActive = ($status == 'Y')?1:0;
140
- $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($categoryId); //load category to duplicate
141
- $duplicate_category = Mage::getModel('catalog/category')
142
- ->setStoreId($this->_store_id);
143
- $parent_category = $this->_initCategory($parentId, $this->_store_id);
144
- if (!$parent_category->getId()) {
145
- exit;
146
- }
147
- $duplicate_category->addData(array('path'=>implode('/', $parent_category->getPathIds())));
148
- $duplicate_category->setParentId($parent_category->getId());
149
- $duplicate_category ->setAttributeSetId($duplicate_category->getDefaultAttributeSetId());
150
-
151
- $duplicate_category->setData('name', $category->getName());
152
- $duplicate_category->setData('include_in_menu', 1);
153
- $duplicate_category->setData('meta_title', $category->getmetaTitle());
154
- $duplicate_category->setData('meta_keywords', $category->getmetaKeywords());
155
- $duplicate_category->setData('meta_description', $category->getmetaDescription());
156
- $duplicate_category->setData('description', $category->getdescription());
157
- $duplicate_category->setData('available_sort_by','position');
158
- $duplicate_category->setData('default_sort_by','position');
159
- $duplicate_category->setData('is_active',$isActive);
160
- $duplicate_category->setData('external_id',$category->getexternalId());
161
- $duplicate_category->setData('external_cat_image',$category->getexternalCatImage());
162
- try {
163
- $validate = $duplicate_category->validate();
164
- if ($validate !== true) {
165
- foreach ($validate as $code => $error) {
166
- if ($error === true) {
167
- Mage::throwException(Mage::helper('catalog')->__('Attribute "%s" is required.', $code));
168
- }
169
- else {
170
- Mage::throwException($error);
171
- }
172
- }
173
- }
174
- $duplicate_category->save();
175
- return $duplicate_category->getId();
176
- }
177
- catch (Exception $e){
178
- echo $e->getMessage();
179
- }
180
- return false;
181
- }
182
-
183
- public function getTreeCategories($category_id, $p_id, $isActive, $isChild){ //$parentId, $isChild
184
- $duplicatedCategoryId = $this->duplicateCategory($category_id, $p_id, $isActive);
185
- $mapObj = Mage::getModel('customimport/customimport');
186
- $sub_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($duplicatedCategoryId);
187
- $parent_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($p_id);
188
- $ext_subid = $sub_category->getExternalId();
189
- $parent_external_id = $parent_category->getExternalId();
190
- $mapObj->updateCategoryMappingInfo($ext_subid,$duplicatedCategoryId,$parent_external_id,$p_id);
191
-
192
- $allCats = Mage::getModel('catalog/category')->getCollection()
193
- ->addAttributeToSelect('*')
194
- ->addAttributeToFilter('parent_id',array('eq' => $category_id));
195
- foreach($allCats as $category){
196
- $subcats = $category->getChildren();
197
- $isActive = 'N';
198
- $status_cat = $category->getData('is_active');
199
- if($status_cat == 1){
200
- $isActive = 'Y';
201
- }
202
- if($subcats != ''){
203
- $this->getTreeCategories($category->getId(), $duplicatedCategoryId, $isActive, true);
204
- }else{
205
- $duplicatedSubcategoryId = $this->duplicateCategory($category->getId(), $duplicatedCategoryId, $isActive); // duplicated category id is parent for current subcategory
206
- if($duplicatedSubcategoryId){
207
- $sub_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($duplicatedSubcategoryId);
208
- $parent_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($duplicatedCategoryId);
209
- $ext_subid = $sub_category->getExternalId();
210
- $parent_external_id = $parent_category->getExternalId();
211
- $mapObj->updateCategoryMappingInfo($ext_subid, $duplicatedSubcategoryId, $parent_external_id, $duplicatedCategoryId);
212
- }else{
213
- echo 'got some error while duplicating';
214
- }
215
- }
216
- }
217
- }
218
-
219
- public function updateCategoryRelation($subcat, $p_id, $parent_external_id){
220
- $ext_subid = (string)$subcat->id;
221
- $actualSubId = $this->checkExternalId($ext_subid);
222
- $mapObj = Mage::getModel('customimport/customimport');
223
-
224
- if($actualSubId){
225
- if(count($actualSubId) == 1){
226
- reset($actualSubId); //to take 1st key of array
227
- $subcat_id = key($actualSubId);
228
- $category_id = $mapObj->isSubcategoryExists($ext_subid, $p_id); // external subcat id , parent magento id
229
-
230
- if($category_id){
231
- $category = Mage::getModel('catalog/category')
232
- ->setStoreId($this->_store_id)
233
- ->load($subcat_id);
234
-
235
- $isActive = ((string)$subcat->isActive == 'Y')?1:0;
236
- $category->setData('is_active',$isActive);
237
- $category->save();
238
- }
239
- else{
240
- $category_id = $mapObj->isCategoryExists($ext_subid);
241
- if($category_id){
242
- $isActive = ((string)$subcat->isActive);
243
- $status = $this->getTreeCategories($category_id,$p_id, $isActive,false);
244
- }else{
245
- // category is not under any other parent , move
246
- $category = Mage::getModel('catalog/category')
247
- ->setStoreId($this->_store_id)
248
- ->load($subcat_id);
249
- $category->move($p_id, 0);
250
- $isActive = ((string)$subcat->isActive == 'Y')?1:0;
251
- $category->setData('is_active',$isActive);
252
- $category->save();
253
- $mapObj->updateParent($p_id,$subcat_id);
254
- $mapObj->updateCategoryMappingInfo($ext_subid,$subcat_id, $parent_external_id, $p_id);
255
- }
256
- }
257
- }
258
- else{
259
- $category_id = $mapObj->isSubcategoryExists($ext_subid, $p_id);
260
- if($category_id){
261
- // echo 'subcat present in this cat '.$ext_subid;
262
- $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($category_id);
263
- $isActive = ((string)$subcat->isActive == 'Y')?1:0;
264
- $category->setData('is_active', $isActive);
265
- $category->save();
266
- }
267
- else if($category_id = $mapObj->isCategoryExists($ext_subid)){
268
- $isActive = ((string)$subcat->isActive);
269
- $status = $this->getTreeCategories($category_id, $p_id, $isActive, false);
270
- }else{
271
- // category is not under any other parent , move
272
- echo 'block will never execute';
273
- }
274
- }
275
- }
276
- else{
277
- if(count($externall) == 0){
278
- Mage::log('subcategory id not found:'.$ext_subid, null, 'catalogimport.log');
279
- }
280
- }
281
- }
282
-
283
- public function importItem( &$item){
284
- $missingInfoRow = $this->_current_row -1;
285
- if(!isset($item->id) || trim($item->id)==''){
286
- $this->createLog('sku not found for product row # '.$missingInfoRow, "error");
287
- // Mage::log('sku not found for product record #:'.$this->_current_row, null, 'catalogimport.log');
288
- return false;
289
- }
290
- if(!isset($item->attributeSetId) || trim($item->attributeSetId)==''){
291
- $this->createLog('AttributesetId not found for product Id # '.$item->id, "error");
292
- // Mage::log('AttributesetId not found for product record #:'.$this->_current_row, null, 'catalogimport.log');
293
- return false;
294
- }
295
- if(!isset($item->type) || trim($item->type)==''){
296
- $this->createLog('Product type not found for product record # '.$item->id, "error");
297
- // Mage::log('Product type not found for product record #:'.$this->_current_row, null, 'catalogimport.log');
298
- return false;
299
- }
300
- $itemids = $this->getItemIds($item);
301
- $pid = $itemids["pid"];
302
- $asid = $itemids["asid"];
303
-
304
- if(!isset($pid))
305
- {
306
- if(!isset($asid)){
307
- $this->createLog('cannot create product sku:'.(string)$item->id.', mentioned attributeset id is not available.product row id: #'.$missingInfoRow,'error');
308
- // Mage::log('cannot create product sku:'.(string)$item->id,null,'catalogimport.log');
309
- return false;
310
- }
311
- if((string)$item->type == 'configurable'){
312
- $this->createConfigurableProduct($item, $asid); //create con product
313
- }
314
- else if((string)$item->type == 'simple'){
315
- $this->createProduct($item, $asid); //create simple product
316
- }
317
- else{
318
- $this->createLog("Import function does not support product type of record: {$item->id}");
319
- }
320
- $this->_curitemids["pid"] = $pid;
321
- $isnew = true;
322
- }
323
- else{
324
- if((string)$item->type == 'configurable'){
325
- $this->updateConfigurableProduct($item, $pid); //create con product
326
- }
327
- else if((string)$item->type == 'simple'){
328
- $this->updateProduct($item, $pid); //create simple product
329
- }
330
- }
331
- }
332
-
333
- public function updateConfigurableProduct(&$item, $pid){
334
- $p_status = ((string)$item->isActive == 'Y')?1:2;
335
- $p_taxclass = ((string)$item->isTaxable == 'Y')?2:0;
336
- $SKU = (string)$item->id;
337
- $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $SKU);
338
-
339
- if ($product){
340
- $product->setData('name', (string)$item->name);
341
- $product->setPrice((real)$item->price);
342
- $product->setWeight((real)$item->weight);
343
- $product->setStatus($p_status);
344
- $product->setTaxClassId($p_taxclass);
345
-
346
- $product->setDescription((string)$item->longDescription);
347
- $product->setShortDescription((string)$item->shortDescription);
348
- $product->setMetaTitle((string)$item->pageTitle);
349
- $product->setMetaKeyword((string)$item->metaKeywords);
350
- $product->setMetaDescription((string)$item->metaDescription);
351
- $product->setExternalImage((string)$item->originalImageUrl);
352
- $product->setExternalSmallImage((string)$item->largeImageUrl);
353
- $product->setExternalThumbnail((string)$item->smallImageUrl);
354
-
355
- $attributeValues = $item->attributeValues;
356
- $attributeOcuurance = array(); //stores no. of occurance for all attributes
357
- $configAttributeValue = array(); // will use to take value of attributes that ocuures once
358
- $i =1;
359
- foreach($attributeValues->attribute as $attr){
360
- if(array_key_exists((string)$attr->id , $attributeOcuurance)){
361
- $attributeOcuurance[(string)$attr->id] = (int)$attributeOcuurance[(string)$attr->id] + 1;
362
- }
363
- else{
364
- $attributeOcuurance[(string)$attr->id] = $i;
365
- $configAttributeValue[(string)$attr->id] = (string)$attr->valueDefId;
366
- }
367
- }
368
- $config_attribute_array = array(); //attributes with single occurance
369
- foreach($attributeOcuurance as $key=>$val){
370
- if($val == 1){
371
- $config_attribute_array[] = $key;
372
- }
373
- }
374
-
375
- foreach($config_attribute_array as $attr){
376
- $external_id = $configAttributeValue[$attr]; // valueDefId from XML for an attribute
377
- $model = Mage::getModel('catalog/resource_eav_attribute');
378
- $loadedattr = $model->loadByCode('catalog_product', $attr);
379
- $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
380
- $attr_type = $loadedattr->getFrontendInput();
381
- if($attr_type == 'select'){
382
- $mapObj = Mage::getModel('customimport/customimport');
383
- $option_id = $mapObj->isOptionExistsInAttribute($external_id, $attr_id);
384
- // $product->setData($attr, (string)$item->name);
385
- if($option_id){
386
- $product->setData($attr, $option_id);
387
- }
388
- }else{ //if attribute is textfield direct insert value
389
- $product->setData($attr, $external_id);
390
- }
391
-
392
- }
393
- try{
394
- $product->save();
395
- $stockItem = Mage::getModel('cataloginventory/stock_item');
396
- $stockItem->assignProduct($product);
397
- $stockItem->setData('stock_id', (int)1);
398
-
399
- $stockItem->setData('use_config_manage_stock', (int)1);
400
- $stockItem->setData('min_qty', (int)0);
401
- $stockItem->setData('is_decimal_divided', (int)0);
402
-
403
- $stockItem->setData('qty', (int)0);
404
- $stockItem->setData('use_config_min_qty', 1);
405
- $stockItem->setData('use_config_backorders', 1);
406
- $stockItem->setData('min_sale_qty', 1);
407
- $stockItem->setData('use_config_min_sale_qty', 1);
408
- $stockItem->setData('use_config_max_sale_qty', 1);
409
- $stockItem->setData('is_in_stock', 1);
410
- $stockItem->setData('use_config_notify_stock_qty', 1);
411
- $stockItem->setData('manage_stock', 0);
412
- $stockItem->save();
413
- $stockStatus = Mage::getModel('cataloginventory/stock_status');
414
- $stockStatus->assignProduct($product);
415
- $stockStatus->saveProductStatus($product->getId(), 1);
416
- // echo "updated\n";
417
- }
418
- catch (Exception $e){
419
- echo " not added\n";
420
- echo "exception:$e";
421
- }
422
- $this->_updated_num++;
423
- unset($product);
424
- return $productId;
425
- }else{
426
- return false;
427
- }
428
- }
429
-
430
- public function createConfigurableProduct(&$item, $asid){
431
- $p_status = ((string)$item->isActive == 'Y')?1:2;
432
- $p_taxclass = ((string)$item->isTaxable == 'Y')?2:0;
433
-
434
- $product = new Mage_Catalog_Model_Product();
435
- $product->setTypeId('configurable');
436
- $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
437
-
438
- $product->setSku((string)$item->id); //Product custom id
439
- $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
440
- $product->setStoreIDs(array($this->_store_id)); // Default store id .
441
-
442
- $product->setAttributeSetId($asid);
443
- $product->setData('name', (string)$item->name);
444
- $product->setPrice((real)$item->price);
445
- $product->setWeight((real)$item->weight);
446
- $product->setStatus($p_status);
447
- $product->setTaxClassId($p_taxclass);
448
-
449
- $product->setDescription((string)$item->longDescription);
450
- $product->setShortDescription((string)$item->shortDescription);
451
- $product->setMetaTitle((string)$item->pageTitle);
452
- $product->setMetaKeyword((string)$item->metaKeywords);
453
- $product->setMetaDescription((string)$item->metaDescription);
454
- $product->setExternalImage((string)$item->originalImageUrl);
455
- $product->setExternalSmallImage((string)$item->largeImageUrl);
456
- $product->setExternalThumbnail((string)$item->smallImageUrl);
457
-
458
- $attributeValues = $item->attributeValues;
459
- $attributeOcuurance = array(); //stores no. of occurance for all attributes
460
- $configAttributeValue = array(); // will use to take value of attributes that ocuures once
461
- $i =1;
462
-
463
- foreach($attributeValues->attribute as $attr){
464
- if(array_key_exists((string)$attr->id, $attributeOcuurance)){
465
- $attributeOcuurance[(string)$attr->id] = (int)$attributeOcuurance[(string)$attr->id] + 1;
466
- }
467
- else{
468
- $attributeOcuurance[(string)$attr->id] = $i;
469
- $configAttributeValue[(string)$attr->id] = (string)$attr->valueDefId;
470
- }
471
- }
472
- $superattribute_array = array(); // attributes with multiple occurances
473
- $config_attribute_array = array(); //attributes with single occurance
474
- foreach($attributeOcuurance as $key => $val){
475
- if($val > 1){
476
- $superattribute_array[] = $key;
477
- }
478
- else{
479
- $config_attribute_array[] = $key;
480
- }
481
- }
482
- $attributes_array = array();
483
- if(count($superattribute_array) > 0){
484
- $super_attribute_created = $this->makeAttributeConfigurable($superattribute_array);
485
- if($super_attribute_created){
486
- foreach($superattribute_array as $attr){
487
- $attributes_array[] = $attr; // contains attribute codes
488
- }
489
- $ProductAttributeIds = array(); // array stores only super attribute id's
490
- $attribute_detail = array(); // stores super attribute's detail
491
- $attrnum = 0;
492
- foreach($attributes_array as $attribute_code){
493
- $model = Mage::getModel('catalog/resource_eav_attribute');
494
- $attr = $model->loadByCode('catalog_product', $attribute_code);
495
- $attr_id = $attr->getAttributeId();
496
- $ProductAttributeIds[] = $attr_id;
497
- $attribute_label = $attr->getFrontendLabel();
498
- $attr_detail = array('id'=>NULL, 'label' => "$attribute_label", 'position' => NULL, 'attribute_id' => $attr_id, 'attribute_code' => "$attribute_code", 'frontend_label' => "$attribute_label",
499
- 'html_id' => "config_super_product__attribute_$attrnum");
500
- $attribute_detail[] = $attr_detail;
501
- $attrnum++;
502
- }
503
- $product->getTypeInstance()->setUsedProductAttributeIds($ProductAttributeIds);
504
- $product->setConfigurableAttributesData($attribute_detail);
505
- $product->setCanSaveConfigurableAttributes(1);
506
-
507
- foreach($config_attribute_array as $attr){
508
- $external_id = $configAttributeValue[$attr]; // valueDefId from XML for an attribute
509
- $model = Mage::getModel('catalog/resource_eav_attribute');
510
- $loadedattr = $model->loadByCode('catalog_product', $attr);
511
- $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
512
- $attr_type = $loadedattr->getFrontendInput();
513
- if($attr_type == 'select'){
514
- $mapObj = Mage::getModel('customimport/customimport');
515
- $option_id = $mapObj->isOptionExistsInAttribute($external_id, $attr_id);
516
- if($option_id){
517
- $product->setData($attr, $option_id);
518
- }
519
- }else{ //if attribute is textfield direct insert value
520
- $product->setData($attr, $external_id);
521
- }
522
-
523
- }
524
- try{
525
- $product->save();
526
- $stockItem = Mage::getModel('cataloginventory/stock_item');
527
- $stockItem->assignProduct($product);
528
- $stockItem->setData('stock_id', (int)1);
529
-
530
- $stockItem->setData('use_config_manage_stock', (int)1);
531
- $stockItem->setData('min_qty', (int)0);
532
- $stockItem->setData('is_decimal_divided', (int)0);
533
-
534
- $stockItem->setData('qty', (int)0);
535
- $stockItem->setData('use_config_min_qty', 1);
536
- $stockItem->setData('use_config_backorders', 1);
537
- $stockItem->setData('min_sale_qty', 1);
538
- $stockItem->setData('use_config_min_sale_qty', 1);
539
- $stockItem->setData('use_config_max_sale_qty', 1);
540
- $stockItem->setData('is_in_stock', 1);
541
- $stockItem->setData('use_config_notify_stock_qty', 1);
542
- $stockItem->setData('manage_stock', 0);
543
- $stockItem->save();
544
- $stockStatus = Mage::getModel('cataloginventory/stock_status');
545
- $stockStatus->assignProduct($product);
546
- $stockStatus->saveProductStatus($product->getId(), 1);
547
- }
548
- catch (Exception $e){
549
- echo "exception:$e";
550
- }
551
- }else{
552
- echo 'Could not get super attribute for product. Hence skipped product' .(string)$item->id ;
553
- }
554
- }else{
555
- echo 'Super attribute is missing. Hence skipped product' .(string)$item->id ;
556
- }
557
- }
558
-
559
- public function createProduct(&$item, $asid){
560
- $p_status = ((string)$item->isActive == 'Y')?1:2;
561
- $p_taxclass = ((string)$item->isTaxable == 'Y')?2:0;
562
-
563
- $product = new Mage_Catalog_Model_Product();
564
- $product->setTypeId('simple');
565
- $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
566
-
567
- $product->setSku((string)$item->id); //Product custom id
568
- $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId())); //Default website (main website) ?? To Do : make it dynamic
569
- $product->setStoreIDs(array($this->_store_id)); // Default store id .
570
- $product->setStockData(array( // Getting no info for quantity, hence statically using 100 for now
571
- 'is_in_stock' => 1,
572
- 'qty' => 100,
573
- 'manage_stock' => 1));
574
- $product->setAttributeSetId($asid);
575
- $product->setData('name', (string)$item->name);
576
- $product->setPrice((real)$item->price);
577
- $product->setWeight((real)$item->weight);
578
- $product->setStatus($p_status);
579
- $product->setTaxClassId($p_taxclass);
580
-
581
- $product->setDescription((string)$item->longDescription);
582
- $product->setShortDescription((string)$item->shortDescription);
583
- $product->setMetaTitle((string)$item->pageTitle);
584
- $product->setMetaKeyword((string)$item->metaKeywords);
585
- $product->setMetaDescription((string)$item->metaDescription);
586
- $product->setExternalImage((string)$item->originalImageUrl);
587
- $product->setExternalSmallImage((string)$item->largeImageUrl);
588
- $product->setExternalThumbnail((string)$item->smallImageUrl);
589
-
590
- $attributeValues = $item->attributeValues;
591
- $attributeOcuurance = array(); //stores no. of occurance for all attributes
592
- $configAttributeValue = array(); // will use to take value of attributes that ocuures once
593
- $multiple_values = array(); // stores an array of available values
594
- $i =1;
595
- foreach($attributeValues->attribute as $attr){
596
- if(array_key_exists((string)$attr->id ,$attributeOcuurance)){
597
- $multiple_values[(string)$attr->id][] = (string)$attr->valueDefId;
598
- $attributeOcuurance[(string)$attr->id] = (int)$attributeOcuurance[(string)$attr->id] + 1;
599
- }
600
- else{
601
- $multiple_values[(string)$attr->id][] = (string)$attr->valueDefId;
602
- $attributeOcuurance[(string)$attr->id] = $i;
603
- }
604
- }
605
- $skipStatus = 0;
606
- foreach($multiple_values as $attribute_code=>$attribute_values){
607
- $model = Mage::getModel('catalog/resource_eav_attribute');
608
- $loadedattr = $model->loadByCode('catalog_product', $attribute_code);
609
- $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
610
- if(!$attr_id){
611
- // echo 'attribute '.$attribute_code . 'is not available in magento database.';
612
- $this->createLog("Skipped product {$item->id}, attribute is not available in magento database.: {$attribute_code}");
613
- $skipStatus = 1;
614
- break;
615
- }
616
- else{
617
- $attr_type = $loadedattr->getFrontendInput();
618
- if($attr_type =='select' && count($attribute_values) == 1){
619
- $mapObj = Mage::getModel('customimport/customimport');
620
- $option_id = $mapObj->isOptionExistsInAttribute($attribute_values[0], $attr_id);
621
- if($option_id){
622
- $product->setData($attribute_code, $option_id);
623
- }
624
- }
625
- if($attr_type =='select' && count($attribute_values)>1){
626
- //multiple values for attribute which is not multiselect
627
- // echo 'Attribute '. $attribute_code. 'can not have multiple values. Hence skipping product having id' . (string)$item->id;
628
- $skipStatus = 1;
629
- break;
630
- }
631
- if($attr_type =='multiselect'){
632
- $multivalues = array();
633
- foreach($attribute_values as $value){
634
- $mapObj = Mage::getModel('customimport/customimport');
635
- $option_id = $mapObj->isOptionExistsInAttribute($value, $attr_id);
636
- if($option_id){
637
- $multivalues[] = $option_id;
638
- }
639
- }
640
- $product->addData( array($attribute_code => $multivalues) );
641
- }
642
- if($attr_type =='text' || $attr_type =='textarea'){ // if type is text/textarea
643
- $product->setData($attribute_code, $attribute_values[0]);
644
- }
645
- }
646
- }
647
- try{
648
- if($skipStatus == 0){
649
- $productId = $product->save()->getId();
650
- if ($productId) {
651
- $this->_created_num++;
652
- unset($product);
653
- unset($multiple_values);
654
- unset($attributeOcuurance);
655
- return $productId;
656
- }
657
- else{
658
- echo 'Skipped product due to improper attribute values :'.(string)$item->id;
659
- // Mage::log('Skipped product due to improper attribute values :'.(string)$item->id,null,'catalogimport.log');
660
- }
661
- }else{
662
- echo 'Skipped product due to some error while save :'.(string)$item->id;
663
- // Mage::log('Skipped product due to some error while save :'.(string)$item->id,null,'catalogimport.log');
664
- }
665
- }
666
- catch(Mage_Eav_Model_Entity_Attribute_Exception $e){
667
- echo $e->getAttributeCode();
668
- echo $e->getMessage();
669
- }
670
- }
671
-
672
- public function updateProduct(&$item, $pid){
673
- $p_status = ((string)$item->isActive == 'Y')?1:2;
674
- $p_taxclass = ((string)$item->isTaxable == 'Y')?2:0;
675
- $SKU = (string)$item->id;
676
- $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $SKU);
677
-
678
- if ($product){
679
- //Product found, so we need to update it in Magento.
680
- $product->setData('name', (string)$item->name);
681
- $product->setPrice((real)$item->price);
682
- $product->setWeight((real)$item->weight);
683
- $product->setStatus($p_status);
684
- $product->setTaxClassId($p_taxclass);
685
-
686
- $product->setDescription((string)$item->longDescription);
687
- $product->setShortDescription((string)$item->shortDescription);
688
- $product->setMetaTitle((string)$item->pageTitle);
689
- $product->setMetaKeyword((string)$item->metaKeywords);
690
- $product->setMetaDescription((string)$item->metaDescription);
691
- $product->setExternalImage((string)$item->originalImageUrl);
692
- $product->setExternalSmallImage((string)$item->largeImageUrl);
693
- $product->setExternalThumbnail((string)$item->smallImageUrl);
694
-
695
- $attributeValues = $item->attributeValues;
696
- $attributeOcuurance = array(); //stores no. of occurance for all attributes
697
- $configAttributeValue = array(); // will use to take value of attributes that ocuures once
698
- $multiple_values = array();
699
- $i =1;
700
- foreach($attributeValues->attribute as $attr){
701
- if(array_key_exists((string)$attr->id ,$attributeOcuurance)){
702
- $multiple_values[(string)$attr->id][] = (string)$attr->valueDefId;
703
- $attributeOcuurance[(string)$attr->id] = (int)$attributeOcuurance[(string)$attr->id] + 1;
704
- }
705
- else{
706
- $multiple_values[(string)$attr->id][] = (string)$attr->valueDefId;
707
- $attributeOcuurance[(string)$attr->id] = $i;
708
- // $configAttributeValue[(string)$attr->id] = (string)$attr->valueDefId;
709
- }
710
- }
711
- $skipStatus = 0;
712
- foreach($multiple_values as $attribute_code => $attribute_values){
713
- $model = Mage::getModel('catalog/resource_eav_attribute');
714
- $loadedattr = $model->loadByCode('catalog_product', $attribute_code);
715
- $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
716
- if(!$attr_id){
717
- echo 'attribute '.$attribute_code . 'is not available in magento database.Hence skipping product having id' . (string)$item->id;
718
- }
719
- else{
720
- $attr_type = $loadedattr->getFrontendInput();
721
- if($attr_type =='select' && count($attribute_values) == 1){
722
- $mapObj = Mage::getModel('customimport/customimport');
723
- $option_id = $mapObj->isOptionExistsInAttribute($attribute_values[0], $attr_id);
724
- if($option_id){
725
- $product->setData($attribute_code, $option_id);
726
- }
727
- }
728
- if($attr_type =='select' && count($attribute_values)>1){
729
- //multiple values for attribute which is not multiselect
730
- echo 'Attribute '. $attribute_code. 'can not have multiple values. Hence skipping product having id' . (string)$item->id;
731
- $skipStatus = 1;
732
- break;
733
- }
734
- if($attr_type =='multiselect'){
735
- $multivalues = array();
736
- foreach($attribute_values as $value){
737
- $mapObj = Mage::getModel('customimport/customimport');
738
- $option_id = $mapObj->isOptionExistsInAttribute($value, $attr_id);
739
- if($option_id){
740
- $multivalues[] = $option_id;
741
- }
742
- }
743
- $product->addData( array($attribute_code => $multivalues) );
744
- }
745
- if($attr_type =='text' || $attr_type =='textarea'){ // if type is text/textarea
746
- $product->setData($attribute_code, $attribute_values[0]);
747
- }
748
- }
749
- }
750
- if($skipStatus == 0){
751
- $productId = $product->save()->getId();
752
- $this->_updated_num++;
753
- // $productId = $product->getId();
754
- $stockItem =Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
755
- $stockItemId = $stockItem->getId();
756
- $stockItem->setData('manage_stock', 1);
757
- $stockItem->setData('qty', 100);
758
- $stockItem->save();
759
- unset($product);
760
- return $productId;
761
- }else{
762
- // echo 'Skipped product due to improper attribute values :'.(string)$item->id;
763
- // Mage::log('Skipped product due to improper attribute values :'.(string)$item->id,null,'catalogimport.log');
764
- }
765
-
766
- }else{
767
- echo 'Skipped product due to some error while save :'.(string)$item->id;
768
- // Mage::log('Skipped product due to some error while save :'.(string)$item->id,null,'catalogimport.log');
769
- }
770
- }
771
-
772
- public function getAttributeSetId($attrSetName){
773
- $attributeSetId = Mage::getModel('eav/entity_attribute_set')
774
- ->getCollection()
775
- ->setEntityTypeFilter(4) // 4is entity type id...4= product
776
- ->addFieldToFilter('attribute_set_name', $attrSetName)
777
- ->getFirstItem()
778
- ->getAttributeSetId();
779
-
780
- return $attributeSetId;
781
- }
782
-
783
- public function getItemIds($item){
784
- $external_set_id = (string)$item->attributeSetId;
785
- $mapObj = Mage::getModel('customimport/customimport');
786
- $magento_set_id = $mapObj->getAttributeSetIdByExternalId($external_set_id);
787
-
788
- $sku=(string)$item->id;
789
- if($sku!= $this->_curitemids["sku"]){
790
- //try to find item ids in db
791
- $cids = $this->getProductIds($sku);
792
- if($cids!==false){
793
- //if found use it
794
- $this->_curitemids=$cids;
795
- }else{
796
- //only sku & attribute set id from datasource otherwise.
797
- // $this->_curitemids=array("pid"=>null,"sku"=>$sku,"asid"=>isset($magento_set_id)?$magento_set_id:$this->getAttributeSetId('Default'));
798
- $this->_curitemids=array("pid"=>null,"sku"=>$sku,"asid"=>isset($magento_set_id)?$magento_set_id:null);
799
- }
800
- //do not reset values for existing if non admin
801
- $this->onNewSku($sku,($cids!==false));
802
- unset($cids);
803
- }else{
804
- $this->onSameSku($sku);
805
- }
806
- return $this->_curitemids;
807
- }
808
-
809
-
810
- public function getProductIds($sku){
811
- $toReturn = array();
812
- $product1 = Mage::getModel('catalog/product');
813
- $productCollection = $product1->getCollection()
814
- ->addAttributeToSelect('sku','entity_id','attribute_set_id')
815
- ->addAttributeToFilter('sku', $sku)
816
- ->load();
817
- if(count($productCollection)>0){
818
- foreach($productCollection as $product){
819
- $productArr = $product->getData();
820
- $toReturn['pid'] = $productArr['entity_id'];
821
- $toReturn['asid'] = $productArr['attribute_set_id'];
822
- return $toReturn;
823
- }
824
- }else{
825
- return false;
826
- }
827
- }
828
-
829
- public function clearOptCache(){
830
- unset($this->_optidcache);
831
- $this->_optidcache=array();
832
- }
833
-
834
- public function onNewSku($sku,$existing){
835
- $this->clearOptCache();
836
- //only assign values to store 0 by default in create mode for new sku
837
- //for store related options
838
- if(!$existing)
839
- {
840
- $this->_dstore=array(0);
841
- }
842
- else
843
- {
844
- $this->_dstore=array();
845
- }
846
- $this->_same=false;
847
- }
848
-
849
- public function onSameSku($sku){
850
- unset($this->_dstore);
851
- $this->_dstore=array();
852
- $this->_same=true;
853
- }
854
-
855
- public function createLog($msg){
856
- $this->_log_array[] = $msg;
857
- }
858
-
859
-
860
- public function lookup($listType){
861
- $t0=microtime(true);
862
- // echo "Performing Datasouce Lookup...startup";
863
- $count = count($listType);
864
- $this->_item_num = $count;
865
- $t1 = microtime(true);
866
- $time = $t1-$t0;
867
- $this->createLog("Found $count records","startup");
868
- // echo '<br /> memory:'. $mem;
869
- }
870
-
871
- /*
872
- * create category
873
- * */
874
- protected function createCategory($item){
875
- $default_root_category = $this->_default_category_id;
876
- $parent_id = ((string)$item->isRoot == 'Y')?1:$default_root_category;
877
- $isActive = ((string)$item->isActive == 'Y')?1:0;
878
-
879
- $category = Mage::getModel('catalog/category')
880
- ->setStoreId($this->_store_id);
881
- $parent_category = $this->_initCategory($parent_id, $this->_store_id);
882
- if (!$parent_category->getId()) {
883
- exit;
884
- }
885
- $category->addData(array('path'=>implode('/',$parent_category->getPathIds())));
886
- /* @var $validator Mage_Catalog_Model_Api2_Product_Validator_Product */
887
- $category->setParentId($parent_category->getId());
888
- $category ->setAttributeSetId($category->getDefaultAttributeSetId());
889
- $category->setData('name',(string)$item->name);
890
- $category->setData('include_in_menu',1);
891
- $category->setData('meta_title',(string)$item->pageTitle);
892
- $category->setData('meta_keywords',(string)$item->metaKeywords);
893
- $category->setData('meta_description',(string)$item->metaDescription);
894
- $category->setData('description',(string)$item->description);
895
-
896
-
897
- $category->setData('available_sort_by','position');
898
- $category->setData('default_sort_by','position');
899
- $category->setData('is_active',$isActive);
900
- $category->setData('external_id',(string)$item->id);
901
- $category->setData('external_cat_image',(string)$item->imageUrl);
902
- try {
903
- $validate = $category->validate();
904
- if ($validate !== true) {
905
- foreach ($validate as $code => $error) {
906
- if ($error === true) {
907
- Mage::throwException(Mage::helper('catalog')->__('Attribute "%s" is required.', $code));
908
- }
909
- else {
910
- Mage::throwException($error);
911
- }
912
- }
913
- }
914
- $category->save();
915
- }
916
- catch (Exception $e){
917
- echo $e->getMessage();
918
- }
919
- }
920
-
921
- protected function updateCategory($item,$categoryId){
922
- $category = Mage::getModel('catalog/category')->load($categoryId);
923
- $isActive = ((string)$item->isActive == 'Y')?1:0;
924
- $category->setData('name',(string)$item->name);
925
- $category->setData('include_in_menu',1);
926
- $category->setData('meta_title',(string)$item->pageTitle);
927
- $category->setData('meta_keywords',(string)$item->metaKeywords);
928
- $category->setData('meta_description',(string)$item->metaDescription);
929
- $category->setData('description',(string)$item->description);
930
- $category->setData('is_active',$isActive);
931
- $category->setData('external_cat_image',(string)$item->imageUrl);
932
- $category->save();
933
- }
934
-
935
- /**
936
- * main function to import category
937
- */
938
- protected function importCategory($item){
939
- $externalId = (string)$item->id;
940
- $externall = $this->checkExternalId($externalId);
941
-
942
- if($externall){
943
- if(count($externall) == 1){
944
- //update already existing category with this id
945
- reset($externall); //to take 1st key of array
946
- $first_key = key($externall);
947
- $this->updateCategory($item,$first_key);
948
- $this->_updated_num++;
949
- }
950
- else{
951
- foreach($externall as $systemCatid=>$v){
952
- $this->updateCategory($item,$systemCatid);
953
- }
954
- }
955
- }else{
956
- if(count($externall) == 0){ // category is not available hence create new
957
- $this->createCategory($item);
958
- $this->_created_num++;
959
- }
960
- }
961
- }
962
-
963
- /**
964
- * checks for a category existance using external id
965
- * @param external id of category
966
- */
967
-
968
- protected function checkExternalId($externalId){
969
- $catsWithCustomAttr = array();
970
- $collection = Mage::getModel('catalog/category')->getCollection();
971
- $collection->addAttributeToSelect("external_id");
972
- //Do a left join, and get values that aren't null - you could add other conditions in the second parameter also (check out all options in the _getConditionSql method of lib/Varien/Data/Collection/Db.php
973
- $collection->addAttributeToFilter('external_id', $externalId, 'left');
974
- foreach($collection as $category){
975
- $catsWithCustomAttr[$category->getId()] = $category->getExternalId(); //Or you could say $category->getData('your_custom_category_attribute')
976
- }
977
-
978
- return $catsWithCustomAttr;
979
- }
980
-
981
- /**
982
- * loads a category, if exists
983
- * @param category id
984
- */
985
-
986
- protected function _initCategory($categoryId, $store = null){
987
- try{
988
- $category = Mage::getModel('catalog/category')
989
- ->setStoreId($store)
990
- ->load($categoryId);
991
- if (!$category->getId()) {
992
- Mage::throwException(Mage::helper('catalog')->__('Parent category "%s" is not available.', $categoryId));
993
- }
994
- }
995
- catch (Exception $e){
996
- echo $e->getMessage();
997
- }
998
- return $category;
999
- }
1000
-
1001
-
1002
- public function getCurrentRow(){
1003
- return $this->_current_row;
1004
- }
1005
-
1006
- public function setCurrentRow($cnum){
1007
- $this->_current_row=$cnum;
1008
- }
1009
-
1010
- /**
1011
- * parses <categoryProducts> block , and returns <categoryProducts><categoryProduct> block
1012
- */
1013
- public function associatedProductsCategory(){
1014
- $xmlObj = $this->_xmlObj;
1015
- $xmlData = $xmlObj->getNode();
1016
-
1017
- if( $xmlData->categoryProducts->categoryProduct instanceof Varien_Simplexml_Element){
1018
- return $xmlData->categoryProducts->categoryProduct;
1019
- }else{
1020
- return 'no data ';
1021
- }
1022
- }
1023
-
1024
- /*
1025
- * associates a product with a category
1026
- * */
1027
-
1028
- public function associateProductToCategory( $productDetail,$catId){ //actual id of category
1029
- $cat_api = new Mage_Catalog_Model_Category_Api;
1030
- $newProduct = Mage::getModel('catalog/product')->loadByAttribute('sku',(string)$productDetail->id);
1031
- if($newProduct){
1032
- $category = Mage::getModel('catalog/category')
1033
- ->setStoreId($this->_store_id)
1034
- ->load($catId);
1035
- $positions = $category->getProductsPosition();
1036
- $productDetail->position;
1037
- if( (string)$productDetail->isActive == 'Y'){
1038
- // assignproduct is default function of magento, to assign product in a category
1039
- $cat_api->assignProduct($catId, $newProduct->getId(),(real)$productDetail->position);
1040
- }else{
1041
- if(isset($positions[$newProduct->getId()])){
1042
- // removeProduct is default function of magento, to remove product from a category
1043
- $cat_api->removeProduct($catId, $newProduct->getId());
1044
- }else{
1045
- //echo 'does not';
1046
- }
1047
- }
1048
- }else{
1049
- echo (string)$productDetail->id.' product does not exists';
1050
- Mage::log('product does not exists :'.(string)$productDetail->id,null,'catalogimport.log');
1051
- }
1052
- }
1053
-
1054
- public function associateProducts($association){
1055
- foreach($association as $associate){
1056
- $parent = (string)$associate->categoryId;
1057
- $externall = $this->checkExternalId($parent);
1058
- if($externall){
1059
- if(count($externall) == 1){
1060
- reset($externall);
1061
- $first_key = key($externall);
1062
- foreach($associate->product as $product){
1063
- $this->associateProductToCategory($product,$first_key);
1064
- }
1065
- }
1066
- else{
1067
- foreach($externall as $systemCatid=>$v){
1068
- foreach($associate->product as $product){
1069
- $this->associateProductToCategory($product,$systemCatid);
1070
- }
1071
- }
1072
- }
1073
- }
1074
- else{
1075
- if(count($externall) == 0){
1076
- $this->createLog('category id not found: # '.$parent, "error");
1077
- Mage::log('category id not found: '.$parent,null,'catalogimport.log');
1078
- }
1079
- }
1080
- }
1081
- }
1082
- public function associatePdtPdt($association){
1083
- foreach($association as $associate){
1084
- $mainProduct = Mage::getModel('catalog/product')->loadByAttribute('sku',(string)$associate->productIdFrom);
1085
- if ($mainProduct) {
1086
- $productId = $mainProduct->getId();
1087
- $relatedArray=array();
1088
- $upsellArray=array();
1089
- $crossArray=array();
1090
- $associatedArray = array();
1091
- foreach($associate->associatedProduct as $association){
1092
- if( $association instanceof Varien_Simplexml_Element){ // if associatedProduct is an object in form of <associatedProduct>
1093
- unset($prid);
1094
- $prid = Mage::getModel('catalog/product')->getIdBySku((string)$association->id); // get id of associated product
1095
- if($prid && (string)$association->isActive == 'Y') {
1096
- $position = (string)$association->position ? (string)$association->position : 0;
1097
- if((string)$association->assocType == 0){
1098
- $crossArray[$prid]=array('position'=>$position);
1099
- }
1100
- else if((string)$association->assocType == 1){
1101
- $upsellArray[$prid]=array('position'=>$position);
1102
- }
1103
- else if((string)$association->assocType == 2){
1104
- $relatedArray[$prid]=array('position'=>$position);
1105
- }else if((string)$association->assocType == 3){
1106
- $associatedArray[] = $prid;
1107
- }
1108
- }
1109
- }
1110
- }
1111
- $mainProduct->setCrossSellLinkData($crossArray);
1112
- $mainProduct->setUpSellLinkData($upsellArray);
1113
- $mainProduct->setRelatedLinkData($relatedArray);
1114
- $mainProduct->save();
1115
-
1116
- if(count($associatedArray) > 0){
1117
- Mage::getResourceModel('catalog/product_type_configurable')
1118
- ->saveProducts( $mainProduct, $associatedArray );
1119
- }
1120
- unset($crossArray);
1121
- unset($upsellArray);
1122
- unset($relatedArray);
1123
- unset($associatedArray);
1124
- }else{
1125
- $this->createLog('product not found for association: # '.$associate->productIdFrom, "error");
1126
- Mage::log('product not found for association: # '.$associate->productIdFrom,null,'catalogimport.log');
1127
- }
1128
- }
1129
- }
1130
-
1131
- public function associatedProductsProducts(){
1132
- $xmlObj = $this->_xmlObj;
1133
- $xmlData = $xmlObj->getNode();
1134
- if( $xmlData->productAssociations->association instanceof Varien_Simplexml_Element){
1135
- return $xmlData->productAssociations->association;
1136
- }else{
1137
- Mage::log('Associatation block is empty',null,'catalogimport.log');
1138
- $this->createLog('Associatation block is empty: # ');
1139
- }
1140
- }
1141
-
1142
- public function makeAttributeConfigurable($superattribute_array){
1143
- $result = false;
1144
- $model = Mage::getModel('catalog/resource_eav_attribute');
1145
-
1146
- foreach($superattribute_array as $attribute_id){
1147
- $attr = $model->loadByCode('catalog_product',$attribute_id);
1148
- $attr_id = $attr->getAttributeId();
1149
- if($attr_id){
1150
- if($attr_configurable = $attr->getIsConfigurable()){
1151
- $result = true;
1152
- }else{
1153
- $attribute_type = $attr->getFrontendInput();
1154
- $_attribute_data = array();
1155
- if($attribute_type == 'select'){
1156
- $_attribute_data['is_configurable'] = 1;
1157
- $model->addData($_attribute_data);
1158
- $attr->save();
1159
- $result = true;
1160
- }else{
1161
- echo 'attribute '.$attribute_id. ' can not be updated to become superattribute';
1162
-
1163
- $result = false;
1164
- }
1165
- }
1166
- }else{
1167
- echo 'attribute '.$attribute_id.' does not exists';
1168
- $result = false;
1169
- }
1170
- }
1171
-
1172
- return $result;
1173
- }
1174
-
1175
- public function createAttribute($attribute){
1176
- $mapobj = Mage::getModel('customimport/customimport');
1177
- $attr_values = (array)$attribute->values;
1178
-
1179
- $attribute_type = 'select';
1180
- if(isset($attribute->type)){
1181
- $att_type = (string)$attribute->type;
1182
- $magento_array_values = array('text','textarea','date','boolean','multiselect','select','price','media_image','weee');
1183
- if (in_array($att_type, $magento_array_values)) {
1184
- $attribute_type = $att_type;
1185
- }
1186
- }
1187
- $count_value = count($attr_values['valueDef']);
1188
- $_attribute_data = array(
1189
- 'attribute_code' => (string)$attribute->id,
1190
- 'is_global' => '1',
1191
- 'frontend_input' => $attribute_type, //'text/select',
1192
- 'default_value_text' => '',
1193
- 'default_value_yesno' => '0',
1194
- 'default_value_date' => '',
1195
- 'default_value_textarea' => '',
1196
- 'is_unique' => '0',
1197
- 'is_required' => '0',
1198
- 'apply_to' => array('simple','configurable'), //array('grouped')
1199
- 'is_configurable' => '0',
1200
- 'is_searchable' => '0',
1201
- 'is_visible_in_advanced_search' => '0',
1202
- 'is_comparable' => '0',
1203
- 'is_used_for_price_rules' => '0',
1204
- 'is_wysiwyg_enabled' => '0',
1205
- 'is_html_allowed_on_front' => '1',
1206
- 'is_visible_on_front' => '1',
1207
- 'used_in_product_listing' => '0',
1208
- 'used_for_sort_by' => '0',
1209
- 'frontend_label' => array((string)$attribute->name)
1210
- );
1211
-
1212
- $model = Mage::getModel('catalog/resource_eav_attribute');
1213
- // $attr = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', (string)$attribute->id);
1214
- //Load the particular attribute by id
1215
- $attr = $model->loadByCode('catalog_product',(string)$attribute->id);
1216
- $attr_id = $attr->getAttributeId();
1217
-
1218
- if($attr_id !=''){
1219
- $attr->addData($_attribute_data);
1220
- $option['attribute_id'] = $attr_id;
1221
-
1222
- if($count_value > 0 && ($attribute_type == 'select' || $attribute_type == 'multiselect')){
1223
- for($i =0; $i<$count_value ; $i++){
1224
- $attrdet = $attr_values['valueDef'][$i];
1225
- $optionId = $mapobj->isOptionExistsInAttribute($attrdet->id,$attr_id);
1226
- if(!isset($optionId)){
1227
- $option['value']['option_'.$i][0] = $attrdet->value;
1228
- $option['order']['option_'.$i] = $i;
1229
- $option['externalid']['option_'.$i] = $attrdet->id;
1230
- }
1231
- else{
1232
- $option['value'][$optionId][0] = $attrdet->value;
1233
- $option['order'][$optionId] = $i;
1234
- $option['externalid'][$optionId] = $attrdet->id;
1235
- }
1236
- $attr->setOption($option);
1237
- }
1238
- }
1239
- $attr->save();
1240
- }
1241
- else{
1242
- if (!isset($_attribute_data['is_configurable'])) {
1243
- $_attribute_data['is_configurable'] = 0;
1244
- }
1245
- if (!isset($_attribute_data['is_filterable'])) {
1246
- $_attribute_data['is_filterable'] = 0;
1247
- }
1248
- if (!isset($_attribute_data['is_filterable_in_search'])) {
1249
- $_attribute_data['is_filterable_in_search'] = 0;
1250
- }
1251
- if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {
1252
- $_attribute_data['backend_type'] = $model->getBackendTypeByInput($_attribute_data['frontend_input']);
1253
- }
1254
- $defaultValueField = $model->getDefaultValueByInput($_attribute_data['frontend_input']);
1255
- if ($defaultValueField) {
1256
- $_attribute_data['default_value'] = $this->getRequest()->getParam($defaultValueField);
1257
- }
1258
- $model->addData($_attribute_data);
1259
- $model->setEntityTypeId(Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId());
1260
- $model->setIsUserDefined(1);
1261
- try {
1262
- $model->save();
1263
- unset($model);
1264
- if($count_value > 0){
1265
- $model = Mage::getModel('catalog/resource_eav_attribute');
1266
- $attr = $model->loadByCode('catalog_product',(string)$attribute->id);
1267
- $attr_id = $attr->getAttributeId();
1268
- $option['attribute_id'] = $attr_id;
1269
-
1270
- for($i =0; $i<$count_value ; $i++){
1271
- $attrdet = $attr_values['valueDef'][$i];
1272
- $optionId = $mapobj->isOptionExistsInAttribute($attrdet->id,$attr_id);
1273
- if(!isset($optionId)){
1274
- $option['value']['option_'.$i][0] = $attrdet->value;
1275
- $option['order']['option_'.$i] = $i;
1276
- $option['externalid']['option_'.$i] = $attrdet->id;
1277
- }
1278
- else{
1279
- $option['value'][$optionId][0] = $attrdet->value;
1280
- $option['order'][$optionId] = $i;
1281
- $option['externalid'][$optionId] = $attrdet->id;
1282
- }
1283
- }
1284
- $attr->setOption($option);
1285
- $attr->save();
1286
- }
1287
- } catch (Exception $e) {
1288
- echo '<p>Sorry, error occured while trying to save the attribute. Error: '.$e->getMessage().'</p>';
1289
- }
1290
- }
1291
- }
1292
-
1293
- public function importAttribute($parsedAttribute){
1294
- foreach($parsedAttribute as $attribute){
1295
- $this->createAttribute($attribute);
1296
- }
1297
- $this->reindexDB(7); // 7 is used after attribute creation.
1298
- }
1299
-
1300
- public function parseAttribute(){
1301
- $xmlObj = $this->_xmlObj;
1302
- $xmlData = $xmlObj->getNode();
1303
- if( $xmlData->attributeConfiguration->attribute instanceof Varien_Simplexml_Element){
1304
- return $xmlData->attributeConfiguration->attribute;
1305
- }
1306
- }
1307
-
1308
- public function parseAttributeSet(){
1309
- $xmlObj = $this->_xmlObj;
1310
- $xmlData = $xmlObj->getNode();
1311
- if( $xmlData->attributeConfiguration->attributeSet instanceof Varien_Simplexml_Element){
1312
- return $xmlData->attributeConfiguration->attributeSet;
1313
- }
1314
- }
1315
-
1316
- public function importAttributeSet($parsedAttributeSet){
1317
- $attributeSet_groups = array();
1318
- $attributeSet_groups['status'] = array();
1319
- $attributeSet_groups['id'] = array();
1320
-
1321
- $attributegroup_id = array();
1322
- $attributegroup_status = array();
1323
-
1324
- foreach($parsedAttributeSet as $set){
1325
- $attributeSetId = (string)$set->id;
1326
- $attributeSetName = (string)$set->name;
1327
-
1328
- if($attributeSetName == ''){
1329
- $attributeSetName = $attributeSetId;
1330
- }
1331
- $attributeGrp = $set->attributeGroups->attributeGroup;
1332
- $attribute_set_id = $this->createAttributeSet($attributeSetName,$attributeSetId);
1333
-
1334
- foreach($attributeGrp as $attrgroup){
1335
- $attributegroup_id = (string)$attrgroup->id;
1336
- $attributegroup_status = (string)$attrgroup->isActive;
1337
- $attributeSet_groups['id'][$attributegroup_id][] = $attribute_set_id ;
1338
- $attributeSet_groups['status'][$attributegroup_id][] = $attributegroup_status ;
1339
- }
1340
- unset($attributegroup_status);
1341
- unset($attributegroup_id);
1342
- }
1343
- $this->attributeGroupsGlobal = $attributeSet_groups;
1344
- }
1345
-
1346
-
1347
- public function createAttributeSet($attribute_set_name, $external_id ) {
1348
- $helper = Mage::helper('adminhtml');
1349
- $mapobj = Mage::getModel('customimport/customimport');
1350
- $attributeSetId = $mapobj->getAttributeSetIdByExternalId($external_id);
1351
-
1352
- $entityTypeId = $this->getEntityTypeId();
1353
- $modelSet = Mage::getModel('eav/entity_attribute_set')
1354
- ->setEntityTypeId($entityTypeId);
1355
-
1356
- if(isset($attributeSetId) && !empty($attributeSetId)) {
1357
- $modelSet->load($attributeSetId);
1358
- if (!$modelSet->getId()) {
1359
- Mage::throwException(Mage::helper('catalog')->__('This attribute set no longer exists.'));
1360
- }
1361
- //filter html tags
1362
- $modelSet->setAttributeSetName(trim($attribute_set_name));
1363
- $modelSet->validate();
1364
- $modelSet->save();
1365
- return $attributeSetId;
1366
- }
1367
- // to add attribute set
1368
- $modelSet->setAttributeSetName($attribute_set_name);
1369
-
1370
- $defaultAttributeSetId = $this->getAttributeSetId('Default');
1371
- try{
1372
- if ($modelSet->validate()) {
1373
- $attributeSetId = $modelSet->save()->getAttributeSetId();
1374
- $modelSet->initFromSkeleton($defaultAttributeSetId)->save();
1375
- }
1376
- }catch(Exception $e){
1377
- echo 'already exists';
1378
- }
1379
- // $attributeSetId = $this->getAttributeSetId($attribute_set_name);
1380
- $mapobj->mapAttributeSet($external_id,$attributeSetId);
1381
- return $attributeSetId;
1382
- }
1383
-
1384
- public function parseAttributegrp(){
1385
- $xmlObj = $this->_xmlObj;
1386
- $xmlData = $xmlObj->getNode();
1387
-
1388
- if( $xmlData->attributeConfiguration->attributeGroup instanceof Varien_Simplexml_Element){
1389
- return $xmlData->attributeConfiguration->attributeGroup;
1390
- }
1391
- }
1392
-
1393
- public function importAttributeGrp($parsedAttribute){
1394
- $setOfGroups = $this->attributeGroupsGlobal;
1395
- foreach($parsedAttribute as $attribute){
1396
- $attributeSets = array();
1397
-
1398
- $attributesOfGroup = array(); // array to store attribute detail info of attribute group
1399
- $attributesIdOfGroup = array();
1400
- $attributesStatusOfGroup = array();
1401
- $attributesSequenceOfGroup = array();
1402
-
1403
- $groupAttributes = $attribute->groupedAttributes->attribute;
1404
- foreach($groupAttributes as $grp){
1405
- $attributesIdOfGroup[] = (string)$grp->id;
1406
- $attributesStatusOfGroup[] = (string)$grp->isActive ? (string)$grp->isActive : 'Y';
1407
- $attributesSequenceOfGroup[] = (string)$grp->position ? (string)$grp->position : 0;
1408
- }
1409
- $attributesOfGroup['attr_ids'] = $attributesIdOfGroup;
1410
- $attributesOfGroup['attr_status'] = $attributesStatusOfGroup;
1411
- $attributesOfGroup['attr_sequence'] = $attributesSequenceOfGroup;
1412
-
1413
- $groupId = (string)$attribute->id;
1414
- $groupName = (string)$attribute->name;
1415
-
1416
- if($groupName ==''){
1417
- $groupName = $groupId;
1418
- }
1419
- $attributeSets['set_ids'] = $setOfGroups['id'][$groupId];
1420
- $attributeSets['set_status'] = $setOfGroups['status'][$groupId];
1421
-
1422
- $this->manageAttributeGroup($groupName,$groupId,$attributeSets,$attributesOfGroup);
1423
- unset($attributeSets);
1424
- unset($attributesOfGroup);
1425
- unset($attributesIdOfGroup);
1426
- unset($attributesStatusOfGroup);
1427
- unset($attributesSequenceOfGroup);
1428
- }
1429
- }
1430
-
1431
-
1432
- public function manageAttributeGroup($attribute_group_name,$attribute_group_id,$attribute_set_ids,$attributesOfGroup) { // setname and group are arrays , $attribute_group_id is external group id
1433
- foreach($attribute_set_ids['set_ids'] as $k=>$set_id){ // loop for attribute sets
1434
- if($attribute_set_ids['set_status'][$k] == 'Y'){
1435
- //create group here
1436
- $res = $this->createAttributeGroup($attribute_group_name ,$attribute_group_id, $set_id);
1437
- foreach($attributesOfGroup['attr_ids'] as $k=>$attribute_code){ // loop for all attributes
1438
- if($attributesOfGroup['attr_status'][$k] == 'Y'){
1439
- // insert attributes inside group
1440
- $attributeSortOrder = 0;
1441
- if (isset($attributesOfGroup['attr_sequence'])) {
1442
- $attributeSortOrder = $attributesOfGroup['attr_sequence'][$k];
1443
- }
1444
- $this->importAttributeInsideGroup($attribute_group_id, $set_id , $attribute_code,$attributeSortOrder);
1445
-
1446
- }else{
1447
- $this->removeAttributeFromGroup($attribute_group_id, $set_id , $attribute_code);
1448
- }
1449
- }
1450
- }
1451
- else{
1452
- // remove group from this set
1453
- $this->removeAttributeGroup($attribute_group_name ,$attribute_group_id, $set_id);
1454
-
1455
- }
1456
- }
1457
- }
1458
-
1459
- public function removeAttributeFromGroup($attribute_group_id, $attributeSetId , $attribute_code){
1460
- $mapobj = Mage::getModel('customimport/customimport');
1461
- $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId); // $attribute_group_id is external group id
1462
-
1463
- if($attributeGroupId){
1464
- $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
1465
- $attribute_id=$setup->getAttributeId('catalog_product', $attribute_code);
1466
-
1467
- $attribute_exists = $mapobj->isAttributeExistsInGroup($attribute_id,$attributeGroupId);
1468
- if($attribute_exists){
1469
- $installer = $this->getInstaller();
1470
- $installer->startSetup();
1471
- $installer->deleteTableRow('eav/entity_attribute', 'attribute_id', $attribute_id, 'attribute_set_id', $attributeSetId);
1472
-
1473
- $installer->endSetup();
1474
- }else{
1475
- // do nothing
1476
-
1477
- }
1478
- }
1479
- }
1480
-
1481
- public function removeAttributeGroup($attribute_group_name ,$attribute_group_id, $attributeSetId){
1482
- $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
1483
- $mapobj = Mage::getModel('customimport/customimport');
1484
- $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId);
1485
- if($attributeGroupId){
1486
- // echo '<br/>found group, delete this group';
1487
- $setup->removeAttributeGroup('catalog_product',$attributeSetId,$attributeGroupId);
1488
- // $model->load($attributeGroupId)->delete(); it also works
1489
- }else{
1490
- echo 'group not available';
1491
- }
1492
- }
1493
-
1494
- public function createAttributeGroup($attribute_group_name ,$attribute_group_id, $attributeSetId) {
1495
- $model = Mage::getModel('eav/entity_attribute_group');
1496
- $mapobj = Mage::getModel('customimport/customimport');
1497
- $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId);
1498
- if(isset($attributeGroupId) && !empty($attributeGroupId)) {
1499
- $model->load($attributeGroupId);
1500
- $oldGroupName = $model->getAttributeGroupName();
1501
- if($oldGroupName != $attribute_group_name){ // if name has been updated
1502
- $model->setAttributeGroupName($attribute_group_name);
1503
- if(!$model->itemExists()){
1504
- $model->save();
1505
- }
1506
- }
1507
- }
1508
- else{
1509
- $model->setAttributeGroupName($attribute_group_name)
1510
- ->setAttributeSetId($attributeSetId);
1511
- if( $model->itemExists() ) {
1512
- } else {
1513
- try {
1514
- // $model->save()->getAttributeGroupId();
1515
- $model->save();
1516
- } catch (Exception $e) {
1517
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('catalog')->__('An error occurred while saving this group.'));
1518
- }
1519
- }
1520
- $attributeGroupId = $mapobj->getGroupIdUsingSetId($attribute_group_name,$attributeSetId);
1521
- $mapobj->mapAttributeGroup($attribute_group_id,$attributeGroupId,$attributeSetId); // externalid, magentoid
1522
- }
1523
- }
1524
- public function importAttributeInsideGroup($attribute_group_id, $attributeSetId , $attribute_code,$attribute_sort_order) {
1525
- $mapobj = Mage::getModel('customimport/customimport');
1526
- $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId); // $attribute_group_id is external group id
1527
-
1528
- if($attributeGroupId){
1529
- $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
1530
- $attribute_id=$setup->getAttributeId('catalog_product', $attribute_code);
1531
- $attribute_exists = $mapobj->isAttributeExistsInGroup($attribute_id, $attributeGroupId);
1532
- if($attribute_exists){
1533
- $mapobj->updateSequenceOfAttribute($attributeGroupId, $attribute_id, $attribute_sort_order);
1534
- }else{
1535
- $setup->addAttributeToGroup('catalog_product', $attributeSetId, $attributeGroupId, $attribute_id, $attribute_sort_order);
1536
- }
1537
- }
1538
- }
1539
-
1540
- public function getAttributeGroupId($attribute_group_name , $attribute_set_name) {
1541
- $entityTypeId = $this->getEntityTypeId();
1542
- $attributeSetId = $this->getAttributeSetId($attribute_set_name);
1543
- $installer = $this->getInstaller();//new Mage_Eav_Model_Entity_Setup(‘core_setup’);
1544
- $attributeGroupObject = new Varien_Object($installer->getAttributeGroup($entityTypeId ,$attributeSetId, $attribute_group_name));
1545
- return $attributeGroupId = $attributeGroupObject->getAttributeGroupId();
1546
- }
1547
-
1548
- public function getGroupIdUsingSetId($attribute_group_name , $attributeSetId) {
1549
- $entityTypeId = $this->getEntityTypeId();
1550
- $installer = $this->getInstaller();//new Mage_Eav_Model_Entity_Setup(‘core_setup’);
1551
- $attributeGroupObject = new Varien_Object($installer->getAttributeGroup($entityTypeId ,$attributeSetId, $attribute_group_name));
1552
- return $attributeGroupId = $attributeGroupObject->getAttributeGroupId();
1553
- }
1554
-
1555
- public function getEntityTypeId() {
1556
- return $entityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
1557
- }
1558
-
1559
- public function getInstaller() {
1560
- return new Mage_Catalog_Model_Resource_Eav_Mysql4_Setup('core_setup');
1561
- }
1562
- }
1563
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Gec/Customimport/Helper/Catalog/Image.php DELETED
@@ -1,141 +0,0 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Helper_Catalog_Image extends Mage_Catalog_Helper_Image
21
- {
22
-
23
- protected $_requestedImage;
24
-
25
- /**
26
- * Reset all previous data
27
- *
28
- * @return Mage_Catalog_Helper_Image
29
- */
30
- protected function _reset()
31
- {
32
- $this->_model = null;
33
- $this->_scheduleResize = false;
34
- $this->_scheduleRotate = false;
35
- $this->_angle = null;
36
- $this->_watermark = null;
37
- $this->_watermarkPosition = null;
38
- $this->_watermarkSize = null;
39
- $this->_watermarkImageOpacity = null;
40
- $this->_product = null;
41
- $this->_imageFile = null;
42
- $this->_requestedImage = null;
43
- return $this;
44
- }
45
-
46
- /**
47
- * Initialize Helper to work with Image
48
- *
49
- * @param Mage_Catalog_Model_Product $product
50
- * @param string $attributeName
51
- * @param mixed $imageFile
52
- * @return Mage_Catalog_Helper_Image
53
- */
54
- public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
55
- {
56
- $this->_reset();
57
- $this->_setModel(Mage::getModel('catalog/product_image'));
58
- $this->_getModel()->setDestinationSubdir($attributeName);
59
- $this->setProduct($product);
60
-
61
- $this->_requestedImage = $attributeName;
62
-
63
- $this->setWatermark(
64
- Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image")
65
- );
66
- $this->setWatermarkImageOpacity(
67
- Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity")
68
- );
69
- $this->setWatermarkPosition(
70
- Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position")
71
- );
72
- $this->setWatermarkSize(
73
- Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size")
74
- );
75
-
76
- if ($imageFile) {
77
- $this->setImageFile($imageFile);
78
- } else {
79
- // add for work original size
80
- $this->_getModel()->setBaseFile($this->getProduct()->getData($this->_getModel()->getDestinationSubdir()));
81
- }
82
- return $this;
83
- }
84
-
85
- /**
86
- * Return Image URL
87
- *
88
- * @return string
89
- */
90
- public function __toString()
91
- {
92
- try {
93
- // echo $this->_requestedImage;
94
-
95
- $model = $this->_getModel();
96
- if ($this->getImageFile()) {
97
- $model->setBaseFile($this->getImageFile());
98
- } else {
99
- $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
100
- }
101
-
102
- if($this->_requestedImage == 'image' || $this->_requestedImage == 'small_image' || $this->_requestedImage == 'thumbnail'){
103
- $external_attribute = 'external_'.$this->_requestedImage;
104
- $_product = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
105
- $externalImg = $_product->getData($external_attribute);
106
-
107
- }
108
-
109
-
110
- if ($model->isCached()) {
111
- // return 'http://staging.serenusinfotech.com/smikum/gec/skin/frontend/default/default/images/media/col_left_callout.jpg';
112
- if($externalImg){
113
- return $externalImg;
114
- }
115
- return $model->getUrl();
116
- } else {
117
- if ($this->_scheduleRotate) {
118
- $model->rotate($this->getAngle());
119
- }
120
-
121
- if ($this->_scheduleResize) {
122
- $model->resize();
123
- }
124
-
125
- if ($this->getWatermark()) {
126
- $model->setWatermark($this->getWatermark());
127
- }
128
-
129
- $url = $model->saveFile()->getUrl();
130
- if($externalImg){
131
- $url = $externalImg;
132
- }
133
- }
134
- } catch (Exception $e) {
135
- $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
136
- }
137
- return $url;
138
- // return 'http://staging.serenusinfotech.com/smikum/gec/skin/frontend/default/default/images/media/col_left_callout.jpg';
139
- }
140
-
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Gec/Customimport/Model/Customimport.php DELETED
@@ -1,140 +0,0 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Customimport extends Mage_Core_Model_Abstract {
21
- public function _construct() {
22
- parent::_construct();
23
- $this->_init('customimport/customimport');
24
- }
25
-
26
- /*to fetch the default set id by external set id*/
27
- public function getAttributeSetIdByExternalId($externalId){ // works
28
- $attrsetmappingCollection = Mage::getModel('customimport/attrsetmapping')
29
- ->getCollection()
30
- ->addFieldToFilter('external_id', array('eq' => $externalId));
31
- return $attrsetmappingCollection->getFirstItem()->getMagentoId();
32
- }
33
-
34
- /*to insert a row for external id and default id of attribute set*/
35
- public function mapAttributeSet($externalId, $magentoId){
36
- $attrsetmapping = Mage::getModel('customimport/attrsetmapping');
37
- $data = array('external_id' => $externalId, 'magento_id' => $magentoId);
38
- $attrsetmapping->setData($data);
39
- $attrsetmapping->save();
40
- }
41
-
42
- /*to check if attribute group exists in attribute set*/
43
- public function getAttributeGroupByExternalId($externalId, $attributeSetId){
44
- $attrgroupCollection = Mage::getModel('customimport/attrgroup')
45
- ->getCollection()
46
- ->addFieldToFilter('external_id', array('eq' => $externalId))
47
- ->addFieldToFilter('attribute_set_id', array('eq' => $attributeSetId));
48
-
49
- return $attrgroupCollection->getFirstItem()->getMagentoId();
50
- }
51
- /*to insert a row to define relation between external id ,magento id of group along with setid*/
52
-
53
- public function mapAttributeGroup($externalId, $magentoId, $attributeSetId){
54
- $attrgroup = Mage::getModel('customimport/attrgroup');
55
- $attrgroup->setData(
56
- array('external_id' => $externalId,
57
- 'magento_id' => $magentoId,
58
- 'attribute_set_id' => $attributeSetId
59
- ))->save();
60
- }
61
- /*to get default group id from attribute group table using set id*/
62
- public function getGroupIdUsingSetId($attribute_group_name, $attributeSetId){
63
- $eavattributegroupCollection = Mage::getModel('customimport/eavattributegroup')
64
- ->getCollection()
65
- ->addFieldToFilter('attribute_group_name', array('eq' => $attribute_group_name))
66
- ->addFieldToFilter('attribute_set_id', array('eq' => $attributeSetId));
67
- return $eavattributegroupCollection->getFirstItem()->getAttributeGroupId();
68
- }
69
-
70
- public function isAttributeExistsInGroup($attribute_id, $attributeGroupId){
71
- $eaventityattributeCollection = Mage::getModel('customimport/eaventityattribute')
72
- ->getCollection()
73
- ->addFieldToFilter('attribute_group_id', array('eq' => $attributeGroupId))
74
- ->addFieldToFilter('attribute_id', array('eq' => $attribute_id));
75
- return $eaventityattributeCollection->getFirstItem()->getEntityAttributeId();
76
- }
77
-
78
- public function updateSequenceOfAttribute($attributeGroupId, $attribute_id, $attribute_sort_order){
79
- $eaventityattribute = Mage::getModel('customimport/eaventityattribute');
80
- $eaventityattributeCollection = $eaventityattribute
81
- ->getCollection()
82
- ->addFieldToFilter('attribute_group_id', array('eq' => $attributeGroupId))
83
- ->addFieldToFilter('attribute_id', array('eq' => $attribute_id));
84
- $id = $eaventityattributeCollection->getFirstItem()->getEntityAttributeId();
85
- $data = array('sort_order' => $attribute_sort_order);
86
- if($id){
87
- $eaventityattribute->load($id)->addData($data);
88
- try {
89
- $eaventityattribute->setEntityAttributeId($id)->save();
90
- echo "Data updated successfully.";
91
-
92
- } catch (Exception $e){
93
- echo $e->getMessage();
94
- }
95
- }
96
- }
97
-
98
- public function isOptionExistsInAttribute($external_id, $attributeId){
99
- $eavattributeoptionCollection = Mage::getModel('customimport/eavattributeoption')->getCollection()
100
- ->addFieldToFilter('attribute_id',array('eq' => $attributeId))
101
- ->addFieldToFilter('externalid',array('eq' => $external_id));
102
- return $eavattributeoptionCollection->getFirstItem()->getOptionId();
103
- }
104
-
105
- public function isSubcategoryExists($external_subcat_id, $parent_id){
106
- $externalcatCollection = Mage::getModel('customimport/externalcategorymappinginfo')
107
- ->getCollection()
108
- ->addFieldToFilter('external_id', array('eq' => $external_subcat_id))
109
- ->addFieldToFilter('magento_pid', array('eq' => $parent_id));
110
- return $externalcatCollection->getFirstItem()->getMagentoId();
111
- }
112
-
113
- public function isCategoryExists($external_subcat_id){
114
- $externalcatCollection = Mage::getModel('customimport/externalcategorymappinginfo')
115
- ->getCollection()
116
- ->addFieldToFilter('external_id', array('eq' => $external_subcat_id));
117
- return $externalcatCollection->getFirstItem()->getMagentoId();
118
-
119
- }
120
-
121
- public function updateCategoryMappingInfo($externalId, $magentoId, $externalParentId, $parentId){
122
- $externalcatmappinginfo = Mage::getModel('customimport/externalcategorymappinginfo');
123
- $externalcatmappinginfo->setData(
124
- array('external_id' => $externalId,
125
- 'magento_id' => $magentoId,
126
- 'external_pid' => $externalParentId,
127
- 'magento_pid' => $parentId
128
- ))->save();
129
- }
130
-
131
- public function updateParent($parentId,$categoryId){
132
- $data = array('parent_id' => $parentId);
133
- $catalogentity = Mage::getModel('customimport/catalogentity')->load($categoryId)->addData($data);
134
- try{
135
- $catalogentity->setEntityId($categoryId)->save();
136
- } catch (Exception $e){
137
- echo $e->getMessage();
138
- }
139
- }
140
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Gec/Customimport/controllers/IndexController.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_IndexController extends Mage_Core_Controller_Front_Action
21
- {
22
- public function indexAction()
23
- {
24
- $this->loadLayout(array('default'));
25
- $this->renderLayout();
26
- }
27
- }
28
-
29
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/{community/Gec/Customimport/Block → local/Gec/Customimport/Block/Adminhtml}/Catalogimport.php RENAMED
@@ -1,41 +1,41 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Block_Catalogimport extends Mage_Core_Block_Template
21
- {
22
- public $_log_array = array();
23
- public $_xmlObj;
24
- public $default_asid;
25
- public $_product_list;
26
- public $_category_list;
27
- public $_cat_relation;
28
- public $_current_row = 1;
29
- public $_curitemids = array("sku"=>null);
30
- public $_optidcache = null;
31
- public $_dstore = array();
32
- public $_same;
33
- public $mode = "create";
34
- public $prod_etype = 4;
35
- public $_updated_num = 0;
36
- public $_created_num = 0;
37
- public $attributeGroupsGlobal = array();
38
- public $_store_id;
39
- public $_default_category_id;
40
- }
41
- ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Block_Adminhtml_Catalogimport extends Mage_Adminhtml_Block_Template
21
+ {
22
+ public $_log_array = array();
23
+ public $_xmlObj;
24
+ public $default_asid;
25
+ public $_product_list;
26
+ public $_category_list;
27
+ public $_cat_relation;
28
+ public $_current_row = 1;
29
+ public $_curitemids = array("sku"=>null);
30
+ public $_optidcache = null;
31
+ public $_dstore = array();
32
+ public $_same;
33
+ public $mode = "create";
34
+ public $prod_etype = 4;
35
+ public $_updated_num = 0;
36
+ public $_created_num = 0;
37
+ public $attributeGroupsGlobal = array();
38
+ public $_store_id;
39
+ public $_default_category_id;
40
+ }
41
+ ?>
app/code/local/Gec/Customimport/Block/Adminhtml/Customimport.php ADDED
@@ -0,0 +1,2127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+ class Gec_Customimport_Block_Adminhtml_Customimport extends Gec_Customimport_Block_Adminhtml_Catalogimport
20
+ {
21
+ protected $customHelper;
22
+ protected $logPath;
23
+
24
+ public function __construct()
25
+ {
26
+ parent::__construct();
27
+ $this->customHelper = Mage::helper('customimport');
28
+ $this->logPath = Mage::getBaseDir('log') . '/customimport.log';
29
+ }
30
+
31
+ public function parseXml($xmlPath)
32
+ {
33
+ $this->_store_id = Mage::app()->getWebsite()->getDefaultGroup()->getDefaultStoreId();
34
+ $this->_default_category_id = Mage::app()->getStore('default')->getRootCategoryId();
35
+ $xmlObj = new Varien_Simplexml_Config($xmlPath);
36
+ $this->_xmlObj = $xmlObj;
37
+ }
38
+
39
+ public function reindexDB($val)
40
+ {
41
+ $process = Mage::getModel('index/process')->load($val);
42
+ $process->reindexAll();
43
+ }
44
+
45
+ public function countAll()
46
+ {
47
+ $xmlObj = $this->_xmlObj;
48
+ $xmlData = $xmlObj->getNode();
49
+ $this->_category_list = $xmlData->productAssociations->association;
50
+ $this->lookup($this->_category_list);
51
+ }
52
+
53
+ public function countCategory()
54
+ {
55
+ $xmlObj = $this->_xmlObj;
56
+ $xmlData = $xmlObj->getNode();
57
+ $this->_category_list = $xmlData->categories->category;
58
+ return $this->lookup($this->_category_list);
59
+ }
60
+
61
+ public function countProduct()
62
+ {
63
+ $xmlObj = $this->_xmlObj;
64
+ $xmlData = $xmlObj->getNode();
65
+ $this->_product_list = $xmlData->products->product;
66
+ return $this->lookup($this->_product_list);
67
+ }
68
+
69
+ public function showCategory()
70
+ {
71
+ $xmlObj = $this->_xmlObj;
72
+ $xmlData = $xmlObj->getNode();
73
+ if ($xmlData->categories->category instanceof Varien_Simplexml_Element) {
74
+ return $xmlData->categories->category;
75
+ } else {
76
+ return false;
77
+ }
78
+ }
79
+
80
+ public function importAllCategory($categories)
81
+ {
82
+ $this->_created_num = 0;
83
+ $this->_updated_num = 0;
84
+ foreach ($categories as $category) {
85
+ $this->customHelper->reportInfo($this->customHelper->__('Start process for category # %s', $category->id));
86
+ $this->importCategory($category);
87
+ $this->customHelper->reportInfo($this->customHelper->__('End process for category # %s', $category->id));
88
+ }
89
+ $this->customHelper->reportSuccess($this->customHelper->__('categories was successfully created %s', $this->_created_num));
90
+ $this->customHelper->reportSuccess($this->customHelper->__('categories was successfully updated %s', $this->_updated_num));
91
+ $this->_created_num = 0;
92
+ $this->_updated_num = 0;
93
+ }
94
+
95
+ public function parseAttribute()
96
+ {
97
+ $xmlObj = $this->_xmlObj;
98
+ $xmlData = $xmlObj->getNode();
99
+ if ($xmlData->attributeConfiguration->attribute instanceof Varien_Simplexml_Element) {
100
+ return $xmlData->attributeConfiguration->attribute;
101
+ }
102
+ }
103
+
104
+ public function importAttribute($parsedAttribute)
105
+ {
106
+ foreach ($parsedAttribute as $attribute) {
107
+ $this->customHelper->reportInfo($this->customHelper->__('Start process for attribute # %s', $attribute->id));
108
+ $this->createAttribute($attribute);
109
+ $this->customHelper->reportInfo($this->customHelper->__('End process for attribute # %s', $attribute->id));
110
+ }
111
+ $this->reindexDB(7); // 7 is used after attribute creation.
112
+ }
113
+
114
+ public function parseAttributeSet()
115
+ {
116
+ $xmlObj = $this->_xmlObj;
117
+ $xmlData = $xmlObj->getNode();
118
+ if ($xmlData->attributeConfiguration->attributeSet instanceof Varien_Simplexml_Element) {
119
+ return $xmlData->attributeConfiguration->attributeSet;
120
+ }
121
+ }
122
+
123
+ public function importAttributeSet($parsedAttributeSet)
124
+ {
125
+ $attributeSet_groups = array();
126
+ $attributeSet_groups['status'] = array();
127
+ $attributeSet_groups['id'] = array();
128
+ $attributegroup_id = array();
129
+ $attributegroup_status = array();
130
+
131
+ foreach ($parsedAttributeSet as $set) {
132
+ $this->customHelper->reportInfo($this->customHelper->__('Start process for attribute set # %s', $set->id));
133
+ $attributeSetId = (string) $set->id;
134
+ $attributeSetName = (string) $set->name;
135
+
136
+ if ($attributeSetName == '') {
137
+ $attributeSetName = $attributeSetId;
138
+ }
139
+ $attributeGrp = $set->attributeGroups->attributeGroup;
140
+ $attribute_set_id = $this->createAttributeSet($attributeSetName, $attributeSetId);
141
+
142
+ foreach ($attributeGrp as $attrgroup) {
143
+ $attributegroup_id = (string) $attrgroup->id;
144
+ $attributegroup_status = (string) $attrgroup->isActive;
145
+ $attributeSet_groups['id'][$attributegroup_id][] = $attribute_set_id;
146
+ $attributeSet_groups['status'][$attributegroup_id][] = $attributegroup_status;
147
+ }
148
+ unset($attributegroup_status);
149
+ unset($attributegroup_id);
150
+ $this->customHelper->reportInfo($this->customHelper->__('End process for attribute set # %s', $set->id));
151
+ }
152
+ $this->attributeGroupsGlobal = $attributeSet_groups;
153
+ }
154
+
155
+ public function createAttributeSet($attribute_set_name, $external_id)
156
+ {
157
+ $helper = Mage::helper('adminhtml');
158
+ $mapobj = Mage::getModel('customimport/customimport');
159
+ $attributeSetId = $mapobj->getAttributeSetIdByExternalId($external_id);
160
+ $entityTypeId = $this->getEntityTypeId();
161
+ $modelSet = Mage::getModel('eav/entity_attribute_set')->setEntityTypeId($entityTypeId);
162
+
163
+ if (isset($attributeSetId) && !empty($attributeSetId)) {
164
+ $modelSet->load($attributeSetId);
165
+ if (!$modelSet->getId()) {
166
+ $this->customHelper->reportError($this->customHelper->__('This attribute set no longer exists'));
167
+ Mage::throwException($this->customHelper->__('This attribute set no longer exists.'));
168
+ }
169
+ $modelSet->setAttributeSetName(trim($attribute_set_name));
170
+ $modelSet->validate();
171
+ $modelSet->save();
172
+ return $attributeSetId;
173
+ }
174
+
175
+ $modelSet->setAttributeSetName($attribute_set_name); // to add attribute set
176
+ $defaultAttributeSetId = $this->getAttributeSetId('Default');
177
+ try {
178
+ if ($modelSet->validate()) {
179
+ $attributeSetId = $modelSet->save()->getAttributeSetId();
180
+ $modelSet->initFromSkeleton($defaultAttributeSetId)->save();
181
+ }
182
+ }
183
+ catch (Exception $e) {
184
+ $this->customHelper->reportError($this->customHelper->__('Attribute set name %s with id %s already exists in Magento system with same name', $attribute_set_name, $external_id));
185
+ }
186
+ $mapobj->mapAttributeSet($external_id, $attributeSetId);
187
+ return $attributeSetId;
188
+ }
189
+
190
+ public function parseAttributegrp()
191
+ {
192
+ $xmlObj = $this->_xmlObj;
193
+ $xmlData = $xmlObj->getNode();
194
+ if ($xmlData->attributeConfiguration->attributeGroup instanceof Varien_Simplexml_Element) {
195
+ return $xmlData->attributeConfiguration->attributeGroup;
196
+ }
197
+ }
198
+
199
+ public function importAttributeGrp($parsedAttribute)
200
+ {
201
+ $setOfGroups = $this->attributeGroupsGlobal;
202
+ foreach ($parsedAttribute as $attribute) {
203
+ $attributeSets = array();
204
+ $attributesOfGroup = array(); // array to store attribute detail info of attribute group
205
+ $attributesIdOfGroup = array();
206
+ $attributesStatusOfGroup = array();
207
+ $attributesSequenceOfGroup = array();
208
+ $groupAttributes = $attribute->groupedAttributes->attribute;
209
+ foreach ($groupAttributes as $grp) {
210
+ $attributesIdOfGroup[] = (string) $grp->id;
211
+ $attributesStatusOfGroup[] = (string) $grp->isActive ? (string) $grp->isActive : 'Y';
212
+ $attributesSequenceOfGroup[] = (string) $grp->position ? (string) $grp->position : 0;
213
+ }
214
+
215
+ $attributesOfGroup['attr_ids'] = $attributesIdOfGroup;
216
+ $attributesOfGroup['attr_status'] = $attributesStatusOfGroup;
217
+ $attributesOfGroup['attr_sequence'] = $attributesSequenceOfGroup;
218
+ $groupId = (string) $attribute->id;
219
+ $groupName = (string) $attribute->name;
220
+
221
+ if ($groupName == '') {
222
+ $groupName = $groupId;
223
+ }
224
+
225
+ $attributeSets['set_ids'] = $setOfGroups['id'][$groupId];
226
+ $attributeSets['set_status'] = $setOfGroups['status'][$groupId];
227
+ $this->manageAttributeGroup($groupName, $groupId, $attributeSets, $attributesOfGroup);
228
+ unset($attributeSets);
229
+ unset($attributesOfGroup);
230
+ unset($attributesIdOfGroup);
231
+ unset($attributesStatusOfGroup);
232
+ unset($attributesSequenceOfGroup);
233
+ }
234
+ }
235
+
236
+ /**
237
+ * setname and group are arrays
238
+ * @param $attribute_group_id is external group id
239
+ */
240
+ public function manageAttributeGroup($attribute_group_name, $attribute_group_id, $attribute_set_ids, $attributesOfGroup)
241
+ {
242
+ // loop for attribute sets
243
+ foreach ($attribute_set_ids['set_ids'] as $k => $set_id) {
244
+ if ($attribute_set_ids['set_status'][$k] == 'Y') {
245
+ //create group here
246
+ $res = $this->createAttributeGroup($attribute_group_name, $attribute_group_id, $set_id);
247
+ // loop for all attributes
248
+ foreach ($attributesOfGroup['attr_ids'] as $k => $attribute_code) {
249
+ if ($attributesOfGroup['attr_status'][$k] == 'Y') {
250
+ // insert attributes inside group
251
+ $attributeSortOrder = 0;
252
+ if (isset($attributesOfGroup['attr_sequence'])) {
253
+ $attributeSortOrder = $attributesOfGroup['attr_sequence'][$k];
254
+ }
255
+ $this->importAttributeInsideGroup($attribute_group_id, $set_id, $attribute_code, $attributeSortOrder);
256
+
257
+ } else {
258
+ $this->removeAttributeFromGroup($attribute_group_id, $set_id, $attribute_code);
259
+ }
260
+ }
261
+ } else {
262
+ // remove group from this set
263
+ $this->removeAttributeGroup($attribute_group_name, $attribute_group_id, $set_id);
264
+
265
+ }
266
+ }
267
+ }
268
+
269
+ public function createAttributeGroup($attribute_group_name, $attribute_group_id, $attributeSetId)
270
+ {
271
+ $model = Mage::getModel('eav/entity_attribute_group');
272
+ $mapobj = Mage::getModel('customimport/customimport');
273
+ $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId);
274
+ if (isset($attributeGroupId) && !empty($attributeGroupId)) {
275
+ $model->load($attributeGroupId);
276
+ $oldGroupName = $model->getAttributeGroupName();
277
+ if ($oldGroupName != $attribute_group_name) { // if name has been updated
278
+ $model->setAttributeGroupName($attribute_group_name);
279
+ if (!$model->itemExists()) {
280
+ $model->save();
281
+ }
282
+ }
283
+ } else {
284
+ $model->setAttributeGroupName($attribute_group_name)->setAttributeSetId($attributeSetId);
285
+ if ($model->itemExists()) {
286
+ } else {
287
+ try {
288
+ $model->save();
289
+ }
290
+ catch (Exception $e) {
291
+ $this->customHelper->reportError($this->customHelper->__("An error occurred while saving this group."));
292
+ }
293
+ }
294
+ $attributeGroupId = $mapobj->getGroupIdUsingSetId($attribute_group_name, $attributeSetId);
295
+ $mapobj->mapAttributeGroup($attribute_group_id, $attributeGroupId, $attributeSetId); // externalid, magentoid
296
+ }
297
+ }
298
+
299
+ public function removeAttributeFromGroup($attribute_group_id, $attributeSetId, $attribute_code)
300
+ {
301
+ $mapobj = Mage::getModel('customimport/customimport');
302
+ $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId); // $attribute_group_id is external group id
303
+
304
+ if ($attributeGroupId) {
305
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
306
+ $attribute_id = $setup->getAttributeId('catalog_product', $attribute_code);
307
+ $attribute_exists = $mapobj->isAttributeExistsInGroup($attribute_id, $attributeGroupId);
308
+ if ($attribute_exists) {
309
+ $installer = $this->getInstaller();
310
+ $installer->startSetup();
311
+ $installer->deleteTableRow('eav/entity_attribute', 'attribute_id', $attribute_id, 'attribute_set_id', $attributeSetId);
312
+ $installer->endSetup();
313
+ }
314
+ }
315
+ }
316
+
317
+ public function removeAttributeGroup($attribute_group_name, $attribute_group_id, $attributeSetId)
318
+ {
319
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
320
+ $mapobj = Mage::getModel('customimport/customimport');
321
+ $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId);
322
+ if ($attributeGroupId) {
323
+ $setup->removeAttributeGroup('catalog_product', $attributeSetId, $attributeGroupId);
324
+ } else {
325
+ $this->customHelper->reportInfo($this->customHelper->__("Attribute Group is not available to be removed."));
326
+ }
327
+ }
328
+
329
+ public function importAttributeInsideGroup($attribute_group_id, $attributeSetId, $attribute_code, $attribute_sort_order)
330
+ {
331
+ $mapobj = Mage::getModel('customimport/customimport');
332
+ $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId); // $attribute_group_id is external group id
333
+
334
+ if ($attributeGroupId) {
335
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
336
+ $attribute_id = $setup->getAttributeId('catalog_product', $attribute_code);
337
+ $attribute_exists = $mapobj->isAttributeExistsInGroup($attribute_id, $attributeGroupId);
338
+ if ($attribute_exists) {
339
+ $mapobj->updateSequenceOfAttribute($attributeGroupId, $attribute_id, $attribute_sort_order, $attribute_code);
340
+ } else {
341
+ $setup->addAttributeToGroup('catalog_product', $attributeSetId, $attributeGroupId, $attribute_id, $attribute_sort_order);
342
+ }
343
+ }
344
+ }
345
+
346
+ public function getAttributeGroupId($attribute_group_name, $attribute_set_name)
347
+ {
348
+ $entityTypeId = $this->getEntityTypeId();
349
+ $attributeSetId = $this->getAttributeSetId($attribute_set_name);
350
+ $installer = $this->getInstaller(); //new Mage_Eav_Model_Entity_Setup(‘core_setup’);
351
+ $attributeGroupObject = new Varien_Object($installer->getAttributeGroup($entityTypeId, $attributeSetId, $attribute_group_name));
352
+ return $attributeGroupId = $attributeGroupObject->getAttributeGroupId();
353
+ }
354
+
355
+ public function getGroupIdUsingSetId($attribute_group_name, $attributeSetId)
356
+ {
357
+ $entityTypeId = $this->getEntityTypeId();
358
+ $installer = $this->getInstaller(); //new Mage_Eav_Model_Entity_Setup(‘core_setup’);
359
+ $attributeGroupObject = new Varien_Object($installer->getAttributeGroup($entityTypeId, $attributeSetId, $attribute_group_name));
360
+ return $attributeGroupId = $attributeGroupObject->getAttributeGroupId();
361
+ }
362
+
363
+ public function showProducts()
364
+ {
365
+ $xmlObj = $this->_xmlObj;
366
+ $xmlData = $xmlObj->getNode();
367
+ $this->_product_list = $xmlData->products->product;
368
+ if ($this->_product_list instanceof Varien_Simplexml_Element) {
369
+ return $this->_product_list;
370
+ } else {
371
+ return false;
372
+ }
373
+ }
374
+
375
+ public function importAllProducts($products, $Currfilepath = null, $Errfilepath = null)
376
+ {
377
+ $item = array();
378
+ foreach ($products as $product) {
379
+ $this->customHelper->reportInfo($this->customHelper->__("Start process for Product # %s", $product->id));
380
+ $this->_current_row++;
381
+ $this->importItem($product, $Currfilepath, $Errfilepath);
382
+ $this->customHelper->reportInfo($this->customHelper->__("End process for Product # %s", $product->id));
383
+ }
384
+ $this->customHelper->reportSuccess($this->customHelper->__("Successfully created products %s", $this->_created_num));
385
+ $this->customHelper->reportSuccess($this->customHelper->__("Successfully updated products %s", $this->_updated_num));
386
+ $this->_created_num = 0;
387
+ $this->_updated_num = 0;
388
+ }
389
+
390
+ /**
391
+ * parses <categoryProducts> block , and returns <categoryProducts><categoryProduct> block
392
+ */
393
+ public function associatedProductsCategory()
394
+ {
395
+ $xmlObj = $this->_xmlObj;
396
+ $xmlData = $xmlObj->getNode();
397
+ if ($xmlData->categoryProducts->categoryProduct instanceof Varien_Simplexml_Element) {
398
+ return $xmlData->categoryProducts->categoryProduct;
399
+ } else {
400
+ return false;
401
+ }
402
+ }
403
+
404
+ public function associateProducts($association)
405
+ {
406
+ foreach ($association as $associate) {
407
+ $parent = (string) $associate->categoryId;
408
+ $externall = $this->checkExternalId($parent);
409
+ if ($externall) {
410
+ if (count($externall) == 1) {
411
+ reset($externall);
412
+ $first_key = key($externall);
413
+ foreach ($associate->product as $product) {
414
+ $this->customHelper->reportInfo($this->customHelper->__("Start Process for category # %s and product %s association", $externall[$first_key], $product->id));
415
+ $this->associateProductToCategory($product, $first_key);
416
+ $this->customHelper->reportInfo($this->customHelper->__("End Process for category # %s and product %s association", $externall[$first_key], $product->id));
417
+ }
418
+ } else {
419
+ foreach ($externall as $systemCatid => $v) {
420
+ foreach ($associate->product as $product) {
421
+ $this->customHelper->reportInfo($this->customHelper->__("Start Process for category # %s and product %s association", $v, $product->id));
422
+ $this->associateProductToCategory($product, $systemCatid);
423
+ $this->customHelper->reportInfo($this->customHelper->__("End Process for category # %s and product %s association", $v, $product->id));
424
+ }
425
+ }
426
+ }
427
+ } else {
428
+ if (count($externall) == 0) {
429
+ $this->customHelper->reportError($this->customHelper->__('category id not found : %s', $parent));
430
+ }
431
+ }
432
+ }
433
+ }
434
+
435
+ //Get product Association from XML
436
+ public function associatedProductsProducts()
437
+ {
438
+ $xmlObj = $this->_xmlObj;
439
+ $xmlData = $xmlObj->getNode();
440
+ if ($xmlData->productAssociations->association instanceof Varien_Simplexml_Element) {
441
+ return $xmlData->productAssociations->association;
442
+ } else {
443
+ $this->customHelper->reportInfo($this->customHelper->__('Association block is empty.'));
444
+ }
445
+ }
446
+
447
+ public function associatePdtPdt($association)
448
+ {
449
+ foreach ($association as $associate) {
450
+ $this->customHelper->reportInfo($this->customHelper->__('Start Process for product association # %s', $associate->productIdFrom));
451
+ $mainProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', (string) $associate->productIdFrom);
452
+ if ($mainProduct) {
453
+ $productId = $mainProduct->getId();
454
+ $relatedArray = array();
455
+ $upsellArray = array();
456
+ $crossArray = array();
457
+ $associatedArray = array();
458
+ $bundleArray = array();
459
+ foreach ($associate->associatedProduct as $association) {
460
+ if ($association instanceof Varien_Simplexml_Element) { // if associatedProduct is an object in form of <associatedProduct>
461
+ unset($prid);
462
+ $prid = Mage::getModel('catalog/product')->getIdBySku((string) $association->id); // get id of associated product
463
+ if ($prid && (string) $association->isActive == 'Y') {
464
+ $position = (string) $association->position ? (string) $association->position : 0;
465
+ if ((string) $association->assocType == 0) {
466
+ $crossArray[$prid] = array(
467
+ 'position' => $position
468
+ );
469
+ } else if ((string) $association->assocType == 1) {
470
+ $upsellArray[$prid] = array(
471
+ 'position' => $position
472
+ );
473
+ } else if ((string) $association->assocType == 2) {
474
+ $relatedArray[$prid] = array(
475
+ 'position' => $position
476
+ );
477
+ } else if ((string) $association->assocType == 3) {
478
+ $associatedArray[] = $prid;
479
+ $this->_changeVisibility($prid);
480
+ } else if ((string) $association->assocType == 4) {
481
+ $bundleArray[] = $prid;
482
+ $bundleQuantityArray[] = (int) $association->quantity;
483
+ $bundlePositionArray[] = (int) $position;
484
+ }
485
+ }
486
+ }
487
+ }
488
+ $mainProduct->setCrossSellLinkData($crossArray);
489
+ $mainProduct->setUpSellLinkData($upsellArray);
490
+ $mainProduct->setRelatedLinkData($relatedArray);
491
+ if (count($bundleArray) > 0) {
492
+ $proobj = Mage::getModel('catalog/product');
493
+ $productbundle = Mage::getModel('catalog/product')->setStoreId(0);
494
+ if ($productId) {
495
+ $productbundle->load($productId);
496
+ }
497
+ Mage::register('product', $productbundle);
498
+ Mage::register('current_product', $productbundle);
499
+ $bundleOptions = array();
500
+ $bundleSelections = array();
501
+ $i = 0;
502
+ foreach ($bundleArray as $proid) {
503
+ $_product_obj = $proobj->load($proid);
504
+ $bundleOptions[$i] = array(
505
+ 'title' => $_product_obj->getName(), //option title
506
+ 'option_id' => '',
507
+ 'delete' => '',
508
+ 'type' => 'select',
509
+ 'required' => '1',
510
+ 'position' => $bundlePositionArray[$i]
511
+ );
512
+ $bundleSelections[$i] = array(
513
+ '0' => array(
514
+ 'product_id' => $proid, //if of a product in selection
515
+ 'delete' => '',
516
+ 'selection_price_value' => '10',
517
+ 'selection_price_type' => 0,
518
+ 'selection_qty' => $bundleQuantityArray[$i],
519
+ 'selection_can_change_qty' => 0,
520
+ 'position' => 0,
521
+ 'is_default' => 1
522
+ )
523
+ );
524
+ $i++;
525
+ }
526
+ try {
527
+ $productbundle->setCanSaveConfigurableAttributes(false);
528
+ $productbundle->setCanSaveCustomOptions(true);
529
+ $productbundle->setBundleOptionsData($bundleOptions);
530
+ $productbundle->setBundleSelectionsData($bundleSelections);
531
+ $productbundle->setCanSaveCustomOptions(true);
532
+ $productbundle->setCanSaveBundleSelections(true);
533
+ $productbundle->save();
534
+ }
535
+ catch (Exception $e) {
536
+ $this->customHelper->reportError($e->getMessage());
537
+ $this->customHelper->sendLogEmail($this->logPath);
538
+ }
539
+ }
540
+
541
+ if (count($associatedArray) > 0) {
542
+ try {
543
+ Mage::getResourceModel('catalog/product_type_configurable')->saveProducts($mainProduct, $associatedArray);
544
+ }
545
+ catch (Exception $e) {
546
+ $this->customHelper->reportError($this->customHelper->__('ERROR: product association failed for %s', $associate->productIdFrom));
547
+ }
548
+ }
549
+
550
+ unset($crossArray);
551
+ unset($upsellArray);
552
+ unset($relatedArray);
553
+ unset($associatedArray);
554
+ } else {
555
+ $this->customHelper->reportError($this->customHelper->__('INFO: product not found for association %s', $associate->productIdFrom));
556
+ }
557
+ $this->customHelper->reportInfo($this->customHelper->__('End Process for product association # %s', $associate->productIdFrom));
558
+ }
559
+ }
560
+
561
+ public function parseAndUpdateCategoryRelation()
562
+ {
563
+ $xmlObj = $this->_xmlObj;
564
+ $xmlData = $xmlObj->getNode();
565
+ $this->_cat_relation = $xmlData->categoryRelations->categoryRelation;
566
+ $categoryRelationStatus = 1;
567
+ if (count($this->_cat_relation) > 0) {
568
+ foreach ($this->_cat_relation as $catRelation) {
569
+ $parent = (string) $catRelation->parentId;
570
+ $externall = $this->checkExternalId($parent);
571
+ if ($externall) { //check if parent id exists.
572
+ if (count($externall) == 1) {
573
+ reset($externall); //to take 1st key of array
574
+ $first_key = key($externall);
575
+ foreach ($catRelation->subCategory as $sub) {
576
+ $this->updateCategoryRelation($sub, $first_key, $parent);
577
+ }
578
+ } else {
579
+ foreach ($externall as $systemCatid => $v) {
580
+ foreach ($catRelation->subCategory as $sub) {
581
+ $this->updateCategoryRelation($sub, $systemCatid, $parent);
582
+ }
583
+ }
584
+ }
585
+ } else {
586
+ $categoryRelationStatus = 2;
587
+ $this->customHelper->reportError($this->customHelper->__('Parent category not found : ') . $parent);
588
+ }
589
+ }
590
+ } else {
591
+ $categoryRelationStatus = 0;
592
+ }
593
+ return $categoryRelationStatus;
594
+ }
595
+
596
+ //duplicating categoryid
597
+ protected function duplicateCategory($categoryId, $parentId, $status)
598
+ {
599
+ $default_root_category = $this->_default_category_id;
600
+ $parent_id = ($parentId) ? $parentId : $default_root_category;
601
+ $isActive = ($status == 'Y') ? 1 : 0;
602
+ $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($categoryId); //load category to duplicate
603
+ $duplicate_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id);
604
+ $parent_category = $this->_initCategory($parentId, $this->_store_id);
605
+ if (!$parent_category->getId()) {
606
+ exit;
607
+ }
608
+ $duplicate_category->addData(array(
609
+ 'path' => implode('/', $parent_category->getPathIds())
610
+ ));
611
+ $duplicate_category->setParentId($parent_category->getId());
612
+ $duplicate_category->setAttributeSetId($duplicate_category->getDefaultAttributeSetId());
613
+ $duplicate_category->setData('name', $category->getName());
614
+ $duplicate_category->setData('include_in_menu', 1);
615
+ $duplicate_category->setData('meta_title', $category->getmetaTitle());
616
+ $duplicate_category->setData('meta_keywords', $category->getmetaKeywords());
617
+ $duplicate_category->setData('meta_description', $category->getmetaDescription());
618
+ $duplicate_category->setData('description', $category->getdescription());
619
+ $duplicate_category->setData('available_sort_by', 'position');
620
+ $duplicate_category->setData('default_sort_by', 'position');
621
+ $duplicate_category->setData('is_active', $isActive);
622
+ $duplicate_category->setData('is_anchor', 1);
623
+ $duplicate_category->setData('external_id', $category->getexternalId());
624
+ $duplicate_category->setData('external_cat_image', $category->getexternalCatImage());
625
+ try {
626
+ $validate = $duplicate_category->validate();
627
+ if ($validate !== true) {
628
+ foreach ($validate as $code => $error) {
629
+ if ($error === true) {
630
+ $this->customHelper->reportError($this->customHelper->__('Attribute "%s" is required', $code));
631
+ $this->customHelper->sendLogEmail($this->logPath);
632
+ } else {
633
+ $this->customHelper->reportError($error);
634
+ $this->customHelper->sendLogEmail($this->logPath);
635
+ Mage::throwException($error);
636
+ }
637
+ }
638
+ }
639
+ $duplicate_category->save();
640
+ return $duplicate_category->getId();
641
+ }
642
+ catch (Exception $e) {
643
+ $this->customHelper->reportError($e->getMessage());
644
+ $this->customHelper->sendLogEmail($this->logPath);
645
+ }
646
+ return false;
647
+ }
648
+
649
+ public function getTreeCategories($category_id, $p_id, $isActive, $isChild) //$parentId, $isChild
650
+ {
651
+ $duplicatedCategoryId = $this->duplicateCategory($category_id, $p_id, $isActive);
652
+ $mapObj = Mage::getModel('customimport/customimport');
653
+ $sub_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($duplicatedCategoryId);
654
+ $parent_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($p_id);
655
+ $ext_subid = $sub_category->getExternalId();
656
+ $parent_external_id = $parent_category->getExternalId();
657
+ $mapObj->updateCategoryMappingInfo($ext_subid, $duplicatedCategoryId, $parent_external_id, $p_id);
658
+ $allCats = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')->addAttributeToFilter('parent_id', array(
659
+ 'eq' => $category_id
660
+ ));
661
+ foreach ($allCats as $category) {
662
+ $subcats = $category->getChildren();
663
+ $isActive = 'N';
664
+ $status_cat = $category->getData('is_active');
665
+ if ($status_cat == 1) {
666
+ $isActive = 'Y';
667
+ }
668
+ if ($subcats != '') {
669
+ $this->getTreeCategories($category->getId(), $duplicatedCategoryId, $isActive, true);
670
+ } else {
671
+ $duplicatedSubcategoryId = $this->duplicateCategory($category->getId(), $duplicatedCategoryId, $isActive); // duplicated category id is parent for current subcategory
672
+ if ($duplicatedSubcategoryId) {
673
+ $sub_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($duplicatedSubcategoryId);
674
+ $parent_category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($duplicatedCategoryId);
675
+ $ext_subid = $sub_category->getExternalId();
676
+ $parent_external_id = $parent_category->getExternalId();
677
+ $mapObj->updateCategoryMappingInfo($ext_subid, $duplicatedSubcategoryId, $parent_external_id, $duplicatedCategoryId);
678
+ } else {
679
+ $this->customHelper->reportError($this->customHelper->__('There was an error while duplicating category'));
680
+ }
681
+ }
682
+ }
683
+ }
684
+
685
+ public function updateCategoryRelation($subcat, $p_id, $parent_external_id)
686
+ {
687
+ $ext_subid = (string) $subcat->id;
688
+ $actualSubId = $this->checkExternalId($ext_subid);
689
+ $mapObj = Mage::getModel('customimport/customimport');
690
+
691
+ if ($actualSubId) {
692
+ if (count($actualSubId) == 1) {
693
+ reset($actualSubId); //to take 1st key of array
694
+ $subcat_id = key($actualSubId);
695
+ $category_id = $mapObj->isSubcategoryExists($ext_subid, $p_id); // external subcat id , parent magento id
696
+
697
+ if ($category_id) {
698
+ $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($subcat_id);
699
+ $isActive = ((string) $subcat->isActive == 'Y') ? 1 : 0;
700
+ $category->setData('is_active', $isActive);
701
+ $category->save();
702
+ } else {
703
+ $category_id = $mapObj->isCategoryExists($ext_subid);
704
+ if ($category_id) {
705
+ $isActive = ((string) $subcat->isActive);
706
+ $status = $this->getTreeCategories($category_id, $p_id, $isActive, false);
707
+ } else {
708
+ // category is not under any other parent , move
709
+ $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($subcat_id);
710
+ $category->move($p_id, 0);
711
+ $isActive = ((string) $subcat->isActive == 'Y') ? 1 : 0;
712
+ $category->setData('is_active', $isActive);
713
+ $category->save();
714
+ $mapObj->updateParent($p_id, $subcat_id);
715
+ $mapObj->updateCategoryMappingInfo($ext_subid, $subcat_id, $parent_external_id, $p_id);
716
+ }
717
+ }
718
+ } else {
719
+ $category_id = $mapObj->isSubcategoryExists($ext_subid, $p_id);
720
+ if ($category_id) {
721
+ //echo 'subcat present in this cat '.$ext_subid;
722
+ $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($category_id);
723
+ $isActive = ((string) $subcat->isActive == 'Y') ? 1 : 0;
724
+ $category->setData('is_active', $isActive);
725
+ $category->save();
726
+ } else if ($category_id = $mapObj->isCategoryExists($ext_subid)) {
727
+ $isActive = ((string) $subcat->isActive);
728
+ $status = $this->getTreeCategories($category_id, $p_id, $isActive, false);
729
+ } else {
730
+ // category is not under any other parent , move
731
+ $this->customHelper->reportInfo($this->customHelper->__('block will not execute as category is not under any other parent'));
732
+ }
733
+ }
734
+ } else {
735
+ if (count($actualSubId) == 0) {
736
+ $this->customHelper->reportError($this->customHelper->__('There was no subcategory id found %s ', $ext_subid));
737
+ }
738
+ }
739
+ }
740
+
741
+ public function importItem(&$item, $Currfilepath = null, $Errfilepath = null)
742
+ {
743
+ $missingInfoRow = $this->_current_row - 1;
744
+ if (!isset($item->id) || trim($item->id) == '') {
745
+ $this->customHelper->reportError($this->customHelper->__('There was no sku found for product %s ', $this->_current_row));
746
+ return false;
747
+ }
748
+
749
+ if (($item->attributeSetId) == '') {
750
+ $item->attributeSetId = 'Default';
751
+ }
752
+
753
+ if (!isset($item->type) || trim($item->type) == '') {
754
+ $this->customHelper->reportError($this->customHelper->__('There was no product type found for product %s ', $item->id));
755
+ return false;
756
+ }
757
+ $itemids = $this->getItemIds($item, $Currfilepath, $Errfilepath);
758
+ if ($itemids) {
759
+ $pid = $itemids["pid"];
760
+ $asid = $itemids["asid"];
761
+ if (!isset($pid)) {
762
+ if (!isset($asid)) {
763
+ $this->customHelper->reportError($this->customHelper->__('cannot create product sku %s ', $item->id));
764
+ return false;
765
+ }
766
+ if ((string) $item->type == 'configurable') {
767
+ $this->createConfigurableProduct($item, $asid); //create con product
768
+ } else if ((string) $item->type == 'simple') {
769
+ $this->createProduct($item, $asid); //create simple product
770
+ } else if ((string) $item->type == 'bundle') {
771
+ $this->createBundleProduct($item, $asid); //create bundle product
772
+ } else {
773
+ $this->customHelper->reportError($this->customHelper->__('Import function does not support product type of record: %s ', $item->id));
774
+ }
775
+ $this->_curitemids["pid"] = $pid;
776
+ $isnew = true;
777
+ } else {
778
+ try {
779
+ if ((string) $item->type == 'configurable') {
780
+ $this->updateConfigurableProduct($item, $pid); //create con product
781
+ } else if ((string) $item->type == 'simple') {
782
+ $this->updateProduct($item, $pid); //create simple product
783
+ } else if ((string) $item->type == 'bundle') {
784
+ $this->updateBundleProduct($item, $pid); //create simple product
785
+ }
786
+ }
787
+ catch (Exception $e) {
788
+ $this->customHelper->reportError($this->customHelper->__('ERROR: Product can not created for %s', $item->id));
789
+ }
790
+ }
791
+ } else {
792
+ $this->customHelper->reportInfo($this->customHelper->__('ERROR: Product %s is skipped due to some error. ', $item->id));
793
+ }
794
+ }
795
+
796
+ public function updateConfigurableProduct(&$item, $pid)
797
+ {
798
+ $p_status = ((string) $item->isActive == 'Y') ? 1 : 2;
799
+ $p_taxclass = ((string) $item->isTaxable == 'Y') ? 2 : 0;
800
+ $SKU = (string) $item->id;
801
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $SKU);
802
+
803
+ if ($product) {
804
+ $product->setData('name', (string) $item->name);
805
+ $product->setPrice((real) $item->price);
806
+
807
+ $splAmt = (array) $item->specialPrice->amount;
808
+ if (isset($item->specialPrice->amount) && $item->specialPrice->amount != NULL) {
809
+ if (!empty($splAmt))
810
+ $product->setSpecialPrice((real) $item->specialPrice->amount); //special price in form 11.22
811
+ else
812
+ $product->setSpecialPrice("");
813
+ }
814
+
815
+ $fromDate = (array) $item->specialPrice->fromDateTime;
816
+ if (isset($item->specialPrice->fromDateTime) && $item->specialPrice->fromDateTime != NULL) {
817
+ if (!empty($fromDate))
818
+ $product->setSpecialFromDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->fromDateTime)); //special price from (MM-DD-YYYY)
819
+ else
820
+ $product->setSpecialFromDate("");
821
+ }
822
+
823
+ $toDate = (array) $item->specialPrice->toDateTime;
824
+ if (isset($item->specialPrice->toDateTime) && $item->specialPrice->toDateTime != NULL) {
825
+ if (!empty($toDate))
826
+ $product->setSpecialToDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->toDateTime)); //special price to (MM-DD-YYYY)
827
+ else
828
+ $product->setSpecialToDate("");
829
+ }
830
+
831
+ $product->setWeight((real) $item->weight);
832
+ $product->setStatus($p_status);
833
+ $product->setTaxClassId($p_taxclass);
834
+ $product->setDescription((string) $item->longDescription);
835
+ $product->setShortDescription((string) $item->shortDescription);
836
+ $product->setMetaTitle((string) $item->pageTitle);
837
+ $product->setMetaKeyword((string) $item->metaKeywords);
838
+ $product->setMetaDescription((string) $item->metaDescription);
839
+ $product->setExternalImage((string) $item->originalImageUrl);
840
+ $product->setExternalSmallImage((string) $item->largeImageUrl);
841
+ $product->setExternalThumbnail((string) $item->smallImageUrl);
842
+ $attributeValues = $item->attributeValues;
843
+ $attributeOcuurance = array(); //stores no. of occurance for all attributes
844
+ $configAttributeValue = array(); // will use to take value of attributes that ocuures once
845
+ $i = 1;
846
+ foreach ($attributeValues->attribute as $attr) {
847
+ if (array_key_exists((string) $attr->id, $attributeOcuurance)) {
848
+ $attributeOcuurance[(string) $attr->id] = (int) $attributeOcuurance[(string) $attr->id] + 1;
849
+ $attrPos[(string) $attr->id] = (int) $attr->position;
850
+ } else {
851
+ $attributeOcuurance[(string) $attr->id] = $i;
852
+ $configAttributeValue[(string) $attr->id] = (string) $attr->valueDefId;
853
+ }
854
+ }
855
+ $config_attribute_array = array(); //attributes with single occurance
856
+ foreach ($attributeOcuurance as $key => $val) {
857
+ if ($val == 1) {
858
+ $config_attribute_array[] = $key;
859
+ }
860
+ }
861
+
862
+ foreach ($config_attribute_array as $attr) {
863
+ $external_id = $configAttributeValue[$attr]; // valueDefId from XML for an attribute
864
+ $model = Mage::getModel('catalog/resource_eav_attribute');
865
+ $loadedattr = $model->loadByCode('catalog_product', $attr);
866
+ $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
867
+ $attr_type = $loadedattr->getFrontendInput();
868
+
869
+ if ($attr_type == 'select') {
870
+ $mapObj = Mage::getModel('customimport/customimport');
871
+ $option_id = $mapObj->isOptionExistsInAttribute($external_id, $attr_id);
872
+ // $product->setData($attr, (string)$item->name);
873
+ if ($option_id) {
874
+ $product->setData($attr, $option_id);
875
+ }
876
+ } else { //if attribute is textfield direct insert value
877
+ $product->setData($attr, $external_id);
878
+ }
879
+ }
880
+
881
+ try {
882
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
883
+ $product->save();
884
+ $stockItem = Mage::getModel('cataloginventory/stock_item');
885
+ $stockItem->assignProduct($product);
886
+ $stockItem->setData('stock_id', (int) 1);
887
+ $stockItem->setData('use_config_manage_stock', (int) 1);
888
+ $stockItem->setData('min_qty', (int) 0);
889
+ $stockItem->setData('is_decimal_divided', (int) 0);
890
+ $stockItem->setData('qty', (int) 0);
891
+ $stockItem->setData('use_config_min_qty', 1);
892
+ $stockItem->setData('use_config_backorders', 1);
893
+ $stockItem->setData('min_sale_qty', 1);
894
+ $stockItem->setData('use_config_min_sale_qty', 1);
895
+ $stockItem->setData('use_config_max_sale_qty', 1);
896
+ $stockItem->setData('is_in_stock', 1);
897
+ $stockItem->setData('use_config_notify_stock_qty', 1);
898
+ $inventory = $item->inventory;
899
+ $manageItem = (string) $inventory->manageStock;
900
+ if ($manageItem == 'N' || $manageItem == 'n') {
901
+ $stockItem->setData('use_config_manage_stock', 0);
902
+ $stockItem->setData('manage_stock', 0);
903
+ } else {
904
+ $stockItem->setData('use_config_manage_stock', 1);
905
+ $stockItem->setData('manage_stock', 1);
906
+ }
907
+
908
+ $stockItem->save();
909
+ $stockStatus = Mage::getModel('cataloginventory/stock_status');
910
+ $stockStatus->assignProduct($product);
911
+ $stockStatus->saveProductStatus($product->getId(), 1);
912
+ }
913
+ catch (Exception $e) {
914
+ $this->customHelper->reportError($this->customHelper->__('Unable to update configurable product due to some error'));
915
+ $this->customHelper->reportError($e->getMessage());
916
+ $this->customHelper->sendLogEmail($this->logPath);
917
+ }
918
+ $this->_updated_num++;
919
+ unset($product);
920
+ $productId = (isset($productId) ? $productId : null);
921
+
922
+ return $productId;
923
+ } else {
924
+ return false;
925
+ }
926
+ }
927
+
928
+ public function createConfigurableProduct(&$item, $asid)
929
+ {
930
+ $attributeSetModel = Mage::getModel('eav/entity_attribute_set');
931
+ $attributeSetModel->load($asid);
932
+ $attributeSetModel = $attributeSetModel->getData();
933
+ if (count($attributeSetModel) > 0) {
934
+ $p_status = ((string) $item->isActive == 'Y') ? 1 : 2;
935
+ $p_taxclass = ((string) $item->isTaxable == 'Y') ? 2 : 0;
936
+ $product = new Mage_Catalog_Model_Product();
937
+ $product->setTypeId('configurable');
938
+ $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
939
+ //New and created data code start
940
+ $format = 'Y-m-d H:i:s';
941
+ $catalogNewproductDays = Mage::getStoreConfig('catalog/newproduct/days', Mage::app()->getStore());
942
+ if (!empty($catalogNewproductDays) && $catalogNewproductDays >= 0) {
943
+ $currenDateTime = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
944
+ $new_from_date = $currenDateTime;
945
+ $new_to_date = date($format, strtotime($catalogNewproductDays . ' days' . $new_from_date));
946
+ $product->setNewsFromDate($new_from_date);
947
+ $product->setNewsToDate($new_to_date);
948
+ }
949
+ if ($product->getCreatedTime == NULL || $product->getUpdateTime() == NULL) {
950
+ $product->setCreatedTime($currenDateTime)->setUpdateTime($currenDateTime);
951
+ }
952
+ //New and created data code end
953
+ $product->setSku((string) $item->id); //Product custom id
954
+ $product->setWebsiteIds(array(
955
+ Mage::app()->getStore(true)->getWebsite()->getId()
956
+ ));
957
+ $product->setStoreIDs(array(
958
+ $this->_store_id
959
+ )); // Default store id .
960
+ $product->setAttributeSetId($asid);
961
+
962
+ $product->setData('name', (string) $item->name);
963
+ $product->setPrice((real) $item->price);
964
+ $splAmt = (array) $item->specialPrice->amount;
965
+ if (isset($item->specialPrice->amount) && $item->specialPrice->amount != NULL) {
966
+ if (!empty($splAmt))
967
+ $product->setSpecialPrice((real) $item->specialPrice->amount); //special price in form 11.22
968
+ }
969
+
970
+ $fromDate = (array) $item->specialPrice->fromDateTime;
971
+ if (isset($item->specialPrice->fromDateTime) && $item->specialPrice->fromDateTime != NULL) {
972
+ if (!empty($fromDate))
973
+ $product->setSpecialFromDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->fromDateTime)); //special price from (MM-DD-YYYY)
974
+ }
975
+
976
+ $toDate = (array) $item->specialPrice->toDateTime;
977
+ if (isset($item->specialPrice->toDateTime) && $item->specialPrice->toDateTime != NULL) {
978
+ if (!empty($toDate))
979
+ $product->setSpecialToDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->toDateTime)); //special price to (MM-DD-YYYY)
980
+ }
981
+ $product->setWeight((real) $item->weight);
982
+ $product->setStatus($p_status);
983
+ $product->setTaxClassId($p_taxclass);
984
+ $product->setDescription((string) $item->longDescription);
985
+ $product->setShortDescription((string) $item->shortDescription);
986
+ $product->setMetaTitle((string) $item->pageTitle);
987
+ $product->setMetaKeyword((string) $item->metaKeywords);
988
+ $product->setMetaDescription((string) $item->metaDescription);
989
+ $product->setExternalImage((string) $item->originalImageUrl);
990
+ $product->setExternalSmallImage((string) $item->largeImageUrl);
991
+ $product->setExternalThumbnail((string) $item->smallImageUrl);
992
+ $attributeValues = $item->attributeValues;
993
+ $attributeOcuurance = array(); //stores no. of occurance for all attributes
994
+ $configAttributeValue = array(); // will use to take value of attributes that ocuures once
995
+ $i = 1;
996
+
997
+ foreach ($attributeValues->attribute as $attr) {
998
+ if (array_key_exists((string) $attr->id, $attributeOcuurance)) {
999
+ $attributeOcuurance[(string) $attr->id] = (int) $attributeOcuurance[(string) $attr->id] + 1;
1000
+ $attrPos[(string) $attr->id] = (int) $attr->position;
1001
+ } else {
1002
+ $attributeOcuurance[(string) $attr->id] = $i;
1003
+ $configAttributeValue[(string) $attr->id] = (string) $attr->valueDefId;
1004
+ $attrPos[(string) $attr->id] = (int) $attr->position;
1005
+ }
1006
+ }
1007
+ $superattribute_array = array(); // attributes with multiple occurances
1008
+ $config_attribute_array = array(); //attributes with single occurance
1009
+ foreach ($attributeOcuurance as $key => $val) {
1010
+ if ($val > 1) {
1011
+ $superattribute_array[] = $key;
1012
+ } else {
1013
+ $config_attribute_array[] = $key;
1014
+ }
1015
+ }
1016
+
1017
+ $attributes_array = array();
1018
+ if (count($superattribute_array) > 0) {
1019
+ $super_attribute_created = $this->makeAttributeConfigurable($superattribute_array);
1020
+ if ($super_attribute_created) {
1021
+ foreach ($superattribute_array as $attr) {
1022
+ $attributes_array[] = $attr; // contains attribute codes
1023
+ }
1024
+ $ProductAttributeIds = array(); // array stores only super attribute id's
1025
+ $attribute_detail = array(); // stores super attribute's detail
1026
+ $attrnum = 0;
1027
+ foreach ($attributes_array as $attribute_code) {
1028
+ $model = Mage::getModel('catalog/resource_eav_attribute');
1029
+ $attr = $model->loadByCode('catalog_product', $attribute_code);
1030
+ $attr_id = $attr->getAttributeId();
1031
+ $ProductAttributeIds[] = $attr_id;
1032
+ $attribute_label = $attr->getFrontendLabel();
1033
+ $attr_detail = array(
1034
+ 'id' => NULL,
1035
+ 'label' => "$attribute_label",
1036
+ 'position' => $attrPos[$attr_id],
1037
+ 'attribute_id' => $attr_id,
1038
+ 'attribute_code' => "$attribute_code",
1039
+ 'frontend_label' => "$attribute_label",
1040
+ 'html_id' => "config_super_product__attribute_$attrnum"
1041
+ );
1042
+ $attribute_detail[] = $attr_detail;
1043
+ $attrnum++;
1044
+ }
1045
+ $product->getTypeInstance()->setUsedProductAttributeIds($ProductAttributeIds);
1046
+ $product->setConfigurableAttributesData($attribute_detail);
1047
+ $product->setCanSaveConfigurableAttributes(1);
1048
+ foreach ($config_attribute_array as $attr) {
1049
+ $external_id = $configAttributeValue[$attr]; // valueDefId from XML for an attribute
1050
+ $model = Mage::getModel('catalog/resource_eav_attribute');
1051
+ $loadedattr = $model->loadByCode('catalog_product', $attr);
1052
+ $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
1053
+ $attr_type = $loadedattr->getFrontendInput();
1054
+ if ($attr_type == 'select') {
1055
+ $mapObj = Mage::getModel('customimport/customimport');
1056
+ $option_id = $mapObj->isOptionExistsInAttribute($external_id, $attr_id);
1057
+ if ($option_id) {
1058
+ $product->setData($attr, $option_id);
1059
+ }
1060
+ } else //if attribute is textfield direct insert value
1061
+ {
1062
+ $product->setData($attr, $external_id);
1063
+ }
1064
+ }
1065
+ try {
1066
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
1067
+ $product->save();
1068
+ $stockItem = Mage::getModel('cataloginventory/stock_item');
1069
+ $stockItem->assignProduct($product);
1070
+ $stockItem->setData('stock_id', (int) 1);
1071
+ $stockItem->setData('use_config_manage_stock', (int) 1);
1072
+ $stockItem->setData('min_qty', (int) 0);
1073
+ $stockItem->setData('is_decimal_divided', (int) 0);
1074
+ $stockItem->setData('qty', (int) 0);
1075
+ $stockItem->setData('use_config_min_qty', 1);
1076
+ $stockItem->setData('use_config_backorders', 1);
1077
+ $stockItem->setData('min_sale_qty', 1);
1078
+ $stockItem->setData('use_config_min_sale_qty', 1);
1079
+ $stockItem->setData('use_config_max_sale_qty', 1);
1080
+ $stockItem->setData('is_in_stock', 1);
1081
+ $stockItem->setData('use_config_notify_stock_qty', 1);
1082
+ // Manage Stock
1083
+ $inventory = $item->inventory;
1084
+ $manageItem = (string) strtoupper($inventory->manageStock);
1085
+ if ($manageItem == 'N') {
1086
+
1087
+ $stockItem->setData('use_config_manage_stock', 0);
1088
+ $stockItem->setData('manage_stock', 0);
1089
+ }
1090
+ $stockItem->save();
1091
+ $stockStatus = Mage::getModel('cataloginventory/stock_status');
1092
+ $stockStatus->assignProduct($product);
1093
+ $stockStatus->saveProductStatus($product->getId(), 1);
1094
+ $this->_created_num++;
1095
+ }
1096
+ catch (Exception $e) {
1097
+ $this->customHelper->writeCustomLog('<span style="color:red;">' . $e->getMessage() . '</span>', $this->logPath);
1098
+ $this->customHelper->sendLogEmail($this->logPath);
1099
+ echo "exception:$e";
1100
+ }
1101
+ } else {
1102
+ $this->customHelper->reportError($this->customHelper->__('Could not get super attribute for product. Hence skipped product : %s', $item->id));
1103
+ }
1104
+ } else {
1105
+ $this->customHelper->reportError($this->customHelper->__('Super attribute is missing. Hence skipped product : %s', $item->id));
1106
+ }
1107
+ } else {
1108
+ $this->customHelper->reportError($this->customHelper->__('Attribute set ID # %s is missing. Hence skipped product SKU # %s', $attid, $item->id));
1109
+ }
1110
+ }
1111
+
1112
+ public function createProduct(&$item, $asid)
1113
+ {
1114
+ $logFileName = Mage::getSingleton('core/session')->getEmailID();
1115
+ $attributeSetModel = Mage::getModel('eav/entity_attribute_set');
1116
+ $attributeSetModel->load($asid);
1117
+ if (count($attributeSetModel->getData()) > 0) {
1118
+ $p_status = ((string) $item->isActive == 'Y') ? 1 : 2;
1119
+ $p_taxclass = ((string) $item->isTaxable == 'Y') ? 2 : 0;
1120
+ $product = new Mage_Catalog_Model_Product();
1121
+ $product->setTypeId('simple');
1122
+ $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
1123
+ //New and created data code start
1124
+ $format = 'Y-m-d H:i:s';
1125
+ $catalogNewproductDays = Mage::getStoreConfig('catalog/newproduct/days', Mage::app()->getStore());
1126
+ if (!empty($catalogNewproductDays) && $catalogNewproductDays >= 0) {
1127
+ $currenDateTime = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
1128
+ $new_from_date = $currenDateTime;
1129
+ $new_to_date = date($format, strtotime($catalogNewproductDays . ' days' . $new_from_date));
1130
+ $product->setNewsFromDate($new_from_date);
1131
+ $product->setNewsToDate($new_to_date);
1132
+ }
1133
+ if ($product->getCreatedTime == NULL || $product->getUpdateTime() == NULL) {
1134
+ $product->setCreatedTime($currenDateTime)->setUpdateTime($currenDateTime);
1135
+ }
1136
+ //New and created data code end
1137
+ $product->setSku((string) $item->id); //Product custom id
1138
+ $product->setWebsiteIds(array(
1139
+ Mage::app()->getStore(true)->getWebsite()->getId()
1140
+ )); //Default website (main website) ?? To Do : make it dynamic
1141
+ $product->setStoreIDs(array(
1142
+ $this->_store_id
1143
+ )); // Default store id .
1144
+ $inventory = $item->inventory;
1145
+ $manageItem = (string) $inventory->manageStock;
1146
+ $manageItem = strtoupper($manageItem);
1147
+ if ($manageItem == 'Y' && (strtoupper($inventory->allowBackorders) == 'Y')) {
1148
+ $product->setStockData(array(
1149
+ 'is_in_stock' => 1,
1150
+ 'qty' => $inventory->atp,
1151
+ 'manage_stock' => 1,
1152
+ 'use_config_backorders' => 0,
1153
+ 'backorders' => 1
1154
+ ));
1155
+ } elseif ($manageItem == 'Y') {
1156
+ $product->setStockData(array(
1157
+ 'is_in_stock' => 1,
1158
+ 'qty' => $inventory->atp,
1159
+ 'use_config_backorders' => 0,
1160
+ 'manage_stock' => 1
1161
+ ));
1162
+ } elseif ($manageItem == 'N') {
1163
+ $product->setStockData(array(
1164
+ 'use_config_backorders' => 0,
1165
+ 'manage_stock' => 0
1166
+ ));
1167
+ }
1168
+
1169
+ $product->setAttributeSetId($asid);
1170
+ $product->setData('name', (string) $item->name);
1171
+ $product->setPrice((real) $item->price);
1172
+ $splAmt = (array) $item->specialPrice->amount;
1173
+ if (isset($item->specialPrice->amount) && $item->specialPrice->amount != NULL) {
1174
+ if (!empty($splAmt))
1175
+ $product->setSpecialPrice((real) $item->specialPrice->amount); //special price in form 11.22
1176
+ }
1177
+
1178
+ $fromDate = (array) $item->specialPrice->fromDateTime;
1179
+ if (isset($item->specialPrice->fromDateTime) && $item->specialPrice->fromDateTime != NULL) {
1180
+ if (!empty($fromDate))
1181
+ $product->setSpecialFromDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->fromDateTime)); //special price from (MM-DD-YYYY)
1182
+ }
1183
+
1184
+ $toDate = (array) $item->specialPrice->toDateTime;
1185
+ if (isset($item->specialPrice->toDateTime) && $item->specialPrice->toDateTime != NULL) {
1186
+ if (!empty($toDate))
1187
+ $product->setSpecialToDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->toDateTime)); //special price to (MM-DD-YYYY)
1188
+ }
1189
+ $product->setWeight((real) $item->weight);
1190
+ $product->setStatus($p_status);
1191
+ $product->setTaxClassId($p_taxclass);
1192
+ $product->setDescription((string) $item->longDescription);
1193
+ $product->setShortDescription((string) $item->shortDescription);
1194
+ $product->setMetaTitle((string) $item->pageTitle);
1195
+ $product->setMetaKeyword((string) $item->metaKeywords);
1196
+ $product->setMetaDescription((string) $item->metaDescription);
1197
+ $product->setExternalImage((string) $item->originalImageUrl);
1198
+ $product->setExternalSmallImage((string) $item->largeImageUrl);
1199
+ $product->setExternalThumbnail((string) $item->smallImageUrl);
1200
+ $attributeValues = $item->attributeValues;
1201
+ $attributeOcuurance = array(); //stores no. of occurance for all attributes
1202
+ $configAttributeValue = array(); // will use to take value of attributes that ocuures once
1203
+ $multiple_values = array(); // stores an array of available values
1204
+ $i = 1;
1205
+ foreach ($attributeValues->attribute as $attr) {
1206
+ if (array_key_exists((string) $attr->id, $attributeOcuurance)) {
1207
+ $multiple_values[(string) $attr->id][] = (string) $attr->valueDefId;
1208
+ $attributeOcuurance[(string) $attr->id] = (int) $attributeOcuurance[(string) $attr->id] + 1;
1209
+ } else {
1210
+ $multiple_values[(string) $attr->id][] = (string) $attr->valueDefId;
1211
+ $attributeOcuurance[(string) $attr->id] = $i;
1212
+ }
1213
+ }
1214
+ $skipStatus = 0;
1215
+ foreach ($multiple_values as $attribute_code => $attribute_values) {
1216
+ $model = Mage::getModel('catalog/resource_eav_attribute');
1217
+ $loadedattr = $model->loadByCode('catalog_product', $attribute_code);
1218
+ $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
1219
+ if (!$attr_id) {
1220
+ $this->customHelper->reportError($this->customHelper->__('Skipped product %s,attribute is not available in magento database: %s', $item->id, $attribute_code));
1221
+ $skipStatus = 1;
1222
+ break;
1223
+ } else {
1224
+ $attr_type = $loadedattr->getFrontendInput();
1225
+ if ($attr_type == 'select' && count($attribute_values) == 1) {
1226
+ $mapObj = Mage::getModel('customimport/customimport');
1227
+ $option_id = $mapObj->isOptionExistsInAttribute($attribute_values[0], $attr_id);
1228
+ if ($option_id) {
1229
+ $product->setData($attribute_code, $option_id);
1230
+ }
1231
+ }
1232
+ if ($attr_type == 'select' && count($attribute_values) > 1) {
1233
+ //multiple values for attribute which is not multiselect
1234
+ $this->customHelper->reportError($this->customHelper->__('NOTICE: Attribute %s can not have multiple values. Hence skipping product having id %s', $attribute_code, $item->id));
1235
+ $skipStatus = 1;
1236
+ break;
1237
+ }
1238
+ if ($attr_type == 'multiselect') {
1239
+ $multivalues = array();
1240
+ foreach ($attribute_values as $value) {
1241
+ $mapObj = Mage::getModel('customimport/customimport');
1242
+ $option_id = $mapObj->isOptionExistsInAttribute($value, $attr_id);
1243
+ if ($option_id) {
1244
+ $multivalues[] = $option_id;
1245
+ }
1246
+ }
1247
+ $product->addData(array(
1248
+ $attribute_code => $multivalues
1249
+ ));
1250
+ }
1251
+
1252
+ if ($attr_type == 'text' || $attr_type == 'textarea') {
1253
+ $optVal = Mage::getModel('customimport/customimport')->getOptVal($attribute_values[0]);
1254
+ $product->setData($attribute_code, $optVal->getValue());
1255
+ } else if ($attr_type == 'boolean') {
1256
+ $optVal = Mage::getSingleton('customimport/customimport')->getOptVal($attribute_values[0]);
1257
+ if (strtolower($optVal->getValue()) == 'y' || strtolower($optVal->getValue()) == 'yes') {
1258
+ $attOptVal = 1;
1259
+ } else {
1260
+ $attOptVal = 0;
1261
+ }
1262
+ $product->setData($attribute_code, $attOptVal);
1263
+ }
1264
+ }
1265
+ }
1266
+ try {
1267
+ if ($skipStatus == 0) {
1268
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
1269
+ $productId = $product->save()->getId();
1270
+ if ($manageItem == 'N' || $manageItem == 'n') {
1271
+ $product->setStockData(array(
1272
+ 'use_config_backorders' => 0,
1273
+ 'is_in_stock' => 1,
1274
+ 'manage_stock' => 0
1275
+ ));
1276
+ //code for instock while update product
1277
+ $stockItem = Mage::getModel('cataloginventory/stock_item');
1278
+ $stockItem->assignProduct($product);
1279
+ $stockItem->setData('use_config_manage_stock', 0);
1280
+ $stockItem->setData('manage_stock', 0);
1281
+ $stockItem->save();
1282
+ $stockStatus = Mage::getModel('cataloginventory/stock_status');
1283
+ $stockStatus->assignProduct($product);
1284
+ $stockStatus->saveProductStatus($product->getId(), 1);
1285
+ }
1286
+ if ($productId) {
1287
+ $this->_created_num++;
1288
+ unset($product);
1289
+ unset($multiple_values);
1290
+ unset($attributeOcuurance);
1291
+ return $productId;
1292
+ } else {
1293
+ $this->customHelper->reportError($this->customHelper->__('NOTICE: Skipped product due to improper attribute values %s', $item->id));
1294
+ }
1295
+ } else {
1296
+ $this->customHelper->reportError($this->customHelper->__('NOTICE: Skipped product due to some error while save %s', $item->id));
1297
+ }
1298
+ }
1299
+ catch (Mage_Eav_Model_Entity_Attribute_Exception $e) {
1300
+ $this->customHelper->reportError($e->getMessage());
1301
+ $this->customHelper->reportError($e->getAttributeCode());
1302
+ $this->customHelper->sendLogEmail($this->logPath);
1303
+ }
1304
+ } else {
1305
+ $this->customHelper->reportError($this->customHelper->__('Attribute set ID # %s is missing. Hence skipped product SKU # %s', $attid, $item->id));
1306
+ }
1307
+ }
1308
+
1309
+ public function createBundleProduct(&$item, $asid)
1310
+ {
1311
+ $attributeSetModel = Mage::getModel('eav/entity_attribute_set');
1312
+ $attributeSetModel->load($asid);
1313
+ if (count($attributeSetModel) > 0) {
1314
+ $p_status = ((string) $item->isActive == 'Y') ? 1 : 2;
1315
+ $p_taxclass = ((string) $item->isTaxable == 'Y') ? 2 : 0;
1316
+
1317
+ $product = new Mage_Catalog_Model_Product();
1318
+ $product->setTypeId('bundle');
1319
+ $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
1320
+ //New and created data code start
1321
+ $format = 'Y-m-d H:i:s';
1322
+ $catalogNewproductDays = Mage::getStoreConfig('catalog/newproduct/days', Mage::app()->getStore());
1323
+ if (!empty($catalogNewproductDays) && $catalogNewproductDays >= 0) {
1324
+ $currenDateTime = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
1325
+ $new_from_date = $currenDateTime;
1326
+ $new_to_date = date($format, strtotime($catalogNewproductDays . ' days' . $new_from_date));
1327
+ $product->setNewsFromDate($new_from_date);
1328
+ $product->setNewsToDate($new_to_date);
1329
+ }
1330
+ if ($product->getCreatedTime == NULL || $product->getUpdateTime() == NULL) {
1331
+ $product->setCreatedTime($currenDateTime)->setUpdateTime($currenDateTime);
1332
+ }
1333
+ //New and created data code end
1334
+ $product->setSku((string) $item->id); //Product custom id
1335
+ $product->setWebsiteIds(array(
1336
+ Mage::app()->getStore(true)->getWebsite()->getId()
1337
+ ));
1338
+ $product->setStoreIDs(array(
1339
+ $this->_store_id
1340
+ )); // Default store id .
1341
+ $product->setAttributeSetId($asid);
1342
+ $product->setData('name', (string) $item->name);
1343
+ $product->setPrice((real) $item->price);
1344
+ $splAmt = (array) $item->specialPrice->amount;
1345
+ if (isset($item->specialPrice->amount) && $item->specialPrice->amount != NULL) {
1346
+ if (!empty($splAmt))
1347
+ $product->setSpecialPrice((real) $item->specialPrice->amount); //special price in form 11.22
1348
+ }
1349
+
1350
+ $fromDate = (array) $item->specialPrice->fromDateTime;
1351
+ if (isset($item->specialPrice->fromDateTime) && $item->specialPrice->fromDateTime != NULL) {
1352
+ if (!empty($fromDate))
1353
+ $product->setSpecialFromDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->fromDateTime)); //special price from (MM-DD-YYYY)
1354
+ }
1355
+
1356
+ $toDate = (array) $item->specialPrice->toDateTime;
1357
+ if (isset($item->specialPrice->toDateTime) && $item->specialPrice->toDateTime != NULL) {
1358
+ if (!empty($toDate))
1359
+ $product->setSpecialToDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->toDateTime)); //special price to (MM-DD-YYYY)
1360
+ }
1361
+
1362
+ $product->setWeight((real) $item->weight);
1363
+ $product->setStatus($p_status);
1364
+ $product->setTaxClassId($p_taxclass);
1365
+ $product->setDescription((string) $item->longDescription);
1366
+ $product->setShortDescription((string) $item->shortDescription);
1367
+ $product->setMetaTitle((string) $item->pageTitle);
1368
+ $product->setMetaKeyword((string) $item->metaKeywords);
1369
+ $product->setMetaDescription((string) $item->metaDescription);
1370
+ $product->setExternalImage((string) $item->originalImageUrl);
1371
+ $product->setExternalSmallImage((string) $item->largeImageUrl);
1372
+ $product->setExternalThumbnail((string) $item->smallImageUrl);
1373
+ $product->setShipmentType(0); //shipment type (0 - together, 1 - separately
1374
+ try {
1375
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
1376
+ $product->save();
1377
+ $stockItem = Mage::getModel('cataloginventory/stock_item');
1378
+ $stockItem->assignProduct($product);
1379
+ $stockItem->setData('stock_id', (int) 1);
1380
+ $stockItem->setData('use_config_manage_stock', (int) 1);
1381
+ $stockItem->setData('min_qty', (int) 0);
1382
+ $stockItem->setData('is_decimal_divided', (int) 0);
1383
+ $stockItem->setData('qty', (int) 0);
1384
+ $stockItem->setData('use_config_min_qty', 1);
1385
+ $stockItem->setData('use_config_backorders', 1);
1386
+ $stockItem->setData('min_sale_qty', 1);
1387
+ $stockItem->setData('use_config_min_sale_qty', 1);
1388
+ $stockItem->setData('use_config_max_sale_qty', 1);
1389
+ $stockItem->setData('is_in_stock', 1);
1390
+ $stockItem->setData('use_config_notify_stock_qty', 1);
1391
+ // Added Manage Stock Functionality
1392
+ // Manage Stock
1393
+ $inventory = $item->inventory;
1394
+ $manageItem = (string) strtoupper($inventory->manageStock);
1395
+ if ($manageItem == 'N') {
1396
+ $stockItem->setData('use_config_manage_stock', 0);
1397
+ $stockItem->setData('manage_stock', 0);
1398
+ }
1399
+ $stockItem->save();
1400
+ $stockStatus = Mage::getModel('cataloginventory/stock_status');
1401
+ $stockStatus->assignProduct($product);
1402
+ $stockStatus->saveProductStatus($product->getId(), 1);
1403
+ }
1404
+ catch (Exception $e) {
1405
+ $this->customHelper->reportError($e->getMessage());
1406
+ $this->customHelper->sendLogEmail($this->logPath);
1407
+ }
1408
+ } else {
1409
+ $this->customHelper->reportError($this->customHelper->__('Attribute set ID # %s is missing. Hence skipped product SKU # %s', $attid, $item->id));
1410
+ }
1411
+ }
1412
+
1413
+ public function updateProduct(&$item, $pid)
1414
+ {
1415
+ $p_status = ((string) $item->isActive == 'Y') ? 1 : 2;
1416
+ $p_taxclass = ((string) $item->isTaxable == 'Y') ? 2 : 0;
1417
+ $SKU = (string) $item->id;
1418
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $SKU);
1419
+
1420
+ if ($product) {
1421
+ //Product found, so we need to update it in Magento.
1422
+ $product->setData('name', (string) $item->name);
1423
+ $product->setPrice((real) $item->price);
1424
+ $splAmt = (array) $item->specialPrice->amount;
1425
+ if (isset($item->specialPrice->amount) && $item->specialPrice->amount != NULL) {
1426
+ if (!empty($splAmt))
1427
+ $product->setSpecialPrice((real) $item->specialPrice->amount); //special price in form 11.22
1428
+ else
1429
+ $product->setSpecialPrice("");
1430
+ }
1431
+
1432
+ $fromDate = (array) $item->specialPrice->fromDateTime;
1433
+ if (isset($item->specialPrice->fromDateTime) && $item->specialPrice->fromDateTime != NULL) {
1434
+ if (!empty($fromDate))
1435
+ $product->setSpecialFromDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->fromDateTime)); //special price from (MM-DD-YYYY)
1436
+ else
1437
+ $product->setSpecialFromDate("");
1438
+ }
1439
+
1440
+ $toDate = (array) $item->specialPrice->toDateTime;
1441
+ if (isset($item->specialPrice->toDateTime) && $item->specialPrice->toDateTime != NULL) {
1442
+ if (!empty($toDate))
1443
+ $product->setSpecialToDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->toDateTime)); //special price to (MM-DD-YYYY)
1444
+ else
1445
+ $product->setSpecialToDate("");
1446
+ }
1447
+
1448
+ $product->setWeight((real) $item->weight);
1449
+ $product->setStatus($p_status);
1450
+ $product->setTaxClassId($p_taxclass);
1451
+ $product->setDescription((string) $item->longDescription);
1452
+ $product->setShortDescription((string) $item->shortDescription);
1453
+ $product->setMetaTitle((string) $item->pageTitle);
1454
+ $product->setMetaKeyword((string) $item->metaKeywords);
1455
+ $product->setMetaDescription((string) $item->metaDescription);
1456
+ $product->setExternalImage((string) $item->originalImageUrl);
1457
+ $product->setExternalSmallImage((string) $item->largeImageUrl);
1458
+ $product->setExternalThumbnail((string) $item->smallImageUrl);
1459
+ $attributeValues = $item->attributeValues;
1460
+ $attributeOcuurance = array(); //stores no. of occurance for all attributes
1461
+ $configAttributeValue = array(); // will use to take value of attributes that ocuures once
1462
+ $multiple_values = array();
1463
+ $i = 1;
1464
+ foreach ($attributeValues->attribute as $attr) {
1465
+ if (array_key_exists((string) $attr->id, $attributeOcuurance)) {
1466
+ $multiple_values[(string) $attr->id][] = (string) $attr->valueDefId;
1467
+ $attributeOcuurance[(string) $attr->id] = (int) $attributeOcuurance[(string) $attr->id] + 1;
1468
+ } else {
1469
+ $multiple_values[(string) $attr->id][] = (string) $attr->valueDefId;
1470
+ $attributeOcuurance[(string) $attr->id] = $i;
1471
+ // $configAttributeValue[(string)$attr->id] = (string)$attr->valueDefId;
1472
+ }
1473
+ }
1474
+ $skipStatus = 0;
1475
+ foreach ($multiple_values as $attribute_code => $attribute_values) {
1476
+ $model = Mage::getModel('catalog/resource_eav_attribute');
1477
+ $loadedattr = $model->loadByCode('catalog_product', $attribute_code);
1478
+ $attr_id = $loadedattr->getAttributeId(); // attribute id of magento
1479
+ if (!$attr_id) {
1480
+ $this->customHelper->reportError($this->customHelper->__('Attribute %s is not available in magento database.Hence skipping product having id %s', $attribute_code, $item->id));
1481
+ } else {
1482
+ $attr_type = $loadedattr->getFrontendInput();
1483
+ if ($attr_type == 'select' && count($attribute_values) == 1) {
1484
+ $mapObj = Mage::getModel('customimport/customimport');
1485
+ $option_id = $mapObj->isOptionExistsInAttribute($attribute_values[0], $attr_id);
1486
+ if ($option_id) {
1487
+ $product->setData($attribute_code, $option_id);
1488
+ }
1489
+ }
1490
+ if ($attr_type == 'select' && count($attribute_values) > 1) {
1491
+ //multiple values for attribute which is not multiselect
1492
+ $this->customHelper->reportError($this->customHelper->__('Attribute %s can not have multiple values. Hence skipping product having id %s', $attribute_code, $item->id));
1493
+ $skipStatus = 1;
1494
+ break;
1495
+ }
1496
+ if ($attr_type == 'multiselect') {
1497
+ $multivalues = array();
1498
+ foreach ($attribute_values as $value) {
1499
+ $mapObj = Mage::getModel('customimport/customimport');
1500
+ $option_id = $mapObj->isOptionExistsInAttribute($value, $attr_id);
1501
+ if ($option_id) {
1502
+ $multivalues[] = $option_id;
1503
+ }
1504
+ }
1505
+ $product->addData(array(
1506
+ $attribute_code => $multivalues
1507
+ ));
1508
+ }
1509
+ if ($attr_type == 'text' || $attr_type == 'textarea') { // if type is text/textarea
1510
+ $optVal = Mage::getSingleton('customimport/customimport')->getOptVal($attribute_values[0]);
1511
+ $product->setData($attribute_code, $optVal->getValue());
1512
+ } else if ($attr_type == 'boolean') {
1513
+ $optVal = Mage::getSingleton('customimport/customimport')->getOptVal($attribute_values[0]);
1514
+ if (strtolower($optVal->getValue()) == 'y' || strtolower($optVal->getValue()) == 'yes') {
1515
+ $attOptVal = 1;
1516
+ } else {
1517
+ $attOptVal = 0;
1518
+ }
1519
+ $product->setData($attribute_code, $attOptVal);
1520
+ }
1521
+ }
1522
+ }
1523
+ if ($skipStatus == 0) {
1524
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
1525
+ $productId = $product->save()->getId();
1526
+ $this->_updated_num++;
1527
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
1528
+ $stockItemId = $stockItem->getId();
1529
+ $inventory = $item->inventory;
1530
+ $manageItem = (string) $inventory->manageStock;
1531
+ $manageItem = strtoupper($manageItem);
1532
+ if ($manageItem == 'Y') { // if product item exist
1533
+ $stockItem->setData('manage_stock', 1);
1534
+ $stockItem->setData('is_in_stock', 1);
1535
+ $stockItem->setData('qty', $inventory->atp);
1536
+ if (strtoupper($inventory->allowBackorders) == 'Y') { // if back order allowed
1537
+ $stockItem->setData('use_config_backorders', 0);
1538
+ $stockItem->setData('backorders', 1);
1539
+ }
1540
+ if (strtoupper($inventory->allowBackorders) == 'N') { // if back order allowed
1541
+ $stockItem->setData('use_config_backorders', 0);
1542
+ $stockItem->setData('backorders', 0);
1543
+ }
1544
+ } else {
1545
+ $stockItem->setData('use_config_manage_stock', 0);
1546
+ $stockItem->setData('manage_stock', 0); // manage stock to no
1547
+ }
1548
+
1549
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
1550
+ $stockItem->save();
1551
+ unset($product);
1552
+ return $productId;
1553
+ } else {
1554
+ $this->customHelper->reportError($this->customHelper->__('Skipped product due to improper attribute values : %s', $item->id));
1555
+ }
1556
+ } else {
1557
+ $this->customHelper->reportError($this->customHelper->__('Skipped product due to some error while save : %s', $item->id));
1558
+ }
1559
+ }
1560
+
1561
+ public function updateBundleProduct(&$item, $pid)
1562
+ {
1563
+ $p_status = ((string) $item->isActive == 'Y') ? 1 : 2;
1564
+ $p_taxclass = ((string) $item->isTaxable == 'Y') ? 2 : 0;
1565
+ $SKU = (string) $item->id;
1566
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $SKU);
1567
+ if ($product) {
1568
+ $product->setData('name', (string) $item->name);
1569
+ $product->setPrice((real) $item->price);
1570
+ $splAmt = (array) $item->specialPrice->amount;
1571
+ if (isset($item->specialPrice->amount) && $item->specialPrice->amount != NULL) {
1572
+ if (!empty($splAmt))
1573
+ $product->setSpecialPrice((real) $item->specialPrice->amount); //special price in form 11.22
1574
+ else
1575
+ $product->setSpecialPrice("");
1576
+ }
1577
+
1578
+ $fromDate = (array) $item->specialPrice->fromDateTime;
1579
+ if (isset($item->specialPrice->fromDateTime) && $item->specialPrice->fromDateTime != NULL) {
1580
+ if (!empty($fromDate))
1581
+ $product->setSpecialFromDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->fromDateTime)); //special price from (MM-DD-YYYY)
1582
+ else
1583
+ $product->setSpecialFromDate("");
1584
+ }
1585
+
1586
+ $toDate = (array) $item->specialPrice->toDateTime;
1587
+ if (isset($item->specialPrice->toDateTime) && $item->specialPrice->toDateTime != NULL) {
1588
+ if (!empty($toDate))
1589
+ $product->setSpecialToDate(Mage::helper('customimport')->getCurrentLocaleDateTime($item->specialPrice->toDateTime)); //special price to (MM-DD-YYYY)
1590
+ else
1591
+ $product->setSpecialToDate("");
1592
+ }
1593
+
1594
+ $product->setWeight((real) $item->weight);
1595
+ $product->setStatus($p_status);
1596
+ $product->setTaxClassId($p_taxclass);
1597
+ $product->setDescription((string) $item->longDescription);
1598
+ $product->setShortDescription((string) $item->shortDescription);
1599
+ $product->setMetaTitle((string) $item->pageTitle);
1600
+ $product->setMetaKeyword((string) $item->metaKeywords);
1601
+ $product->setMetaDescription((string) $item->metaDescription);
1602
+ $product->setExternalImage((string) $item->originalImageUrl);
1603
+ $product->setExternalSmallImage((string) $item->largeImageUrl);
1604
+ $product->setExternalThumbnail((string) $item->smallImageUrl);
1605
+ $product->setShipmentType(0); //shipment type (0 - together, 1 - separately
1606
+
1607
+ try {
1608
+ $product->save();
1609
+ $stockItem = Mage::getModel('cataloginventory/stock_item');
1610
+ $stockItem->assignProduct($product);
1611
+ $inventory = $item->inventory;
1612
+ $manageItem = (string) $inventory->manageStock;
1613
+ if ($manageItem == 'N') {
1614
+ $stockItem->setData('use_config_manage_stock', 0);
1615
+ $stockItem->setData('manage_stock', 0);
1616
+ } else {
1617
+ $stockItem->setData('use_config_manage_stock', 1);
1618
+ $stockItem->setData('manage_stock', 1);
1619
+ }
1620
+ $stockItem->save();
1621
+ $this->updateBundleItems($pid);
1622
+ }
1623
+ catch (Exception $e) {
1624
+ $this->customHelper->reportError($this->customHelper->__('Bunduled Prduct not updated'));
1625
+ $this->customHelper->reportError($e->getMessage());
1626
+ $this->customHelper->sendLogEmail($this->logPath);
1627
+ }
1628
+ }
1629
+ }
1630
+
1631
+ public function updateBundleItems($pid)
1632
+ {
1633
+ $bundled = Mage::getModel('catalog/product');
1634
+ $bundled->load($pid);
1635
+ $selectionCollection = $bundled->getTypeInstance(true)->getSelectionsCollection($bundled->getTypeInstance(true)->getOptionsIds($bundled), $bundled);
1636
+
1637
+ foreach ($selectionCollection as $option) {
1638
+ $optionModel = Mage::getModel('bundle/option');
1639
+ $optionModel->setId($option->option_id);
1640
+ $optionModel->delete();
1641
+ }
1642
+ }
1643
+
1644
+ public function getAttributeSetId($attrSetName)
1645
+ {
1646
+ $attributeSetId = Mage::getModel('eav/entity_attribute_set')->getCollection()->setEntityTypeFilter(4) // 4is entity type id...4= product
1647
+ ->addFieldToFilter('attribute_set_name', $attrSetName)->getFirstItem()->getAttributeSetId();
1648
+ return $attributeSetId;
1649
+ }
1650
+
1651
+ public function getItemIds($item, $Currfilepath = null, $Errfilepath = null)
1652
+ {
1653
+ $entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
1654
+ $attributeSetModel = Mage::getModel('eav/entity_attribute_set');
1655
+ $attributeSetId = 0;
1656
+ $attributeSetName = (string) $item->attributeSetId;
1657
+ if (empty($attributeSetName)) {
1658
+ $attributeSetName = "Default";
1659
+ }
1660
+
1661
+ if ($attributeSetName != "Default") {
1662
+ $mapObj = Mage::getModel('customimport/customimport');
1663
+ $externalAttrsetMappingInfoAttrSetId = $mapObj->getAttributeSetIdByExternalId($attributeSetName);
1664
+ if ($externalAttrsetMappingInfoAttrSetId == "") {
1665
+ $attributeSetId = 0;
1666
+ } else {
1667
+ $set = $attributeSetModel->load($externalAttrsetMappingInfoAttrSetId);
1668
+ if (count($set->getData()) > 0) {
1669
+ $attributeSetId = $externalAttrsetMappingInfoAttrSetId;
1670
+ }
1671
+ }
1672
+ } else {
1673
+ $attributeSetId = $attributeSetModel->getCollection()->setEntityTypeFilter($entityTypeId)->addFieldToFilter('attribute_set_name', $attributeSetName)->getFirstItem()->getAttributeSetId();
1674
+ }
1675
+
1676
+ if ($attributeSetId) {
1677
+ $sku = (string) $item->id;
1678
+ $curitemids = (isset($this->_curitemids["sku"]) ? $this->_curitemids["sku"] : null);
1679
+ if ($sku != $curitemids) {
1680
+ $cids = $this->getProductIds($sku);
1681
+ if ($cids !== false) {
1682
+ $this->_curitemids = $cids;
1683
+ } else {
1684
+ $this->_curitemids = array(
1685
+ "pid" => null,
1686
+ "sku" => $sku,
1687
+ "asid" => isset($attributeSetId) ? $attributeSetId : null
1688
+ );
1689
+ }
1690
+ $this->onNewSku($sku, ($cids !== false));
1691
+ unset($cids);
1692
+ } else {
1693
+ $this->onSameSku($sku);
1694
+ }
1695
+ return $this->_curitemids;
1696
+ } else {
1697
+ $this->customHelper->reportInfo($this->customHelper->__("Attribute set %s is not found", $attributeSetName));
1698
+ return false;
1699
+ }
1700
+ }
1701
+
1702
+ public function getProductIds($sku)
1703
+ {
1704
+ $toReturn = array();
1705
+ $product1 = Mage::getModel('catalog/product');
1706
+ $productCollection = $product1->getCollection()->addAttributeToSelect('sku', 'entity_id', 'attribute_set_id')->addAttributeToFilter('sku', $sku)->load();
1707
+ if (count($productCollection) > 0) {
1708
+ foreach ($productCollection as $product) {
1709
+ $productArr = $product->getData();
1710
+ $toReturn['pid'] = $productArr['entity_id'];
1711
+ $toReturn['asid'] = $productArr['attribute_set_id'];
1712
+ return $toReturn;
1713
+ }
1714
+ } else {
1715
+ return false;
1716
+ }
1717
+ }
1718
+
1719
+ public function clearOptCache()
1720
+ {
1721
+ unset($this->_optidcache);
1722
+ $this->_optidcache = array();
1723
+ }
1724
+
1725
+ public function onNewSku($sku, $existing)
1726
+ {
1727
+ $this->clearOptCache();
1728
+ //only assign values to store 0 by default in create mode for new sku, for store related options
1729
+ if (!$existing) {
1730
+ $this->_dstore = array(
1731
+ 0
1732
+ );
1733
+ } else {
1734
+ $this->_dstore = array();
1735
+ }
1736
+ $this->_same = false;
1737
+ }
1738
+
1739
+ public function onSameSku($sku)
1740
+ {
1741
+ unset($this->_dstore);
1742
+ $this->_dstore = array();
1743
+ $this->_same = true;
1744
+ }
1745
+
1746
+ public function createLog($msg)
1747
+ {
1748
+ $this->_log_array[] = $msg;
1749
+ }
1750
+
1751
+ public function lookup($listType)
1752
+ {
1753
+ $t0 = microtime(true);
1754
+ $count = count($listType);
1755
+ $this->_item_num = $count;
1756
+ $t1 = microtime(true);
1757
+ $time = $t1 - $t0;
1758
+ $this->customHelper->reportInfo($this->customHelper->__('Found %s records', $count));
1759
+ }
1760
+
1761
+ /*
1762
+ * create category
1763
+ * */
1764
+ protected function createCategory($item)
1765
+ {
1766
+ $default_root_category = $this->_default_category_id;
1767
+ $parent_id = ((string) $item->isRoot == 'Y') ? 1 : $default_root_category;
1768
+ $isActive = ((string) $item->isActive == 'Y') ? 1 : 0;
1769
+
1770
+ $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id);
1771
+ $parent_category = $this->_initCategory($parent_id, $this->_store_id);
1772
+ if (!$parent_category->getId()) {
1773
+ $this->customHelper->reportError($this->customHelper->__('parent category not found'));
1774
+ } else {
1775
+ $category->addData(array(
1776
+ 'path' => implode('/', $parent_category->getPathIds())
1777
+ ));
1778
+ /* @var $validator Mage_Catalog_Model_Api2_Product_Validator_Product */
1779
+ $category->setParentId($parent_category->getId());
1780
+ $category->setAttributeSetId($category->getDefaultAttributeSetId());
1781
+ $category->setData('name', (string) $item->name);
1782
+ $category->setData('include_in_menu', 1);
1783
+ $category->setData('meta_title', (string) $item->pageTitle);
1784
+ $category->setData('meta_keywords', (string) $item->metaKeywords);
1785
+ $category->setData('meta_description', (string) $item->metaDescription);
1786
+ $category->setData('description', (string) $item->description);
1787
+ $category->setData('available_sort_by', 'position');
1788
+ $category->setData('default_sort_by', 'position');
1789
+ $category->setData('is_active', $isActive);
1790
+ $category->setData('is_anchor', 1);
1791
+ $category->setData('external_id', (string) $item->id);
1792
+ $category->setData('external_cat_image', (string) $item->imageUrl);
1793
+ try {
1794
+ $validate = $category->validate();
1795
+ if ($validate !== true) {
1796
+ foreach ($validate as $code => $error) {
1797
+ if ($error === true) {
1798
+ $this->customHelper->reportError($this->customHelper->__('Attribute "%s" is required', $code));
1799
+ $this->customHelper->sendLogEmail($this->logPath);
1800
+ Mage::throwException($this->customHelper->__->__('Attribute "%s" is required.', $code));
1801
+ } else {
1802
+ $this->customHelper->reportError($error);
1803
+ $this->customHelper->sendLogEmail($this->logPath);
1804
+ Mage::throwException($error);
1805
+ }
1806
+ }
1807
+ }
1808
+ $category->save();
1809
+ }
1810
+ catch (Exception $e) {
1811
+ $this->customHelper->reportError($e->getMessage());
1812
+ $this->customHelper->sendLogEmail($this->logPath);
1813
+ }
1814
+ }
1815
+ }
1816
+
1817
+ protected function updateCategory($item, $categoryId)
1818
+ {
1819
+ $category = Mage::getModel('catalog/category')->load($categoryId);
1820
+ $isActive = ((string) $item->isActive == 'Y') ? 1 : 0;
1821
+ $category->setData('name', (string) $item->name);
1822
+ $category->setData('include_in_menu', 1);
1823
+ $category->setData('meta_title', (string) $item->pageTitle);
1824
+ $category->setData('meta_keywords', (string) $item->metaKeywords);
1825
+ $category->setData('meta_description', (string) $item->metaDescription);
1826
+ $category->setData('description', (string) $item->description);
1827
+ $category->setData('is_active', $isActive);
1828
+ $category->setData('is_anchor', 1);
1829
+ $category->setData('external_cat_image', (string) $item->imageUrl);
1830
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
1831
+ $category->save();
1832
+ }
1833
+
1834
+ /**
1835
+ * main function to import category
1836
+ */
1837
+ protected function importCategory($item)
1838
+ {
1839
+ $externalId = (string) $item->id;
1840
+ $externall = $this->checkExternalId($externalId);
1841
+
1842
+ if ($externall) {
1843
+ if (count($externall) == 1) {
1844
+ //update already existing category with this id
1845
+ reset($externall); //to take 1st key of array
1846
+ $first_key = key($externall);
1847
+ $this->updateCategory($item, $first_key);
1848
+ $this->_updated_num++;
1849
+ } else {
1850
+ foreach ($externall as $systemCatid => $v) {
1851
+ $this->updateCategory($item, $systemCatid);
1852
+ }
1853
+ }
1854
+ } else {
1855
+ // category is not available hence create new
1856
+ if (count($externall) == 0) {
1857
+ $this->createCategory($item);
1858
+ $this->_created_num++;
1859
+ }
1860
+ }
1861
+ }
1862
+
1863
+ /**
1864
+ * checks for a category existance using external id
1865
+ * @param external id of category
1866
+ */
1867
+ protected function checkExternalId($externalId)
1868
+ {
1869
+ $catsWithCustomAttr = array();
1870
+ $collection = Mage::getModel('catalog/category')->getCollection();
1871
+ $collection->addAttributeToSelect("external_id");
1872
+ //Do a left join, and get values that aren't null - you could add other conditions in the second parameter also (check out all options in the _getConditionSql method of lib/Varien/Data/Collection/Db.php
1873
+ $collection->addAttributeToFilter('external_id', $externalId, 'left');
1874
+ foreach ($collection as $category) {
1875
+ $catsWithCustomAttr[$category->getId()] = $category->getExternalId();
1876
+ }
1877
+ return $catsWithCustomAttr;
1878
+ }
1879
+
1880
+ /**
1881
+ * loads a category, if exists
1882
+ * @param category id
1883
+ */
1884
+ protected function _initCategory($categoryId, $store = null)
1885
+ {
1886
+ try {
1887
+ $category = Mage::getModel('catalog/category')->setStoreId($store)->load($categoryId);
1888
+ if (!$category->getId()) {
1889
+ $errorMsg = $this->customHelper->__('Parent category %s is not available', $categoryId);
1890
+ $this->customHelper->reportError($errorMsg);
1891
+ $this->customHelper->sendLogEmail($this->logPath);
1892
+ Mage::throwException($errorMsg);
1893
+ }
1894
+ }
1895
+ catch (Exception $e) {
1896
+ $this->customHelper->reportError($e->getMessage());
1897
+ $this->customHelper->sendLogEmail($this->logPath);
1898
+ }
1899
+ return $category;
1900
+ }
1901
+
1902
+ public function getCurrentRow()
1903
+ {
1904
+ return $this->_current_row;
1905
+ }
1906
+
1907
+ public function setCurrentRow($cnum)
1908
+ {
1909
+ $this->_current_row = $cnum;
1910
+ }
1911
+
1912
+ /*
1913
+ * associates a product with a category
1914
+ * */
1915
+ public function associateProductToCategory($productDetail, $catId) //actual id of category
1916
+ {
1917
+ $cat_api = new Mage_Catalog_Model_Category_Api;
1918
+ $newProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', (string) $productDetail->id);
1919
+ if ($newProduct) {
1920
+ $category = Mage::getModel('catalog/category')->setStoreId($this->_store_id)->load($catId);
1921
+ $positions = $category->getProductsPosition();
1922
+ $productDetail->position;
1923
+ if ((string) $productDetail->isActive == 'Y') {
1924
+ // assignproduct is default function of magento, to assign product in a category
1925
+ $cat_api->assignProduct($catId, $newProduct->getId(), (real) $productDetail->position);
1926
+ } else {
1927
+ if (isset($positions[$newProduct->getId()])) {
1928
+ // removeProduct is default function of magento, to remove product from a category
1929
+ $cat_api->removeProduct($catId, $newProduct->getId());
1930
+ }
1931
+ }
1932
+ } else {
1933
+ $this->customHelper->reportError($this->customHelper->__('Product does not exists %s', $productDetail->id));
1934
+ }
1935
+ }
1936
+
1937
+ public function makeAttributeConfigurable($superattribute_array)
1938
+ {
1939
+ $result = false;
1940
+ $model = Mage::getModel('catalog/resource_eav_attribute');
1941
+
1942
+ foreach ($superattribute_array as $attribute_id) {
1943
+ $attr = $model->loadByCode('catalog_product', $attribute_id);
1944
+ $attr_id = $attr->getAttributeId();
1945
+ if ($attr_id) {
1946
+ if ($attr_configurable = $attr->getIsConfigurable()) {
1947
+ $result = true;
1948
+ } else {
1949
+ $attribute_type = $attr->getFrontendInput();
1950
+ $_attribute_data = array();
1951
+ if ($attribute_type == 'select') {
1952
+ $_attribute_data['is_configurable'] = 1;
1953
+ $model->addData($_attribute_data);
1954
+ $attr->save();
1955
+ $result = true;
1956
+ } else {
1957
+ $this->customHelper->reportError($this->customHelper->__('Attribute %s can not be updated to become superattribute', $attribute_id));
1958
+ $result = false;
1959
+ }
1960
+ }
1961
+ } else {
1962
+ $this->customHelper->reportError($this->customHelper->__('Attribute %s does not exists', $attribute_id));
1963
+ $result = false;
1964
+ }
1965
+ }
1966
+ return $result;
1967
+ }
1968
+
1969
+ public function createAttribute($attribute)
1970
+ {
1971
+ $mapobj = Mage::getModel('customimport/customimport');
1972
+ $attr_values = (array) $attribute->values;
1973
+ $attribute_type = 'select';
1974
+ if (isset($attribute->type)) {
1975
+ $att_type = (string) $attribute->type;
1976
+ $magento_array_values = array(
1977
+ 'text',
1978
+ 'textarea',
1979
+ 'date',
1980
+ 'boolean',
1981
+ 'multiselect',
1982
+ 'select',
1983
+ 'price',
1984
+ 'media_image',
1985
+ 'weee'
1986
+ );
1987
+ if (in_array($att_type, $magento_array_values)) {
1988
+ $attribute_type = $att_type;
1989
+ }
1990
+ }
1991
+ $count_value = count($attr_values['valueDef']);
1992
+ $_attribute_data = array(
1993
+ 'attribute_code' => (string) $attribute->id,
1994
+ 'backend_model' => ($attribute_type == 'multiselect' ? 'eav/entity_attribute_backend_array' : NULL),
1995
+ 'is_global' => '1',
1996
+ 'frontend_input' => $attribute_type, //'text/select',
1997
+ 'default_value_text' => '',
1998
+ 'default_value_yesno' => '0',
1999
+ 'default_value_date' => '',
2000
+ 'default_value_textarea' => '',
2001
+ 'is_unique' => '0',
2002
+ 'is_required' => '0',
2003
+ 'apply_to' => array(
2004
+ 'simple',
2005
+ 'configurable'
2006
+ ), //array('grouped')
2007
+ 'is_configurable' => '0',
2008
+ 'is_searchable' => '0',
2009
+ 'is_visible_in_advanced_search' => '0',
2010
+ 'is_comparable' => '0',
2011
+ 'is_used_for_price_rules' => '0',
2012
+ 'is_wysiwyg_enabled' => '0',
2013
+ 'is_html_allowed_on_front' => '1',
2014
+ 'is_visible_on_front' => '1',
2015
+ 'used_in_product_listing' => '0',
2016
+ 'used_for_sort_by' => '0',
2017
+ 'frontend_label' => array(
2018
+ (string) $attribute->name
2019
+ )
2020
+ );
2021
+
2022
+ $model = Mage::getModel('catalog/resource_eav_attribute');
2023
+ $attr = $model->loadByCode('catalog_product', (string) $attribute->id);
2024
+ $attr_id = $attr->getAttributeId();
2025
+
2026
+ if ($attr_id != '') {
2027
+ $attr->addData($_attribute_data);
2028
+ $option['attribute_id'] = $attr_id;
2029
+
2030
+ if ($count_value > 0 && ($attribute_type == 'select' || $attribute_type == 'multiselect' || $attribute_type == 'text' || $attribute_type == 'textarea' || $attribute_type == 'boolean')) {
2031
+ for ($i = 0; $i < $count_value; $i++) {
2032
+ $attrdet = $attr_values['valueDef'][$i];
2033
+ $optionId = $mapobj->isOptionExistsInAttribute($attrdet->id, $attr_id);
2034
+ if (!isset($optionId)) {
2035
+ $option['value']['option_' . $i][0] = $attrdet->value;
2036
+ $option['order']['option_' . $i] = $i;
2037
+ $option['externalid']['option_' . $i] = $attrdet->id;
2038
+ } else {
2039
+ $option['value'][$optionId][0] = $attrdet->value;
2040
+ $option['order'][$optionId] = $i;
2041
+ $option['externalid'][$optionId] = $attrdet->id;
2042
+ }
2043
+ $attr->setOption($option);
2044
+ }
2045
+ }
2046
+ $attr->save();
2047
+ } else {
2048
+ if (!isset($_attribute_data['is_configurable'])) {
2049
+ $_attribute_data['is_configurable'] = 0;
2050
+ }
2051
+ if (!isset($_attribute_data['is_filterable'])) {
2052
+ $_attribute_data['is_filterable'] = 0;
2053
+ }
2054
+ if (!isset($_attribute_data['is_filterable_in_search'])) {
2055
+ $_attribute_data['is_filterable_in_search'] = 0;
2056
+ }
2057
+ if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {
2058
+ $_attribute_data['backend_type'] = $model->getBackendTypeByInput($_attribute_data['frontend_input']);
2059
+ }
2060
+ $defaultValueField = $model->getDefaultValueByInput($_attribute_data['frontend_input']);
2061
+ if ($defaultValueField) {
2062
+ $_attribute_data['default_value'] = $this->getRequest()->getParam($defaultValueField);
2063
+ }
2064
+ $model->addData($_attribute_data);
2065
+ $model->setEntityTypeId(Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId());
2066
+ $model->setIsUserDefined(1);
2067
+ try {
2068
+ $model->save();
2069
+ $attribute_code = (string) $attribute->id;
2070
+ unset($model);
2071
+ if ($count_value > 0) {
2072
+ $model = Mage::getModel('catalog/resource_eav_attribute');
2073
+ $attr = $model->loadByCode('catalog_product', (string) $attribute->id);
2074
+ $attr_id = $attr->getAttributeId();
2075
+ $option['attribute_id'] = $attr_id;
2076
+
2077
+ for ($i = 0; $i < $count_value; $i++) {
2078
+ $attrdet = $attr_values['valueDef'][$i];
2079
+ $optionId = $mapobj->isOptionExistsInAttribute($attrdet->id, $attr_id);
2080
+ if (!isset($optionId)) {
2081
+ $option['value']['option_' . $i][0] = $attrdet->value;
2082
+ $option['order']['option_' . $i] = $i;
2083
+ $option['externalid']['option_' . $i] = $attrdet->id;
2084
+ } else {
2085
+ $option['value'][$optionId][0] = $attrdet->value;
2086
+ $option['order'][$optionId] = $i;
2087
+ $option['externalid'][$optionId] = $attrdet->id;
2088
+ }
2089
+ }
2090
+ $attr->setOption($option);
2091
+ $attr->save();
2092
+ }
2093
+ }
2094
+ catch (Exception $e) {
2095
+ $this->customHelper->reportError($this->customHelper->__('Sorry, error occured while trying to save the attribute. Error: %s', $e->getMessage()));
2096
+ $this->customHelper->sendLogEmail($this->logPath);
2097
+ }
2098
+ }
2099
+ }
2100
+
2101
+ public function getEntityTypeId()
2102
+ {
2103
+ return $entityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
2104
+ }
2105
+
2106
+ public function getInstaller()
2107
+ {
2108
+ return new Mage_Catalog_Model_Resource_Eav_Mysql4_Setup('core_setup');
2109
+ }
2110
+
2111
+ private function _getMageId($attriextid)
2112
+ {
2113
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
2114
+ $select = $connection->select()->from('external_attrsetmapping_info', 'magento_id')->where('external_id=?', "$attriextid");
2115
+ $rowArray = $connection->fetchRow($select);
2116
+ return $rowArray['magento_id'];
2117
+ }
2118
+
2119
+ private function _changeVisibility($proid)
2120
+ {
2121
+ $product = Mage::getModel('catalog/product');
2122
+ $product->load($proid);
2123
+ $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
2124
+ $product->save();
2125
+ }
2126
+ }
2127
+ ?>
app/code/{community → local}/Gec/Customimport/Block/Catalog/Product/Attribute/Edit/Tab/Options.php RENAMED
@@ -1,86 +1,86 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Block_Catalog_Product_Attribute_Edit_Tab_Options extends Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
21
- {
22
- public function __construct()
23
- {
24
- parent::__construct();
25
- $this->setTemplate('gec/catalog/product/attribute/options.phtml');
26
- }
27
-
28
- public function getOptionValues()
29
- {
30
- $attributeType = $this->getAttributeObject()->getFrontendInput();
31
- $defaultValues = $this->getAttributeObject()->getDefaultValue();
32
- if ($attributeType == 'select' || $attributeType == 'multiselect') {
33
- $defaultValues = explode(',', $defaultValues);
34
- } else {
35
- $defaultValues = array();
36
- }
37
-
38
- switch ($attributeType) {
39
- case 'select':
40
- $inputType = 'radio';
41
- break;
42
- case 'multiselect':
43
- $inputType = 'checkbox';
44
- break;
45
- default:
46
- $inputType = '';
47
- break;
48
- }
49
-
50
- $values = $this->getData('option_values');
51
- if (is_null($values)) {
52
- $values = array();
53
- $optionCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
54
- ->setAttributeFilter($this->getAttributeObject()->getId())
55
- ->setPositionOrder('desc', true)
56
- ->load();
57
-
58
- foreach ($optionCollection as $option) {
59
- $value = array();
60
- if (in_array($option->getId(), $defaultValues)) {
61
- $value['checked'] = 'checked="checked"';
62
- } else {
63
- $value['checked'] = '';
64
- }
65
-
66
- $value['intype'] = $inputType;
67
- $value['id'] = $option->getId();
68
- $value['sort_order'] = $option->getSortOrder();
69
- $value['externalid'] = $option->getExternalid();
70
- foreach ($this->getStores() as $store) {
71
- $storeValues = $this->getStoreOptionValues($store->getId());
72
- if (isset($storeValues[$option->getId()])) {
73
- $value['store'.$store->getId()] = htmlspecialchars($storeValues[$option->getId()]);
74
- }
75
- else {
76
- $value['store'.$store->getId()] = '';
77
- }
78
- }
79
- $values[] = new Varien_Object($value);
80
- }
81
- $this->setData('option_values', $values);
82
- }
83
-
84
- return $values;
85
- }
86
  }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Block_Catalog_Product_Attribute_Edit_Tab_Options extends Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
21
+ {
22
+ public function __construct()
23
+ {
24
+ parent::__construct();
25
+ $this->setTemplate('gec/catalog/product/attribute/options.phtml');
26
+ }
27
+
28
+ public function getOptionValues()
29
+ {
30
+ $attributeType = $this->getAttributeObject()->getFrontendInput();
31
+ $defaultValues = $this->getAttributeObject()->getDefaultValue();
32
+ if ($attributeType == 'select' || $attributeType == 'multiselect') {
33
+ $defaultValues = explode(',', $defaultValues);
34
+ } else {
35
+ $defaultValues = array();
36
+ }
37
+
38
+ switch ($attributeType) {
39
+ case 'select':
40
+ $inputType = 'radio';
41
+ break;
42
+ case 'multiselect':
43
+ $inputType = 'checkbox';
44
+ break;
45
+ default:
46
+ $inputType = '';
47
+ break;
48
+ }
49
+
50
+ $values = $this->getData('option_values');
51
+ if (is_null($values)) {
52
+ $values = array();
53
+ $optionCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
54
+ ->setAttributeFilter($this->getAttributeObject()->getId())
55
+ ->setPositionOrder('desc', true)
56
+ ->load();
57
+
58
+ foreach ($optionCollection as $option) {
59
+ $value = array();
60
+ if (in_array($option->getId(), $defaultValues)) {
61
+ $value['checked'] = 'checked="checked"';
62
+ } else {
63
+ $value['checked'] = '';
64
+ }
65
+
66
+ $value['intype'] = $inputType;
67
+ $value['id'] = $option->getId();
68
+ $value['sort_order'] = $option->getSortOrder();
69
+ $value['externalid'] = $option->getExternalid();
70
+ foreach ($this->getStores() as $store) {
71
+ $storeValues = $this->getStoreOptionValues($store->getId());
72
+ if (isset($storeValues[$option->getId()])) {
73
+ $value['store'.$store->getId()] = htmlspecialchars($storeValues[$option->getId()]);
74
+ }
75
+ else {
76
+ $value['store'.$store->getId()] = '';
77
+ }
78
+ }
79
+ $values[] = new Varien_Object($value);
80
+ }
81
+ $this->setData('option_values', $values);
82
+ }
83
+
84
+ return $values;
85
+ }
86
  }
app/code/local/Gec/Customimport/Helper/Catalog/Image.php ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Helper_Catalog_Image extends Mage_Catalog_Helper_Image
21
+ {
22
+
23
+ protected $_requestedImage;
24
+
25
+ /**
26
+ * Reset all previous data
27
+ *
28
+ * @return Mage_Catalog_Helper_Image
29
+ */
30
+ protected function _reset()
31
+ {
32
+ $this->_model = null;
33
+ $this->_scheduleResize = false;
34
+ $this->_scheduleRotate = false;
35
+ $this->_angle = null;
36
+ $this->_watermark = null;
37
+ $this->_watermarkPosition = null;
38
+ $this->_watermarkSize = null;
39
+ $this->_watermarkImageOpacity = null;
40
+ $this->_product = null;
41
+ $this->_imageFile = null;
42
+ $this->_requestedImage = null;
43
+ return $this;
44
+ }
45
+
46
+ /**
47
+ * Initialize Helper to work with Image
48
+ *
49
+ * @param Mage_Catalog_Model_Product $product
50
+ * @param string $attributeName
51
+ * @param mixed $imageFile
52
+ * @return Mage_Catalog_Helper_Image
53
+ */
54
+ public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null)
55
+ {
56
+ $this->_reset();
57
+ $this->_setModel(Mage::getModel('catalog/product_image'));
58
+ $this->_getModel()->setDestinationSubdir($attributeName);
59
+ $this->setProduct($product);
60
+
61
+ $this->_requestedImage = $attributeName;
62
+
63
+ $this->setWatermark(
64
+ Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image")
65
+ );
66
+ $this->setWatermarkImageOpacity(
67
+ Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity")
68
+ );
69
+ $this->setWatermarkPosition(
70
+ Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position")
71
+ );
72
+ $this->setWatermarkSize(
73
+ Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size")
74
+ );
75
+
76
+ if ($imageFile) {
77
+ $this->setImageFile($imageFile);
78
+ } else {
79
+ // add for work original size
80
+ $this->_getModel()->setBaseFile($this->getProduct()->getData($this->_getModel()->getDestinationSubdir()));
81
+ }
82
+ return $this;
83
+ }
84
+
85
+ /**
86
+ * Return Image URL
87
+ *
88
+ * @return string
89
+ */
90
+ public function __toString()
91
+ {
92
+ if(Mage::getStoreConfig("catalog/proimgusage/imgusage")){
93
+ try {
94
+ $model = $this->_getModel();
95
+ if ($this->getImageFile()) {
96
+ $model->setBaseFile($this->getImageFile());
97
+ } else {
98
+ $path = Mage::getBaseDir('media').'/catalog/product';
99
+ if($this->getProduct()->getData($model->getDestinationSubdir()) == "no_selection" || !is_file($path.$this->getProduct()->getData($model->getDestinationSubdir()))){
100
+ try{
101
+ $model = $this->_getModel();
102
+ if ($this->getImageFile()) {
103
+ $model->setBaseFile($this->getImageFile());
104
+ } else {
105
+ $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
106
+ }
107
+
108
+ if($this->_requestedImage == 'image' || $this->_requestedImage == 'small_image' || $this->_requestedImage == 'thumbnail'){
109
+ $external_attribute = 'external_'.$this->_requestedImage;
110
+ $_product = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
111
+ $externalImg = $_product->getData($external_attribute);
112
+
113
+ }
114
+ if ($model->isCached()) {
115
+ if($externalImg){
116
+ return $externalImg;
117
+ }
118
+ return $model->getUrl();
119
+ } else {
120
+ if ($this->_scheduleRotate) {
121
+ $model->rotate($this->getAngle());
122
+ }
123
+
124
+ if ($this->_scheduleResize) {
125
+ $model->resize();
126
+ }
127
+
128
+ if ($this->getWatermark()) {
129
+ $model->setWatermark($this->getWatermark());
130
+ }
131
+
132
+ $url = $model->saveFile()->getUrl();
133
+ if($externalImg){
134
+ $url = $externalImg;
135
+ }
136
+ }
137
+ }catch (Exception $e) {
138
+ $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
139
+ }
140
+ return $url;
141
+ }else{
142
+ $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
143
+ }
144
+ }
145
+
146
+ if ($model->isCached()) {
147
+ return $model->getUrl();
148
+ } else {
149
+ if ($this->_scheduleRotate) {
150
+ $model->rotate($this->getAngle());
151
+ }
152
+
153
+ if ($this->_scheduleResize) {
154
+ $model->resize();
155
+ }
156
+
157
+ if ($this->getWatermark()) {
158
+ $model->setWatermark($this->getWatermark());
159
+ }
160
+
161
+ $url = $model->saveFile()->getUrl();
162
+ }
163
+ } catch (Exception $e) {
164
+ $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
165
+ }
166
+ return $url;
167
+ } else {
168
+
169
+ try {
170
+ // echo $this->_requestedImage;
171
+
172
+ $model = $this->_getModel();
173
+ if ($this->getImageFile()) {
174
+ $model->setBaseFile($this->getImageFile());
175
+ } else {
176
+ $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
177
+ }
178
+
179
+ if($this->_requestedImage == 'image' || $this->_requestedImage == 'small_image' || $this->_requestedImage == 'thumbnail'){
180
+ $external_attribute = 'external_'.$this->_requestedImage;
181
+ $_product = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
182
+ $externalImg = $_product->getData($external_attribute);
183
+
184
+ }
185
+
186
+
187
+ if ($model->isCached()) {
188
+ // return 'http://staging.serenusinfotech.com/smikum/gec/skin/frontend/default/default/images/media/col_left_callout.jpg';
189
+ if($externalImg){
190
+ return $externalImg;
191
+ }
192
+ return $model->getUrl();
193
+ } else {
194
+ if ($this->_scheduleRotate) {
195
+ $model->rotate($this->getAngle());
196
+ }
197
+
198
+ if ($this->_scheduleResize) {
199
+ $model->resize();
200
+ }
201
+
202
+ if ($this->getWatermark()) {
203
+ $model->setWatermark($this->getWatermark());
204
+ }
205
+
206
+ $url = $model->saveFile()->getUrl();
207
+ if($externalImg){
208
+ $url = $externalImg;
209
+ }
210
+ }
211
+ } catch (Exception $e) {
212
+ $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
213
+ }
214
+ return $url;
215
+ // return 'http://staging.serenusinfotech.com/smikum/gec/skin/frontend/default/default/images/media/col_left_callout.jpg';
216
+
217
+ } // If condition over
218
+
219
+ } // Function over
220
+
221
+ } // Class over
app/code/local/Gec/Customimport/Helper/Data.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Helper_Data extends Mage_Core_Helper_Abstract
21
+ {
22
+ public function writeCustomLog($msg, $path = null) {
23
+ if($path == null){
24
+ $path = Mage::getBaseDir('log').'/customimport.log';
25
+ }
26
+ error_log("[".date('Y:m:d H:i:s', time())."] : ".print_r($msg, true)."<br/> \r\n", 3, $path);
27
+ }
28
+
29
+ public function sendLogEmail($logPath = '')
30
+ {
31
+ $logPath = Mage::getBaseDir('log').'/customimport.log';
32
+ $logMessage = file_get_contents($logPath);
33
+ if($logMessage) {
34
+ $finalImportStatus = null;
35
+ $logSubject = 'Catalog Import Report - '.$_SERVER['SERVER_NAME'].' - '.date('Y:m:d H:i:s T', time());
36
+ $emailTemplate = Mage::getModel('core/email_template')->loadDefault('import_status');
37
+ $senderName = Mage::getStoreConfig('trans_email/ident_general/name');
38
+ $senderEmail = Mage::getStoreConfig('trans_email/ident_general/email');
39
+ $emailTemplateVariables = array();
40
+ $emailTemplateVariables['msgcol'] = $logMessage;
41
+ $emailTemplateVariables['finalstatus'] = $finalImportStatus;
42
+ $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
43
+ $reciverEmail= Mage::getStoreConfig('trans_email/ident_custom1/email');
44
+ $mail = Mage::getModel('core/email')
45
+ ->setToName($senderName)
46
+ ->setToEmail($reciverEmail)
47
+ ->setBody($processedTemplate)
48
+ ->setSubject($logSubject)
49
+ ->setFromEmail($senderEmail)
50
+ ->setFromName($senderName)
51
+ ->setType('html');
52
+ try{
53
+ $mail->send();
54
+ }
55
+ catch(Exception $error)
56
+ {
57
+ Mage::getSingleton('core/session')->addError($error->getMessage());
58
+ return false;
59
+ }
60
+ } else {
61
+ Mage::getSingleton('core/session')->addError('there were no log report generated...!');
62
+ return false;
63
+ }
64
+
65
+ }
66
+
67
+ public function getCurrentLocaleDateTime($defaultUTCDate)
68
+ {
69
+ return date('Y-m-d H:i:s', Mage::getModel('core/date')->timestamp(strtotime($defaultUTCDate)));
70
+ }
71
+
72
+ public function reportInfo($msg){
73
+ $msg = '<span style="color:blue;">'.$msg.'</span>';
74
+ $this->writeCustomLog($msg);
75
+ echo "<br/><br/>".$msg;
76
+ }
77
+
78
+ public function reportError($msg){
79
+ $msg = '<span style="color:red;">'.$msg.'</span>';
80
+ $this->writeCustomLog($msg);
81
+ echo "<br/><br/>".$msg;
82
+ }
83
+
84
+ public function reportSuccess($msg){
85
+ $msg = '<span style="color:#009900;">'.$msg.'</span>';
86
+ $this->writeCustomLog($msg);
87
+ echo "<br/><br/>".$msg;
88
+ }
89
+ }
app/code/{community → local}/Gec/Customimport/Model/Attrgroup.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Attrgroup extends Mage_Core_Model_Abstract {
21
- /**
22
- * Constructor
23
- */
24
- protected function _construct()
25
- {
26
- $this->_init('customimport/attrgroup');
27
- }
28
- }
29
-
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Attrgroup extends Mage_Core_Model_Abstract {
21
+ /**
22
+ * Constructor
23
+ */
24
+ protected function _construct()
25
+ {
26
+ $this->_init('customimport/attrgroup');
27
+ }
28
+ }
29
+
30
  ?>
app/code/{community → local}/Gec/Customimport/Model/Attrsetmapping.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Attrsetmapping extends Mage_Core_Model_Abstract
21
- {
22
- /**
23
- * Constructor
24
- */
25
- protected function _construct()
26
- {
27
- $this->_init('customimport/attrsetmapping');
28
- }
29
- }
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Attrsetmapping extends Mage_Core_Model_Abstract
21
+ {
22
+ /**
23
+ * Constructor
24
+ */
25
+ protected function _construct()
26
+ {
27
+ $this->_init('customimport/attrsetmapping');
28
+ }
29
+ }
30
  ?>
app/code/{community → local}/Gec/Customimport/Model/Catalog/Resource/Eav/Mysql4/Attribute.php RENAMED
@@ -1,105 +1,105 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Catalog_Resource_Eav_Mysql4_Attribute extends Mage_Catalog_Model_Resource_Eav_Mysql4_Attribute
21
- {
22
- protected function _saveOption(Mage_Core_Model_Abstract $object)
23
- {
24
- $option = $object->getOption();
25
- if (is_array($option)) {
26
- $write = $this->_getWriteAdapter();
27
- $optionTable = $this->getTable('attribute_option');
28
- $optionValueTable = $this->getTable('attribute_option_value');
29
- $stores = Mage::getModel('core/store')
30
- ->getResourceCollection()
31
- ->setLoadDefault(true)
32
- ->load();
33
-
34
- if (isset($option['value'])) {
35
- $attributeDefaultValue = array();
36
- if (!is_array($object->getDefault())) {
37
- $object->setDefault(array());
38
- }
39
-
40
- foreach ($option['value'] as $optionId => $values) {
41
- $intOptionId = (int) $optionId;
42
- if (!empty($option['delete'][$optionId])) {
43
- if ($intOptionId) {
44
- $condition = $write->quoteInto('option_id=?', $intOptionId);
45
- $write->delete($optionTable, $condition);
46
- }
47
-
48
- continue;
49
- }
50
-
51
- if (!$intOptionId) {
52
- $data = array(
53
- 'attribute_id' => $object->getId(),
54
- 'sort_order' => isset($option['order'][$optionId]) ? $option['order'][$optionId] : 0,
55
- 'externalid' => isset($option['externalid'][$optionId]) ? $option['externalid'][$optionId] : '',
56
- );
57
- $write->insert($optionTable, $data);
58
- $intOptionId = $write->lastInsertId();
59
- }
60
- else {
61
- $data = array(
62
- 'sort_order' => isset($option['order'][$optionId]) ? $option['order'][$optionId] : 0,
63
- 'externalid' => isset($option['externalid'][$optionId]) ? $option['externalid'][$optionId] : '',
64
- );
65
- $write->update($optionTable, $data, $write->quoteInto('option_id=?', $intOptionId));
66
- }
67
-
68
- if (in_array($optionId, $object->getDefault())) {
69
- if ($object->getFrontendInput() == 'multiselect') {
70
- $attributeDefaultValue[] = $intOptionId;
71
- } else if ($object->getFrontendInput() == 'select') {
72
- $attributeDefaultValue = array($intOptionId);
73
- }
74
- }
75
-
76
-
77
- // Default value
78
- if (!isset($values[0])) {
79
- Mage::throwException(Mage::helper('eav')->__('Default option value is not defined.'));
80
- }
81
-
82
- $write->delete($optionValueTable, $write->quoteInto('option_id=?', $intOptionId));
83
- foreach ($stores as $store) {
84
- if (isset($values[$store->getId()]) && (!empty($values[$store->getId()]) || $values[$store->getId()] == "0")) {
85
- $data = array(
86
- 'option_id' => $intOptionId,
87
- 'store_id' => $store->getId(),
88
- 'value' => $values[$store->getId()],
89
- );
90
- $write->insert($optionValueTable, $data);
91
- }
92
- }
93
- }
94
-
95
- $write->update($this->getMainTable(), array(
96
- 'default_value' => implode(',', $attributeDefaultValue)
97
- ), $write->quoteInto($this->getIdFieldName() . '=?', $object->getId()));
98
- }
99
- }
100
- return $this;
101
-
102
-
103
- }
104
-
105
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Catalog_Resource_Eav_Mysql4_Attribute extends Mage_Catalog_Model_Resource_Eav_Mysql4_Attribute
21
+ {
22
+ protected function _saveOption(Mage_Core_Model_Abstract $object)
23
+ {
24
+ $option = $object->getOption();
25
+ if (is_array($option)) {
26
+ $write = $this->_getWriteAdapter();
27
+ $optionTable = $this->getTable('attribute_option');
28
+ $optionValueTable = $this->getTable('attribute_option_value');
29
+ $stores = Mage::getModel('core/store')
30
+ ->getResourceCollection()
31
+ ->setLoadDefault(true)
32
+ ->load();
33
+
34
+ if (isset($option['value'])) {
35
+ $attributeDefaultValue = array();
36
+ if (!is_array($object->getDefault())) {
37
+ $object->setDefault(array());
38
+ }
39
+
40
+ foreach ($option['value'] as $optionId => $values) {
41
+ $intOptionId = (int) $optionId;
42
+ if (!empty($option['delete'][$optionId])) {
43
+ if ($intOptionId) {
44
+ $condition = $write->quoteInto('option_id=?', $intOptionId);
45
+ $write->delete($optionTable, $condition);
46
+ }
47
+
48
+ continue;
49
+ }
50
+
51
+ if (!$intOptionId) {
52
+ $data = array(
53
+ 'attribute_id' => $object->getId(),
54
+ 'sort_order' => isset($option['order'][$optionId]) ? $option['order'][$optionId] : 0,
55
+ 'externalid' => isset($option['externalid'][$optionId]) ? $option['externalid'][$optionId] : '',
56
+ );
57
+ $write->insert($optionTable, $data);
58
+ $intOptionId = $write->lastInsertId();
59
+ }
60
+ else {
61
+ $data = array(
62
+ 'sort_order' => isset($option['order'][$optionId]) ? $option['order'][$optionId] : 0,
63
+ 'externalid' => isset($option['externalid'][$optionId]) ? $option['externalid'][$optionId] : '',
64
+ );
65
+ $write->update($optionTable, $data, $write->quoteInto('option_id=?', $intOptionId));
66
+ }
67
+
68
+ if (in_array($optionId, $object->getDefault())) {
69
+ if ($object->getFrontendInput() == 'multiselect') {
70
+ $attributeDefaultValue[] = $intOptionId;
71
+ } else if ($object->getFrontendInput() == 'select') {
72
+ $attributeDefaultValue = array($intOptionId);
73
+ }
74
+ }
75
+
76
+
77
+ // Default value
78
+ if (!isset($values[0])) {
79
+ Mage::throwException(Mage::helper('eav')->__('Default option value is not defined.'));
80
+ }
81
+
82
+ $write->delete($optionValueTable, $write->quoteInto('option_id=?', $intOptionId));
83
+ foreach ($stores as $store) {
84
+ if (isset($values[$store->getId()]) && (!empty($values[$store->getId()]) || $values[$store->getId()] == "0")) {
85
+ $data = array(
86
+ 'option_id' => $intOptionId,
87
+ 'store_id' => $store->getId(),
88
+ 'value' => $values[$store->getId()],
89
+ );
90
+ $write->insert($optionValueTable, $data);
91
+ }
92
+ }
93
+ }
94
+
95
+ $write->update($this->getMainTable(), array(
96
+ 'default_value' => implode(',', $attributeDefaultValue)
97
+ ), $write->quoteInto($this->getIdFieldName() . '=?', $object->getId()));
98
+ }
99
+ }
100
+ return $this;
101
+
102
+
103
+ }
104
+
105
+ }
app/code/{community → local}/Gec/Customimport/Model/Catalogentity.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Catalogentity extends Mage_Core_Model_Abstract
21
- {
22
- /**
23
- * Constructor
24
- */
25
- protected function _construct()
26
- {
27
- $this->_init('customimport/catalogentity');
28
- }
29
- }
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Catalogentity extends Mage_Core_Model_Abstract
21
+ {
22
+ /**
23
+ * Constructor
24
+ */
25
+ protected function _construct()
26
+ {
27
+ $this->_init('customimport/catalogentity');
28
+ }
29
+ }
30
  ?>
app/code/local/Gec/Customimport/Model/Customimport.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Customimport extends Mage_Core_Model_Abstract
21
+ {
22
+
23
+ protected $customHelper;
24
+ protected $logPath;
25
+
26
+ public function __construct()
27
+ {
28
+ parent::__construct();
29
+ $this->customHelper = Mage::helper('customimport');
30
+ $this->logPath = Mage::getBaseDir('log') . '/customimport.log';
31
+ }
32
+
33
+ public function _construct()
34
+ {
35
+ parent::_construct();
36
+ $this->_init('customimport/customimport');
37
+ }
38
+
39
+ /*to fetch the default set id by external set id*/
40
+ public function getAttributeSetIdByExternalId($externalId)
41
+ {
42
+ $attrsetmappingCollection = Mage::getModel('customimport/attrsetmapping')->getCollection()
43
+ ->addFieldToFilter('external_id', array('eq' => $externalId));
44
+ return $attrsetmappingCollection->getFirstItem()->getMagentoId();
45
+ }
46
+
47
+ /*to insert a row for external id and default id of attribute set*/
48
+ public function mapAttributeSet($externalId, $magentoId)
49
+ {
50
+ $attrsetmapping = Mage::getModel('customimport/attrsetmapping');
51
+ $data = array(
52
+ 'external_id' => $externalId,
53
+ 'magento_id' => $magentoId
54
+ );
55
+ $attrsetmapping->setData($data);
56
+ $attrsetmapping->save();
57
+ }
58
+
59
+ /*to check if attribute group exists in attribute set*/
60
+ public function getAttributeGroupByExternalId($externalId, $attributeSetId)
61
+ {
62
+ $attrgroupCollection = Mage::getModel('customimport/attrgroup')->getCollection()
63
+ ->addFieldToFilter('external_id', array('eq' => $externalId))
64
+ ->addFieldToFilter('attribute_set_id', array('eq' => $attributeSetId));
65
+ return $attrgroupCollection->getFirstItem()->getMagentoId();
66
+ }
67
+
68
+ /*to insert a row to define relation between external id ,magento id of group along with setid*/
69
+ public function mapAttributeGroup($externalId, $magentoId, $attributeSetId)
70
+ {
71
+ $attrgroup = Mage::getModel('customimport/attrgroup');
72
+ $attrgroup->setData(array(
73
+ 'external_id' => $externalId,
74
+ 'magento_id' => $magentoId,
75
+ 'attribute_set_id' => $attributeSetId
76
+ ))->save();
77
+ }
78
+
79
+ /*to get default group id from attribute group table using set id*/
80
+ public function getGroupIdUsingSetId($attribute_group_name, $attributeSetId)
81
+ {
82
+ $eavattributegroupCollection = Mage::getModel('customimport/eavattributegroup')->getCollection()
83
+ ->addFieldToFilter('attribute_group_name', array('eq' => $attribute_group_name))
84
+ ->addFieldToFilter('attribute_set_id', array('eq' => $attributeSetId));
85
+ return $eavattributegroupCollection->getFirstItem()->getAttributeGroupId();
86
+ }
87
+
88
+ public function isAttributeExistsInGroup($attribute_id, $attributeGroupId)
89
+ {
90
+ $eaventityattributeCollection = Mage::getModel('customimport/eaventityattribute')->getCollection()
91
+ ->addFieldToFilter('attribute_group_id', array('eq' => $attributeGroupId))
92
+ ->addFieldToFilter('attribute_id', array('eq' => $attribute_id));
93
+ return $eaventityattributeCollection->getFirstItem()->getEntityAttributeId();
94
+ }
95
+
96
+ public function updateSequenceOfAttribute($attributeGroupId, $attribute_id, $attribute_sort_order, $attribute_code = '')
97
+ {
98
+ $eaventityattribute = Mage::getModel('customimport/eaventityattribute');
99
+ $eaventityattributeCollection = $eaventityattribute->getCollection()->addFieldToFilter('attribute_group_id', array(
100
+ 'eq' => $attributeGroupId
101
+ ))->addFieldToFilter('attribute_id', array(
102
+ 'eq' => $attribute_id
103
+ ));
104
+ $id = $eaventityattributeCollection->getFirstItem()->getEntityAttributeId();
105
+ $attribid = $eaventityattributeCollection->getFirstItem()->getAttributeId();
106
+ $data = array(
107
+ 'sort_order' => $attribute_sort_order
108
+ );
109
+ if ($id) {
110
+ $eaventityattribute->load($id)->addData($data);
111
+ try {
112
+ $eaventityattribute->setEntityAttributeId($id)->save();
113
+ $this->customHelper->reportSuccess($this->customHelper->__('Attribute %s is updated successfully in %s attribute group', $attribute_code, $attributeGroupId));
114
+ }
115
+ catch (Exception $e) {
116
+ $this->customHelper->reportError($e->getMessage());
117
+ $this->customHelper->sendLogEmail($this->logPath);
118
+ }
119
+ }
120
+ }
121
+
122
+ public function isOptionExistsInAttribute($external_id, $attributeId)
123
+ {
124
+ $eavattributeoptionCollection = Mage::getModel('customimport/eavattributeoption')->getCollection()
125
+ ->addFieldToFilter('attribute_id', array('eq' => $attributeId))
126
+ ->addFieldToFilter('externalid', array('eq' => $external_id));
127
+ return $eavattributeoptionCollection->getFirstItem()->getOptionId();
128
+ }
129
+
130
+ public function isSubcategoryExists($external_subcat_id, $parent_id)
131
+ {
132
+ $externalcatCollection = Mage::getModel('customimport/externalcategorymappinginfo')->getCollection()
133
+ ->addFieldToFilter('external_id', array('eq' => $external_subcat_id))
134
+ ->addFieldToFilter('magento_pid', array('eq' => $parent_id));
135
+ return $externalcatCollection->getFirstItem()->getMagentoId();
136
+ }
137
+
138
+ public function isCategoryExists($external_subcat_id)
139
+ {
140
+ $externalcatCollection = Mage::getModel('customimport/externalcategorymappinginfo')->getCollection()
141
+ ->addFieldToFilter('external_id', array('eq' => $external_subcat_id));
142
+ return $externalcatCollection->getFirstItem()->getMagentoId();
143
+ }
144
+
145
+ public function updateCategoryMappingInfo($externalId, $magentoId, $externalParentId, $parentId)
146
+ {
147
+ $externalcatmappinginfo = Mage::getModel('customimport/externalcategorymappinginfo');
148
+ $externalcatmappinginfo->setData(array(
149
+ 'external_id' => $externalId,
150
+ 'magento_id' => $magentoId,
151
+ 'external_pid' => $externalParentId,
152
+ 'magento_pid' => $parentId
153
+ ))->save();
154
+ }
155
+
156
+ public function updateParent($parentId, $categoryId)
157
+ {
158
+ $data = array(
159
+ 'parent_id' => $parentId
160
+ );
161
+ $catalogentity = Mage::getModel('customimport/catalogentity')->load($categoryId)->addData($data);
162
+ try {
163
+ $catalogentity->setEntityId($categoryId)->save();
164
+ }
165
+ catch (Exception $e) {
166
+ $this->customHelper->reportError($e->getMessage());
167
+ $this->customHelper->sendLogEmail($this->logPath);
168
+ }
169
+ }
170
+
171
+ public function getOptVal($externalId)
172
+ {
173
+ $optCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')->addFieldToFilter('externalid', $externalId);
174
+ $optCollection->getSelect()->joinLeft(array(
175
+ "t1" => 'eav_attribute_option_value'
176
+ ), 'main_table.option_id = t1.option_id', array(
177
+ "value" => "t1.value"
178
+ ));
179
+ return $optCollection->getFirstItem();
180
+ }
181
+ }
app/code/{community → local}/Gec/Customimport/Model/Eavattributegroup.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Eavattributegroup extends Mage_Core_Model_Abstract {
21
- /**
22
- * Constructor
23
- */
24
- protected function _construct()
25
- {
26
- $this->_init('customimport/eavattributegroup');
27
- }
28
- }
29
-
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Eavattributegroup extends Mage_Core_Model_Abstract {
21
+ /**
22
+ * Constructor
23
+ */
24
+ protected function _construct()
25
+ {
26
+ $this->_init('customimport/eavattributegroup');
27
+ }
28
+ }
29
+
30
  ?>
app/code/{community → local}/Gec/Customimport/Model/Eavattributeoption.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Eavattributeoption extends Mage_Core_Model_Abstract {
21
- /**
22
- * Constructor
23
- */
24
- protected function _construct()
25
- {
26
- $this->_init('customimport/eavattributeoption');
27
- }
28
- }
29
-
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Eavattributeoption extends Mage_Core_Model_Abstract {
21
+ /**
22
+ * Constructor
23
+ */
24
+ protected function _construct()
25
+ {
26
+ $this->_init('customimport/eavattributeoption');
27
+ }
28
+ }
29
+
30
  ?>
app/code/{community → local}/Gec/Customimport/Model/Eaventityattribute.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Eaventityattribute extends Mage_Core_Model_Abstract {
21
- /**
22
- * Constructor
23
- */
24
- protected function _construct()
25
- {
26
- $this->_init('customimport/eaventityattribute');
27
- }
28
- }
29
-
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Eaventityattribute extends Mage_Core_Model_Abstract {
21
+ /**
22
+ * Constructor
23
+ */
24
+ protected function _construct()
25
+ {
26
+ $this->_init('customimport/eaventityattribute');
27
+ }
28
+ }
29
+
30
  ?>
app/code/{community → local}/Gec/Customimport/Model/Externalcategorymappinginfo.php RENAMED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Externalcategorymappinginfo extends Mage_Core_Model_Abstract {
21
- /**
22
- * Constructor
23
- */
24
- protected function _construct()
25
- {
26
- $this->_init('customimport/externalcategorymappinginfo');
27
- }
28
- }
29
-
30
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Externalcategorymappinginfo extends Mage_Core_Model_Abstract {
21
+ /**
22
+ * Constructor
23
+ */
24
+ protected function _construct()
25
+ {
26
+ $this->_init('customimport/externalcategorymappinginfo');
27
+ }
28
+ }
29
+
30
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrgroup.php RENAMED
@@ -1,28 +1,28 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Attrgroup extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the external_attrgroup_id refers to the key field in your database table.
25
- $this->_init('customimport/attrgroup', 'external_attrgroup_id');
26
- }
27
-
28
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Attrgroup extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the external_attrgroup_id refers to the key field in your database table.
25
+ $this->_init('customimport/attrgroup', 'external_attrgroup_id');
26
+ }
27
+
28
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrgroup/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Attrgroup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/attrgroup');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Attrgroup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/attrgroup');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrsetmapping.php RENAMED
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Attrsetmapping extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the external_attrsetmapping_id refers to the key field in your database table.
25
-
26
- $this->_init('customimport/attrsetmapping', 'external_attrsetmapping_id');
27
- }
28
-
29
- }
30
-
31
-
32
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Attrsetmapping extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the external_attrsetmapping_id refers to the key field in your database table.
25
+
26
+ $this->_init('customimport/attrsetmapping', 'external_attrsetmapping_id');
27
+ }
28
+
29
+ }
30
+
31
+
32
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Attrsetmapping/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Attrsetmapping_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/attrsetmapping');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Attrsetmapping_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/attrsetmapping');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Catalogentity.php RENAMED
@@ -1,31 +1,31 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Catalogentity extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the entity_id refers to the key field in your database table.
25
- $this->_init('customimport/catalogentity', 'entity_id');
26
- }
27
-
28
- }
29
-
30
-
31
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Catalogentity extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the entity_id refers to the key field in your database table.
25
+ $this->_init('customimport/catalogentity', 'entity_id');
26
+ }
27
+
28
+ }
29
+
30
+
31
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Catalogentity/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Catalogentity_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/catalogentity');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Catalogentity_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/catalogentity');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Customimport.php RENAMED
@@ -1,27 +1,27 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Customimport extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the entity_id refers to the key field in your database table.
25
- $this->_init('customimport/customimport', 'customimport_id');
26
- }
27
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Customimport extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the entity_id refers to the key field in your database table.
25
+ $this->_init('customimport/customimport', 'customimport_id');
26
+ }
27
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Customimport/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Customimport_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/customimport');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Customimport_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/customimport');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributegroup.php RENAMED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Eavattributegroup extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the attribute_group_id refers to the key field in your database table.
25
- $this->_init('customimport/eavattributegroup', 'attribute_group_id');
26
- }
27
-
28
- }
29
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Eavattributegroup extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the attribute_group_id refers to the key field in your database table.
25
+ $this->_init('customimport/eavattributegroup', 'attribute_group_id');
26
+ }
27
+
28
+ }
29
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributegroup/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Eavattributegroup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/eavattributegroup');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Eavattributegroup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/eavattributegroup');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributeoption.php RENAMED
@@ -1,31 +1,31 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Eavattributeoption extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the option_id refers to the key field in your database table.
25
- $this->_init('customimport/eavattributeoption', 'option_id');
26
- }
27
-
28
- }
29
-
30
-
31
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Eavattributeoption extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the option_id refers to the key field in your database table.
25
+ $this->_init('customimport/eavattributeoption', 'option_id');
26
+ }
27
+
28
+ }
29
+
30
+
31
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eavattributeoption/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Eavattributeoption_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/eavattributeoption');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Eavattributeoption_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/eavattributeoption');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eaventityattribute.php RENAMED
@@ -1,31 +1,31 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Eaventityattribute extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the option_id refers to the key field in your database table.
25
- $this->_init('customimport/eaventityattribute', 'entity_attribute_id');
26
- }
27
-
28
- }
29
-
30
-
31
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Eaventityattribute extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the option_id refers to the key field in your database table.
25
+ $this->_init('customimport/eaventityattribute', 'entity_attribute_id');
26
+ }
27
+
28
+ }
29
+
30
+
31
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Eaventityattribute/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Eaventityattribute_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/eaventityattribute');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Eaventityattribute_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/eaventityattribute');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Externalcategorymappinginfo.php RENAMED
@@ -1,31 +1,31 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Externalcategorymappinginfo extends Mage_Core_Model_Mysql4_Abstract {
21
-
22
- public function _construct() {
23
-
24
- // Note that the external_category_id refers to the key field in your database table.
25
- $this->_init('customimport/externalcategorymappinginfo', 'external_category_id');
26
- }
27
-
28
- }
29
-
30
-
31
  ?>
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Externalcategorymappinginfo extends Mage_Core_Model_Mysql4_Abstract {
21
+
22
+ public function _construct() {
23
+
24
+ // Note that the external_category_id refers to the key field in your database table.
25
+ $this->_init('customimport/externalcategorymappinginfo', 'external_category_id');
26
+ }
27
+
28
+ }
29
+
30
+
31
  ?>
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Externalcategorymappinginfo/Collection.php RENAMED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Externalcategorymappinginfo_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
-
22
- public function _construct() {
23
- parent::_construct();
24
- $this->_init('customimport/externalcategorymappinginfo');
25
- }
26
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Externalcategorymappinginfo_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
21
+
22
+ public function _construct() {
23
+ parent::_construct();
24
+ $this->_init('customimport/externalcategorymappinginfo');
25
+ }
26
+ }
app/code/{community → local}/Gec/Customimport/Model/Mysql4/Setup.php RENAMED
@@ -1,22 +1,22 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Model_Mysql4_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup{
21
-
22
  }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ class Gec_Customimport_Model_Mysql4_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup{
21
+
22
  }
app/code/{community → local}/Gec/Customimport/Model/Status.php RENAMED
@@ -1,39 +1,39 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
-
21
- class Gec_Customimport_Model_Status extends Varien_Object {
22
- /*
23
- const STATUS_ENABLED = 1;
24
- const STATUS_DISABLED = 2;
25
-
26
- static public function getOptionArray() {
27
- return array(
28
- self::STATUS_ENABLED => Mage::helper('homeproducts')->__('Enabled'),
29
- self::STATUS_DISABLED => Mage::helper('homeproducts')->__('Disabled')
30
- );
31
- }
32
- */
33
-
34
-
35
- public function exampleMethod()
36
- {
37
- return 'status';
38
- }
39
- }
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+
21
+ class Gec_Customimport_Model_Status extends Varien_Object {
22
+ /*
23
+ const STATUS_ENABLED = 1;
24
+ const STATUS_DISABLED = 2;
25
+
26
+ static public function getOptionArray() {
27
+ return array(
28
+ self::STATUS_ENABLED => Mage::helper('homeproducts')->__('Enabled'),
29
+ self::STATUS_DISABLED => Mage::helper('homeproducts')->__('Disabled')
30
+ );
31
+ }
32
+ */
33
+
34
+
35
+ public function exampleMethod()
36
+ {
37
+ return 'status';
38
+ }
39
+ }
app/code/local/Gec/Customimport/controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Gec_Customimport_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_title($this->__("Catalog Import"));
8
+ $this->renderLayout();
9
+ }
10
+
11
+ protected function _isAllowed()
12
+ {
13
+ return Mage::getSingleton('admin/session')->isAllowed('catalog/customimport');
14
+ }
15
+ }
app/code/local/Gec/Customimport/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <customimport translate="title" module="customimport">
12
+ <title>Catalog Import</title>
13
+ <sort_order>0</sort_order>
14
+ </customimport>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/{community → local}/Gec/Customimport/etc/config.xml RENAMED
@@ -1,135 +1,183 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
5
- # @author Serenus Infotech <magento@serenusinfotech.com>
6
- #
7
- # This program is free software: you can redistribute it and/or modify
8
- # it under the terms of the GNU Affero General Public License as
9
- # published by the Free Software Foundation, either version 3 of the
10
- # License, or (at your option) any later version.
11
- #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Affero General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU Affero General Public License
18
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- **/
20
- -->
21
- <config>
22
- <modules>
23
- <Gec_Customimport>
24
- <version>0.1.0</version>
25
- </Gec_Customimport>
26
- </modules>
27
- <frontend>
28
- <routers>
29
- <customimport>
30
- <use>standard</use>
31
- <args>
32
- <module>Gec_Customimport</module>
33
- <frontName>customimport</frontName>
34
- </args>
35
- </customimport>
36
- </routers>
37
- <layout>
38
- <updates>
39
- <customimport>
40
- <file>customimport.xml</file>
41
- </customimport>
42
- </updates>
43
- </layout>
44
- </frontend>
45
- <admin>
46
- <routers>
47
- <customimport>
48
- <use>admin</use>
49
- <args>
50
- <module>Gec_Customimport</module>
51
- <frontName>customimport</frontName>
52
- </args>
53
- </customimport>
54
- </routers>
55
- </admin>
56
- <global>
57
- <models>
58
- <customimport>
59
- <class>Gec_Customimport_Model</class>
60
- <resourceModel>customimport_mysql4</resourceModel>
61
- </customimport>
62
- <customimport_mysql4>
63
- <class>Gec_Customimport_Model_Mysql4</class>
64
- <entities>
65
- <attrsetmapping>
66
- <table>external_attrsetmapping_info</table>
67
- </attrsetmapping>
68
- <attrgroup>
69
- <table>external_attrgroup_mapping_info</table>
70
- </attrgroup>
71
- <eavattributegroup>
72
- <table>eav_attribute_group</table>
73
- </eavattributegroup>
74
- <eaventityattribute>
75
- <table>eav_entity_attribute</table>
76
- </eaventityattribute>
77
- <eavattributeoption>
78
- <table>eav_attribute_option</table>
79
- </eavattributeoption>
80
- <externalcategorymappinginfo>
81
- <table>external_category_mapping_info</table>
82
- </externalcategorymappinginfo>
83
- <catalogentity>
84
- <table>catalog_category_entity</table>
85
- </catalogentity>
86
- </entities>
87
- </customimport_mysql4>
88
- <catalog_resource_eav_mysql4>
89
- <rewrite>
90
- <attribute>Gec_Customimport_Model_Catalog_Resource_Eav_Mysql4_Attribute</attribute>
91
- </rewrite>
92
- </catalog_resource_eav_mysql4>
93
- </models>
94
- <resources>
95
- <customimport_setup>
96
- <setup>
97
- <module>Gec_Customimport</module>
98
- </setup>
99
- <connection>
100
- <use>core_setup</use>
101
- </connection>
102
- </customimport_setup>
103
- <customimport_write>
104
- <connection>
105
- <use>core_write</use>
106
- </connection>
107
- </customimport_write>
108
- <customimport_read>
109
- <connection>
110
- <use>core_read</use>
111
- </connection>
112
- </customimport_read>
113
- </resources>
114
- <blocks>
115
- <customimport>
116
- <class>Gec_Customimport_Block</class>
117
- </customimport>
118
- <adminhtml>
119
- <rewrite>
120
- <catalog_product_attribute_edit_tab_options>Gec_Customimport_Block_Catalog_Product_Attribute_Edit_Tab_Options</catalog_product_attribute_edit_tab_options>
121
- </rewrite>
122
- </adminhtml>
123
- </blocks>
124
- <helpers>
125
- <customimport>
126
- <class>Gec_Customimport_Helper</class>
127
- </customimport>
128
- <catalog>
129
- <rewrite>
130
- <image>Gec_Customimport_Helper_Catalog_Image</image>
131
- </rewrite>
132
- </catalog>
133
- </helpers>
134
- </global>
135
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
5
+ # @author Serenus Infotech <magento@serenusinfotech.com>
6
+ #
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as
9
+ # published by the Free Software Foundation, either version 3 of the
10
+ # License, or (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
+ **/
20
+ -->
21
+ <config>
22
+ <modules>
23
+ <Gec_Customimport>
24
+ <version>0.1.0</version>
25
+ </Gec_Customimport>
26
+ </modules>
27
+ <!--<frontend>
28
+ <routers>
29
+ <customimport>
30
+ <use>standard</use>
31
+ <args>
32
+ <module>Gec_Customimport</module>
33
+ <frontName>customimport</frontName>
34
+ </args>
35
+ </customimport>
36
+ </routers>
37
+ <layout>
38
+ <updates>
39
+ <customimport>
40
+ <file>customimport.xml</file>
41
+ </customimport>
42
+ </updates>
43
+ </layout>
44
+ </frontend>-->
45
+ <admin>
46
+ <routers>
47
+ <customimport>
48
+ <use>admin</use>
49
+ <args>
50
+ <module>Gec_Customimport</module>
51
+ <frontName>admin_customimport</frontName>
52
+ </args>
53
+ </customimport>
54
+ </routers>
55
+ </admin>
56
+ <global>
57
+ <template>
58
+ <email>
59
+ <!-- Give the template a uniqiue name, you'll need to refer to this later when sending the email-->
60
+ <import_status>
61
+ <label>import_status</label>
62
+ <file>import_status.html</file>
63
+ <type>html</type>
64
+ </import_status>
65
+ </email>
66
+ </template>
67
+ <models>
68
+ <customimport>
69
+ <class>Gec_Customimport_Model</class>
70
+ <resourceModel>customimport_mysql4</resourceModel>
71
+ </customimport>
72
+ <customimport_mysql4>
73
+ <class>Gec_Customimport_Model_Mysql4</class>
74
+ <entities>
75
+ <attrsetmapping>
76
+ <table>external_attrsetmapping_info</table>
77
+ </attrsetmapping>
78
+ <attrgroup>
79
+ <table>external_attrgroup_mapping_info</table>
80
+ </attrgroup>
81
+ <eavattributegroup>
82
+ <table>eav_attribute_group</table>
83
+ </eavattributegroup>
84
+ <eaventityattribute>
85
+ <table>eav_entity_attribute</table>
86
+ </eaventityattribute>
87
+ <eavattributeoption>
88
+ <table>eav_attribute_option</table>
89
+ </eavattributeoption>
90
+ <externalcategorymappinginfo>
91
+ <table>external_category_mapping_info</table>
92
+ </externalcategorymappinginfo>
93
+ <catalogentity>
94
+ <table>catalog_category_entity</table>
95
+ </catalogentity>
96
+ </entities>
97
+ </customimport_mysql4>
98
+ <catalog_resource_eav_mysql4>
99
+ <rewrite>
100
+ <attribute>Gec_Customimport_Model_Catalog_Resource_Eav_Mysql4_Attribute</attribute>
101
+ </rewrite>
102
+ </catalog_resource_eav_mysql4>
103
+ </models>
104
+ <resources>
105
+ <customimport_setup>
106
+ <setup>
107
+ <module>Gec_Customimport</module>
108
+ </setup>
109
+ <connection>
110
+ <use>core_setup</use>
111
+ </connection>
112
+ </customimport_setup>
113
+ <customimport_write>
114
+ <connection>
115
+ <use>core_write</use>
116
+ </connection>
117
+ </customimport_write>
118
+ <customimport_read>
119
+ <connection>
120
+ <use>core_read</use>
121
+ </connection>
122
+ </customimport_read>
123
+ </resources>
124
+ <blocks>
125
+ <customimport>
126
+ <class>Gec_Customimport_Block</class>
127
+ </customimport>
128
+ <adminhtml>
129
+ <rewrite>
130
+ <catalog_product_attribute_edit_tab_options>Gec_Customimport_Block_Catalog_Product_Attribute_Edit_Tab_Options</catalog_product_attribute_edit_tab_options>
131
+ </rewrite>
132
+ </adminhtml>
133
+ </blocks>
134
+ <helpers>
135
+ <customimport>
136
+ <class>Gec_Customimport_Helper</class>
137
+ </customimport>
138
+ <catalog>
139
+ <rewrite>
140
+ <image>Gec_Customimport_Helper_Catalog_Image</image>
141
+ </rewrite>
142
+ </catalog>
143
+ </helpers>
144
+ </global>
145
+ <adminhtml>
146
+ <menu>
147
+ <catalog module="catalog">
148
+ <children>
149
+ <customimport module="customimport">
150
+ <title>Catalog Import</title>
151
+ <sort_order>0</sort_order>
152
+ <action>admin_customimport/adminhtml_index</action>
153
+ </customimport>
154
+ </children>
155
+ </catalog>
156
+ </menu>
157
+ <acl>
158
+ <resources>
159
+ <all>
160
+ <title>Allow Everything</title>
161
+ </all>
162
+ <admin>
163
+ <children>
164
+ <catalog translate="title" module="catalog">
165
+ <children>
166
+ <customimport translate="title">
167
+ <title>Custom Import</title>
168
+ </customimport>
169
+ </children>
170
+ </catalog>
171
+ </children>
172
+ </admin>
173
+ </resources>
174
+ </acl>
175
+ <layout>
176
+ <updates>
177
+ <customimport>
178
+ <file>customimport.xml</file>
179
+ </customimport>
180
+ </updates>
181
+ </layout>
182
+ </adminhtml>
183
+ </config>
app/code/local/Gec/Customimport/etc/system.xml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Catalog
24
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <tabs>
30
+ <catalog translate="label" module="catalog">
31
+ <label>Catalog</label>
32
+ <sort_order>200</sort_order>
33
+ </catalog>
34
+ </tabs>
35
+ <sections>
36
+ <catalog translate="label" module="catalog">
37
+ <class>separator-top</class>
38
+ <label>Catalog</label>
39
+ <tab>catalog</tab>
40
+ <frontend_type>text</frontend_type>
41
+ <sort_order>40</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <groups>
46
+ <proimgusage translate="label">
47
+ <label>Product Image Usage</label>
48
+ <frontend_type>text</frontend_type>
49
+ <sort_order>301</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ <fields>
54
+ <imgusage translate="label">
55
+ <label>Internal Image Usage</label>
56
+ <comment>Setting as 'No' prioritises the external image URLs over the internal images. When 'Yes', the uploaded internal images are given higher priority.</comment>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>5</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ </imgusage>
64
+ </fields>
65
+ </proimgusage>
66
+ <newproduct translate="label">
67
+ <label>New Products</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>100</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <fields>
74
+ <days translate="label comment">
75
+ <label>Days</label>
76
+ <comment>Specify number of days to determine 'New to Date' of a newly imported product. For example, specifying 45 shall add 45 days to the day the product was first imported. Leaving it blank shall delegate control to default Magento functionality for identifying new products.</comment>
77
+ <frontend_type>text</frontend_type>
78
+ <sort_order>5</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ </days>
83
+ <limit translate="label comment">
84
+ <label>Limit</label>
85
+ <comment>Limits the number of new products fetched.</comment>
86
+ <frontend_type>text</frontend_type>
87
+ <sort_order>6</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>1</show_in_website>
90
+ <show_in_store>1</show_in_store>
91
+ </limit>
92
+ </fields>
93
+ </newproduct>
94
+ </groups>
95
+ </catalog>
96
+ </sections>
97
+ </config>
app/code/{community → local}/Gec/Customimport/sql/customimport_setup/mysql4-install-0.1.0.php RENAMED
@@ -1,192 +1,194 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- $installer = $this;
21
- $installer->startSetup();
22
-
23
- $installer->run("
24
- DROP TABLE IF EXISTS `{$this->getTable('external_attrgroup_mapping_info')}`;
25
- CREATE TABLE IF NOT EXISTS `{$this->getTable('external_attrgroup_mapping_info')}` (
26
- `external_attrgroup_id` int(12) NOT NULL AUTO_INCREMENT COMMENT 'auto increment id',
27
- `attribute_set_id` smallint(5) unsigned NOT NULL COMMENT 'attribute set id',
28
- `external_id` varchar(255) NOT NULL,
29
- `magento_id` smallint(5) unsigned NOT NULL,
30
- PRIMARY KEY (`external_attrgroup_id`),
31
- UNIQUE KEY `magento_id` (`magento_id`)
32
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
33
-
34
- DROP TABLE IF EXISTS `{$this->getTable('external_attrsetmapping_info')}`;
35
- CREATE TABLE IF NOT EXISTS `{$this->getTable('external_attrsetmapping_info')}` (
36
- `external_attrsetmapping_id` int(12) NOT NULL AUTO_INCREMENT,
37
- `external_id` varchar(255) NOT NULL,
38
- `magento_id` smallint(5) unsigned NOT NULL COMMENT 'same as attribute_set_id',
39
- PRIMARY KEY (`external_attrsetmapping_id`),
40
- UNIQUE KEY `external_id` (`external_id`,`magento_id`),
41
- KEY `magento_id` (`magento_id`)
42
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
43
-
44
- DROP TABLE IF EXISTS `{$this->getTable('external_category_mapping_info')}`;
45
- CREATE TABLE IF NOT EXISTS `{$this->getTable('external_category_mapping_info')}` (
46
- `external_category_id` int(12) NOT NULL AUTO_INCREMENT,
47
- `external_id` varchar(255) NOT NULL,
48
- `magento_id` int(10) unsigned NOT NULL,
49
- `external_pid` varchar(255) NOT NULL,
50
- `magento_pid` int(10) unsigned NOT NULL,
51
- PRIMARY KEY (`external_category_id`),
52
- UNIQUE KEY `external_id` (`external_id`,`magento_id`),
53
- KEY `magento_id` (`magento_id`)
54
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
55
-
56
- ALTER TABLE `{$this->getTable('external_attrgroup_mapping_info')}` ADD FOREIGN KEY (`magento_id`) REFERENCES `{$this->getTable('eav_attribute_group')}` (`attribute_group_id`)
57
- ON DELETE CASCADE ON UPDATE CASCADE;
58
-
59
- ALTER TABLE `{$this->getTable('external_attrsetmapping_info')}` ADD FOREIGN KEY (`magento_id`) REFERENCES `{$this->getTable('eav_attribute_set')}` (`attribute_set_id`)
60
- ON DELETE CASCADE ON UPDATE CASCADE;
61
-
62
- ALTER TABLE `{$this->getTable('external_category_mapping_info')}` ADD FOREIGN KEY (`magento_id`) REFERENCES `{$this->getTable('catalog_category_entity')}` (`entity_id`)
63
- ON DELETE CASCADE ON UPDATE CASCADE;
64
-
65
- ");
66
-
67
-
68
- $resource = Mage::getSingleton('core/resource');
69
- $read = $resource->getConnection('core_read');
70
- $write = $resource->getConnection('core_write');
71
-
72
- $database = Mage::getConfig()->getResourceConnectionConfig('default_setup')->dbname;
73
- $option_table = Mage::getSingleton('core/resource')->getTableName('eav_attribute_option');
74
- $attribute_table = Mage::getSingleton('core/resource')->getTableName('eav_attribute');
75
-
76
- $query = "SELECT COUNT(*) as abc FROM information_schema.COLUMNS
77
- WHERE TABLE_SCHEMA = '".$database."' AND
78
- TABLE_NAME = '".$option_table."' AND COLUMN_NAME = 'externalid'";
79
-
80
- $results = $read->fetchRow($query);
81
-
82
- if($results['abc'] == '0'):
83
- $result = $write->query("ALTER TABLE $option_table
84
- ADD `externalid` VARCHAR( 255 ) NOT NULL AFTER `sort_order` ");
85
-
86
- endif;
87
-
88
- $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
89
-
90
- $query_2 = "Select attribute_code from $attribute_table
91
- where entity_type_id = '3'
92
- and attribute_code = 'external_id'";
93
-
94
- $result_2 = $read->fetchRow($query_2);
95
-
96
- if($result_2['attribute_code'] != 'external_id'):
97
- $setup->addAttribute('catalog_category', 'external_id', array(
98
- 'group' => 'General Information',
99
- 'input' => 'text',
100
- 'type' => 'varchar',
101
- 'label' => 'External id',
102
- 'backend' => '',
103
- 'visible' => 1,
104
- 'required' => 0,
105
- 'user_defined' => 1,
106
- 'default' => '',
107
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
108
- ));
109
-
110
- endif;
111
- $query_3 = "Select attribute_code from $attribute_table
112
- where entity_type_id = '3'
113
- and attribute_code = 'external_cat_image'";
114
- $result_3 = $read->fetchRow($query_3);
115
-
116
-
117
- if($result_3['attribute_code'] != 'external_cat_image'):
118
- $setup->addAttribute('catalog_category', 'external_cat_image', array(
119
- 'group' => 'General Information',
120
- 'input' => 'text',
121
- 'type' => 'varchar',
122
- 'label' => 'External Image',
123
- 'backend' => '',
124
- 'visible' => 1,
125
- 'required' => 0,
126
- 'user_defined' => 1,
127
- 'default' => '',
128
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
129
- ));
130
-
131
- endif;
132
-
133
-
134
-
135
-
136
- $setup->addAttribute('catalog_product', 'external_image', array(
137
- 'group' => 'Images',
138
- 'input' => 'text',
139
- 'type' => 'text',
140
- 'label' => 'External image',
141
- 'backend' => '',
142
- 'visible' => 1,
143
- 'required' => 0,
144
- 'user_defined' => 1,
145
- 'searchable' => 1,
146
- 'filterable' => 0,
147
- 'comparable' => 1,
148
- 'visible_on_front' => 1,
149
- 'visible_in_advanced_search' => 0,
150
- 'is_html_allowed_on_front' => 0,
151
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
152
- ));
153
-
154
- $setup->addAttribute('catalog_product', 'external_small_image', array(
155
- 'group' => 'Images',
156
- 'input' => 'text',
157
- 'type' => 'text',
158
- 'label' => 'External small image',
159
- 'backend' => '',
160
- 'visible' => 1,
161
- 'required' => 0,
162
- 'user_defined' => 1,
163
- 'searchable' => 1,
164
- 'filterable' => 0,
165
- 'comparable' => 1,
166
- 'visible_on_front' => 1,
167
- 'visible_in_advanced_search' => 0,
168
- 'is_html_allowed_on_front' => 0,
169
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
170
- ));
171
-
172
-
173
- $setup->addAttribute('catalog_product', 'external_thumbnail', array(
174
- 'group' => 'Images',
175
- 'input' => 'text',
176
- 'type' => 'text',
177
- 'label' => 'External thumbnail',
178
- 'backend' => '',
179
- 'visible' => 1,
180
- 'required' => 0,
181
- 'user_defined' => 1,
182
- 'searchable' => 1,
183
- 'filterable' => 0,
184
- 'comparable' => 1,
185
- 'visible_on_front' => 1,
186
- 'visible_in_advanced_search' => 0,
187
- 'is_html_allowed_on_front' => 0,
188
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
189
- ));
190
-
191
-
192
- $installer->endSetup();
 
 
1
+ <?php
2
+ /**
3
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
+ # @author Serenus Infotech <magento@serenusinfotech.com>
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License as
8
+ # published by the Free Software Foundation, either version 3 of the
9
+ # License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Affero General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ **/
19
+
20
+ $installer = $this;
21
+ $installer->startSetup();
22
+
23
+ $installer->run("
24
+ DROP TABLE IF EXISTS `{$this->getTable('external_attrgroup_mapping_info')}`;
25
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('external_attrgroup_mapping_info')}` (
26
+ `external_attrgroup_id` int(12) NOT NULL AUTO_INCREMENT COMMENT 'auto increment id',
27
+ `attribute_set_id` smallint(5) unsigned NOT NULL COMMENT 'attribute set id',
28
+ `external_id` varchar(255) NOT NULL,
29
+ `magento_id` smallint(5) unsigned NOT NULL,
30
+ PRIMARY KEY (`external_attrgroup_id`),
31
+ UNIQUE KEY `magento_id` (`magento_id`)
32
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
33
+
34
+ DROP TABLE IF EXISTS `{$this->getTable('external_attrsetmapping_info')}`;
35
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('external_attrsetmapping_info')}` (
36
+ `external_attrsetmapping_id` int(12) NOT NULL AUTO_INCREMENT,
37
+ `external_id` varchar(255) NOT NULL,
38
+ `magento_id` smallint(5) unsigned NOT NULL COMMENT 'same as attribute_set_id',
39
+ PRIMARY KEY (`external_attrsetmapping_id`),
40
+ UNIQUE KEY `external_id` (`external_id`,`magento_id`),
41
+ KEY `magento_id` (`magento_id`)
42
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
43
+
44
+ DROP TABLE IF EXISTS `{$this->getTable('external_category_mapping_info')}`;
45
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('external_category_mapping_info')}` (
46
+ `external_category_id` int(12) NOT NULL AUTO_INCREMENT,
47
+ `external_id` varchar(255) NOT NULL,
48
+ `magento_id` int(10) unsigned NOT NULL,
49
+ `external_pid` varchar(255) NOT NULL,
50
+ `magento_pid` int(10) unsigned NOT NULL,
51
+ PRIMARY KEY (`external_category_id`),
52
+ UNIQUE KEY `external_id` (`external_id`,`magento_id`),
53
+ KEY `magento_id` (`magento_id`)
54
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
55
+
56
+ ALTER TABLE `{$this->getTable('external_attrgroup_mapping_info')}` ADD FOREIGN KEY (`magento_id`) REFERENCES `{$this->getTable('eav_attribute_group')}` (`attribute_group_id`)
57
+ ON DELETE CASCADE ON UPDATE CASCADE;
58
+
59
+ ALTER TABLE `{$this->getTable('external_attrsetmapping_info')}` ADD FOREIGN KEY (`magento_id`) REFERENCES `{$this->getTable('eav_attribute_set')}` (`attribute_set_id`)
60
+ ON DELETE CASCADE ON UPDATE CASCADE;
61
+
62
+ ALTER TABLE `{$this->getTable('external_category_mapping_info')}` ADD FOREIGN KEY (`magento_id`) REFERENCES `{$this->getTable('catalog_category_entity')}` (`entity_id`)
63
+ ON DELETE CASCADE ON UPDATE CASCADE;
64
+
65
+ INSERT INTO `external_attrsetmapping_info` (`external_attrsetmapping_id`, `external_id`, `magento_id`) VALUES (NULL, '4', '4');
66
+ ");
67
+
68
+
69
+ $resource = Mage::getSingleton('core/resource');
70
+ $read = $resource->getConnection('core_read');
71
+ $write = $resource->getConnection('core_write');
72
+
73
+ $database = Mage::getConfig()->getResourceConnectionConfig('default_setup')->dbname;
74
+ $option_table = Mage::getSingleton('core/resource')->getTableName('eav_attribute_option');
75
+ $attribute_table = Mage::getSingleton('core/resource')->getTableName('eav_attribute');
76
+
77
+ $query = "SELECT COUNT(*) as abc FROM information_schema.COLUMNS
78
+ WHERE TABLE_SCHEMA = '".$database."' AND
79
+ TABLE_NAME = '".$option_table."' AND COLUMN_NAME = 'externalid'";
80
+
81
+ $results = $read->fetchRow($query);
82
+
83
+ if($results['abc'] == '0'):
84
+ $result = $write->query("ALTER TABLE $option_table
85
+ ADD `externalid` VARCHAR( 255 ) NOT NULL AFTER `sort_order` ");
86
+
87
+ endif;
88
+
89
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
90
+
91
+ $query_2 = "Select attribute_code from $attribute_table
92
+ where entity_type_id = '3'
93
+ and attribute_code = 'external_id'";
94
+
95
+ $result_2 = $read->fetchRow($query_2);
96
+
97
+ if($result_2['attribute_code'] != 'external_id'):
98
+ $setup->addAttribute('catalog_category', 'external_id', array(
99
+ 'group' => 'General Information',
100
+ 'input' => 'text',
101
+ 'type' => 'varchar',
102
+ 'label' => 'External id',
103
+ 'backend' => '',
104
+ 'visible' => 1,
105
+ 'required' => 0,
106
+ 'user_defined' => 1,
107
+ 'default' => '',
108
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
109
+ ));
110
+
111
+ endif;
112
+ $query_3 = "Select attribute_code from $attribute_table
113
+ where entity_type_id = '3'
114
+ and attribute_code = 'external_cat_image'";
115
+ $result_3 = $read->fetchRow($query_3);
116
+
117
+
118
+ if($result_3['attribute_code'] != 'external_cat_image'):
119
+ $setup->addAttribute('catalog_category', 'external_cat_image', array(
120
+ 'group' => 'General Information',
121
+ 'input' => 'text',
122
+ 'type' => 'varchar',
123
+ 'label' => 'External Image',
124
+ 'backend' => '',
125
+ 'visible' => 1,
126
+ 'required' => 0,
127
+ 'user_defined' => 1,
128
+ 'default' => '',
129
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
130
+ ));
131
+
132
+ endif;
133
+
134
+
135
+
136
+
137
+ $setup->addAttribute('catalog_product', 'external_image', array(
138
+ 'group' => 'Images',
139
+ 'input' => 'text',
140
+ 'type' => 'text',
141
+ 'label' => 'External image',
142
+ 'backend' => '',
143
+ 'visible' => 1,
144
+ 'required' => 0,
145
+ 'user_defined' => 1,
146
+ 'searchable' => 1,
147
+ 'filterable' => 0,
148
+ 'comparable' => 1,
149
+ 'visible_on_front' => 1,
150
+ 'visible_in_advanced_search' => 0,
151
+ 'is_html_allowed_on_front' => 0,
152
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
153
+ ));
154
+
155
+ $setup->addAttribute('catalog_product', 'external_small_image', array(
156
+ 'group' => 'Images',
157
+ 'input' => 'text',
158
+ 'type' => 'text',
159
+ 'label' => 'External small image',
160
+ 'backend' => '',
161
+ 'visible' => 1,
162
+ 'required' => 0,
163
+ 'user_defined' => 1,
164
+ 'searchable' => 1,
165
+ 'filterable' => 0,
166
+ 'comparable' => 1,
167
+ 'visible_on_front' => 1,
168
+ 'visible_in_advanced_search' => 0,
169
+ 'is_html_allowed_on_front' => 0,
170
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
171
+ ));
172
+
173
+
174
+ $setup->addAttribute('catalog_product', 'external_thumbnail', array(
175
+ 'group' => 'Images',
176
+ 'input' => 'text',
177
+ 'type' => 'text',
178
+ 'label' => 'External thumbnail',
179
+ 'backend' => '',
180
+ 'visible' => 1,
181
+ 'required' => 0,
182
+ 'user_defined' => 1,
183
+ 'searchable' => 1,
184
+ 'filterable' => 0,
185
+ 'comparable' => 1,
186
+ 'visible_on_front' => 1,
187
+ 'visible_in_advanced_search' => 0,
188
+ 'is_html_allowed_on_front' => 0,
189
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
190
+ ));
191
+
192
+
193
+
194
+ $installer->endSetup();
app/design/adminhtml/base/default/template/smtppro/view.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ * @author Ashley Schroder (aschroder.com)
6
+ * @copyright Copyright (c) 2014 Ashley Schroder
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ ?>
10
+ <?php if($email = $this->getEmailData()): ?>
11
+ <div class="page-head">
12
+ <h3><?php echo $this->__('Email Details') ?></h3>
13
+ </div>
14
+ <div class="email-detail">
15
+ <p><strong><?php echo $this->__('To:') ?></strong> <?php echo $email->getEmailTo(); ?></p>
16
+ <p><strong><?php echo $this->__('Subject:') ?></strong> <?php echo $email->getSubject(); ?></p>
17
+ <p><strong><?php echo $this->__('Template:') ?></strong> <?php echo $email->getTemplate(); ?></p>
18
+ <p><strong><?php echo $this->__('Sent:') ?></strong> <?php echo $email->getLogAt(); ?></p>
19
+ <p><strong><?php echo $this->__('Message:') ?></strong></p>
20
+ <div>
21
+ <?php echo $email->getEmailBody(); ?>
22
+ </div>
23
+
24
+ </div>
25
+ <br/>
26
+ <div class="button-set"><a href="<?php echo $this->getBackUrl() ?>" class="left">&laquo; <?php echo $this->__('Back to Email Log') ?></a></div><br />
27
+ <?php endif; ?>
app/design/adminhtml/default/default/etc/theme.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <theme>
29
+ <parent />
30
+ </theme>
app/design/adminhtml/default/default/layout/admin.xml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <!-- admin acl users edit page -->
31
+ <adminhtml_permissions_user_edit>
32
+ <reference name="left">
33
+ <block type="adminhtml/permissions_user_edit_tabs" name="adminhtml.permissions.user.edit.tabs"/>
34
+ </reference>
35
+ <reference name="content">
36
+ <block type="adminhtml/permissions_user_edit" name="adminhtml.permissions.user.edit"/>
37
+ </reference>
38
+ <reference name="js">
39
+ <block type="adminhtml/template" name="adminhtml.permissions.user.roles.grid.js" template="permissions/user_roles_grid_js.phtml"/>
40
+ </reference>
41
+ </adminhtml_permissions_user_edit>
42
+
43
+ <!-- admin acl roles grid page -->
44
+ <adminhtml_permissions_role_index>
45
+ <reference name="content">
46
+ <block type="adminhtml/permissions_roles" name="adminhtml.permission.role.index" template="permissions/roles.phtml">
47
+ <block type="adminhtml/permissions_grid_role" name="adminhtml.permission.role.grid" as="grid"/>
48
+ </block>
49
+ </reference>
50
+ </adminhtml_permissions_role_index>
51
+ <adminhtml_permissions_role_rolegrid>
52
+ <remove name="root"/>
53
+ <block type="adminhtml/permissions_grid_role" name="adminhtml.permission.role.grid"/>
54
+ </adminhtml_permissions_role_rolegrid>
55
+
56
+ <!-- admin acl roles edit page -->
57
+ <adminhtml_permissions_role_editrole>
58
+ <reference name="left">
59
+ <block type="adminhtml/permissions_editroles" name="adminhtml.permissions.editroles"/>
60
+ </reference>
61
+ </adminhtml_permissions_role_editrole>
62
+ <adminhtml_system_config_edit>
63
+ <reference name="left">
64
+ <block type="adminhtml/system_config_switcher" name="adminhtml.system.config.switcher" before="-"/>
65
+ </reference>
66
+ </adminhtml_system_config_edit>
67
+ <adminhtml_dashboard_index>
68
+ <reference name="content">
69
+ <block type="adminhtml/dashboard" name="dashboard">
70
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher" template="store/switcher.phtml">
71
+ <action method="setUseConfirm"><params>0</params></action>
72
+ </block>
73
+ </block>
74
+ </reference>
75
+ </adminhtml_dashboard_index>
76
+ <adminhtml_cache_index>
77
+ <reference name="content">
78
+ <block type="adminhtml/cache" name="cache"></block>
79
+ <block type="adminhtml/cache_additional" name="cache.additional" template="system/cache/additional.phtml"></block>
80
+ </reference>
81
+ </adminhtml_cache_index>
82
+ </layout>
app/design/adminhtml/default/default/layout/adminnotification.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <default>
31
+ <reference name="notifications">
32
+ <block type="adminhtml/notification_toolbar" name="notification_toolbar" as="notification_toolbar" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml" />
33
+ </reference>
34
+ <reference name="notifications">
35
+ <block type="adminhtml/notification_window" name="notification_window" as="notification_window" acl="system/adminnotification/show_toolbar" template="notification/window.phtml" />
36
+ </reference>
37
+ </default>
38
+ </layout>
app/design/adminhtml/default/default/layout/api2.xml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_api2_role_index>
30
+ <reference name="content">
31
+ <block type="api2/adminhtml_roles" name="api2_roles"/>
32
+ </reference>
33
+ </adminhtml_api2_role_index>
34
+
35
+ <adminhtml_api2_role_new>
36
+ <reference name="left">
37
+ <block type="api2/adminhtml_roles_tabs" name="adminhtml.role.edit.tabs">
38
+ <block type="api2/adminhtml_roles_tab_info" name="adminhtml.role.edit.tab.info"/>
39
+ <block type="api2/adminhtml_roles_tab_resources" name="adminhtml.role.edit.tab.resources" template="permissions/rolesedit.phtml"/>
40
+ <action method="addTab">
41
+ <id>api2_role_section_info</id>
42
+ <block>adminhtml.role.edit.tab.info</block>
43
+ </action>
44
+ <action method="addTab">
45
+ <id>api2_role_section_resources</id>
46
+ <block>adminhtml.role.edit.tab.resources</block>
47
+ </action>
48
+ </block>
49
+ </reference>
50
+ <reference name="content">
51
+ <block type="api2/adminhtml_roles_buttons" name="adminhtml.roles.buttons"/>
52
+ </reference>
53
+ <reference name="head">
54
+ <action method="setCanLoadExtJs">
55
+ <flag>1</flag>
56
+ </action>
57
+ </reference>
58
+ </adminhtml_api2_role_new>
59
+
60
+ <adminhtml_api2_role_edit>
61
+ <reference name="left">
62
+ <block type="api2/adminhtml_roles_tabs" name="adminhtml.role.edit.tabs">
63
+ <block type="api2/adminhtml_roles_tab_info" name="adminhtml.role.edit.tab.info"/>
64
+ <block type="api2/adminhtml_roles_tab_resources" name="adminhtml.role.edit.tab.resources" template="permissions/rolesedit.phtml"/>
65
+ <block type="api2/adminhtml_roles_tab_users" name="adminhtml.role.edit.tab.users"/>
66
+ <action method="addTab">
67
+ <id>api2_role_section_info</id>
68
+ <block>adminhtml.role.edit.tab.info</block>
69
+ </action>
70
+ <action method="addTab">
71
+ <id>api2_role_section_resources</id>
72
+ <block>adminhtml.role.edit.tab.resources</block>
73
+ </action>
74
+ <action method="addTab">
75
+ <id>roleUsersGrid</id>
76
+ <block>adminhtml.role.edit.tab.users</block>
77
+ </action>
78
+ </block>
79
+ </reference>
80
+ <reference name="content">
81
+ <block type="api2/adminhtml_roles_buttons" name="adminhtml.roles.buttons"/>
82
+ </reference>
83
+ <reference name="head">
84
+ <action method="setCanLoadExtJs">
85
+ <flag>1</flag>
86
+ </action>
87
+ </reference>
88
+ <reference name="js">
89
+ <block type="adminhtml/template" name="adminhtml.role.js.users.grid" template="api2/role/users_grid_js.phtml"/>
90
+ </reference>
91
+ </adminhtml_api2_role_edit>
92
+
93
+ <adminhtml_api2_role_grid>
94
+ <remove name="root"/>
95
+ <block type="api2/adminhtml_roles_grid" name="api2_roles.grid" output="toHtml"/>
96
+ </adminhtml_api2_role_grid>
97
+
98
+ <adminhtml_api2_role_usersgrid>
99
+ <remove name="root"/>
100
+ <block type="api2/adminhtml_roles_tab_users" name="adminhtml.role.edit.tab.users" output="toHtml"/>
101
+ </adminhtml_api2_role_usersgrid>
102
+
103
+ <!-- admin acl users edit page -->
104
+ <adminhtml_permissions_user_edit>
105
+ <reference name="adminhtml.permissions.user.edit.tabs">
106
+ <block type="api2/adminhtml_permissions_user_edit_tab_roles" name="adminhtml.permissions.user.edit.tab.roles"/>
107
+ <action method="addTabAfter">
108
+ <id>api2_roles_section</id>
109
+ <block>adminhtml.permissions.user.edit.tab.roles</block>
110
+ <after>roles_section</after>
111
+ </action>
112
+ </reference>
113
+ <reference name="js">
114
+ <block type="adminhtml/template" name="adminhtml.permissions.user.edit.tab.roles.js" template="api2/permissions/user/edit/tab/roles/js.phtml"/>
115
+ </reference>
116
+ </adminhtml_permissions_user_edit>
117
+
118
+ <!-- ACL attributes -->
119
+ <adminhtml_api2_attribute_index>
120
+ <reference name="content">
121
+ <block type="api2/adminhtml_attribute" name="api2.attribute"/>
122
+ </reference>
123
+ </adminhtml_api2_attribute_index>
124
+
125
+ <adminhtml_api2_attribute_edit>
126
+ <reference name="left">
127
+ <block type="api2/adminhtml_attribute_tabs" name="api2.attribute.edit.tabs">
128
+ <block type="api2/adminhtml_attribute_tab_resource" name="api2.attribute.tab.resource" template="api2/attribute/resource.phtml"/>
129
+ <action method="addTab">
130
+ <name>api2_attribute_section_resources</name>
131
+ <block>api2.attribute.tab.resource</block>
132
+ </action>
133
+ </block>
134
+ </reference>
135
+ <reference name="content">
136
+ <block type="api2/adminhtml_attribute_edit" name="edit_form">
137
+ <block type="api2/adminhtml_attribute_edit_form" name="form"/>
138
+ </block>
139
+ </reference>
140
+ <reference name="head">
141
+ <action method="setCanLoadExtJs">
142
+ <flag>1</flag>
143
+ </action>
144
+ </reference>
145
+ </adminhtml_api2_attribute_edit>
146
+ <!-- EOF ACL attributes -->
147
+ </layout>
app/design/adminhtml/default/default/layout/authorizenet.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+ <adminhtml_sales_order_create_index>
31
+ <reference name="head">
32
+ <action method="addJs"><file>mage/directpost.js</file></action>
33
+ </reference>
34
+ </adminhtml_sales_order_create_index>
35
+ </layout>
app/design/adminhtml/default/default/layout/bundle.xml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <!--
32
+ Layout handle for budle products
33
+ -->
34
+
35
+ <!--<default>
36
+ <reference name="left">
37
+ <action method="setData"><attribute>attributeTabs</attribute><attributeType>bundle/adminhtml_catalog_product_edit_tab_attributes</attributeType></action>
38
+ </reference>
39
+ </default>-->
40
+
41
+ <adminhtml_catalog_product_bundle>
42
+ <reference name="product_tabs">
43
+ <action method="addTab"><name>bundle_items</name><block>bundle/adminhtml_catalog_product_edit_tab_bundle</block></action>
44
+ <action method="bindShadowTabs"><first>bundle_items</first><second>customer_options</second></action>
45
+ </reference>
46
+ </adminhtml_catalog_product_bundle>
47
+
48
+ <adminhtml_sales_order_view>
49
+ <reference name="order_items">
50
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_view_items_renderer</block><template>bundle/sales/order/view/items/renderer.phtml</template></action>
51
+ </reference>
52
+ </adminhtml_sales_order_view>
53
+
54
+ <adminhtml_sales_order_invoice_new>
55
+ <reference name="order_items">
56
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/invoice/create/items/renderer.phtml</template></action>
57
+ </reference>
58
+ </adminhtml_sales_order_invoice_new>
59
+
60
+ <adminhtml_sales_order_invoice_updateqty>
61
+ <reference name="order_items">
62
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/invoice/create/items/renderer.phtml</template></action>
63
+ </reference>
64
+ </adminhtml_sales_order_invoice_updateqty>
65
+
66
+ <adminhtml_sales_order_invoice_view>
67
+ <reference name="invoice_items">
68
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/invoice/view/items/renderer.phtml</template></action>
69
+ </reference>
70
+ </adminhtml_sales_order_invoice_view>
71
+
72
+ <adminhtml_sales_order_shipment_new>
73
+ <reference name="order_items">
74
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/shipment/create/items/renderer.phtml</template></action>
75
+ </reference>
76
+ </adminhtml_sales_order_shipment_new>
77
+
78
+ <adminhtml_sales_order_shipment_view>
79
+ <reference name="shipment_items">
80
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/shipment/view/items/renderer.phtml</template></action>
81
+ </reference>
82
+ </adminhtml_sales_order_shipment_view>
83
+
84
+ <adminhtml_sales_order_creditmemo_new>
85
+ <reference name="order_items">
86
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/creditmemo/create/items/renderer.phtml</template></action>
87
+ </reference>
88
+ </adminhtml_sales_order_creditmemo_new>
89
+
90
+ <adminhtml_sales_order_creditmemo_updateqty>
91
+ <reference name="order_items">
92
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/creditmemo/create/items/renderer.phtml</template></action>
93
+ </reference>
94
+ </adminhtml_sales_order_creditmemo_updateqty>
95
+
96
+ <adminhtml_sales_order_creditmemo_view>
97
+ <reference name="creditmemo_items">
98
+ <action method="addItemRender"><type>bundle</type><block>bundle/adminhtml_sales_order_items_renderer</block><template>bundle/sales/creditmemo/view/items/renderer.phtml</template></action>
99
+ </reference>
100
+ </adminhtml_sales_order_creditmemo_view>
101
+
102
+ <adminhtml_customer_wishlist>
103
+ <reference name="customer.wishlist.edit.tab">
104
+ <action method="addProductConfigurationHelper"><type>bundle</type><name>bundle/catalog_product_configuration</name></action>
105
+ </reference>
106
+ </adminhtml_customer_wishlist>
107
+
108
+ <PRODUCT_TYPE_bundle>
109
+ <reference name="product.composite.fieldset">
110
+ <block type="bundle/adminhtml_catalog_product_composite_fieldset_bundle" before="product.composite.fieldset.options" name="product.composite.fieldset.bundle" template="bundle/product/composite/fieldset/options/bundle.phtml">
111
+ <action method="addRenderer"><type>select</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_select</block></action>
112
+ <action method="addRenderer"><type>multi</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_multi</block></action>
113
+ <action method="addRenderer"><type>radio</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_radio</block></action>
114
+ <action method="addRenderer"><type>checkbox</type><block>bundle/adminhtml_catalog_product_composite_fieldset_options_type_checkbox</block></action>
115
+ </block>
116
+ </reference>
117
+ </PRODUCT_TYPE_bundle>
118
+ </layout>
app/design/adminhtml/default/default/layout/captcha.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+ <adminhtml_index_login>
31
+ <reference name="form.additional.info">
32
+ <block type="captcha/captcha" name="captcha">
33
+ <action method="setFormId"><formId>backend_login</formId></action>
34
+ <action method="setImgWidth"><width>226</width></action>
35
+ <action method="setImgHeight"><width>50</width></action>
36
+ </block>
37
+ </reference>
38
+ </adminhtml_index_login>
39
+ <adminhtml_index_forgotpassword>
40
+ <reference name="form.additional.info">
41
+ <block type="captcha/captcha" name="captcha">
42
+ <action method="setFormId"><formId>backend_forgotpassword</formId></action>
43
+ <action method="setImgWidth"><width>226</width></action>
44
+ <action method="setImgHeight"><width>50</width></action>
45
+ </block>
46
+ </reference>
47
+ </adminhtml_index_forgotpassword>
48
+ </layout>
app/design/adminhtml/default/default/layout/catalog.xml ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_catalog_product_index>
31
+ <referense name="head">
32
+ <action method="setTitle" translate="title"><title>Catalog</title></action>
33
+ </referense>
34
+ <reference name="menu">
35
+ <action method="setActive"><menupath>catalog/products</menupath></action>
36
+ </reference>
37
+ <reference name="content">
38
+ <block type="adminhtml/catalog_product" name="products_list">
39
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher">
40
+ <action method="setUseConfirm"><params>0</params></action>
41
+ </block>
42
+ </block>
43
+ </reference>
44
+ </adminhtml_catalog_product_index>
45
+
46
+ <adminhtml_catalog_product_new>
47
+ <update handle="editor"/>
48
+ <reference name="content">
49
+ <block type="adminhtml/catalog_product_edit" name="product_edit"></block>
50
+ </reference>
51
+ <reference name="left">
52
+ <block type="adminhtml/catalog_product_edit_tabs" name="product_tabs"></block>
53
+ </reference>
54
+ <reference name="js">
55
+ <block type="adminhtml/catalog_product_edit_js" template="catalog/product/js.phtml" name="catalog_product_js"></block>
56
+ <block type="core/template" template="catalog/wysiwyg/js.phtml"/>
57
+ </reference>
58
+ </adminhtml_catalog_product_new>
59
+
60
+ <adminhtml_catalog_product_edit>
61
+ <update handle="editor"/>
62
+ <reference name="content">
63
+ <block type="adminhtml/catalog_product_edit" name="product_edit"></block>
64
+ </reference>
65
+ <reference name="left">
66
+ <block type="adminhtml/store_switcher" name="store_switcher" before="-"></block>
67
+ <block type="adminhtml/catalog_product_edit_tabs" name="product_tabs"></block>
68
+ </reference>
69
+ <reference name="js">
70
+ <block type="adminhtml/catalog_product_edit_js" template="catalog/product/js.phtml" name="catalog_product_js"></block>
71
+ <block type="core/template" name="catalog.wysiwyg.js" template="catalog/wysiwyg/js.phtml"/>
72
+ </reference>
73
+ </adminhtml_catalog_product_edit>
74
+
75
+ <adminhtml_catalog_product_categories>
76
+ <block type="core/text_list" name="root" output="toHtml">
77
+ <block type="adminhtml/catalog_product_edit_tab_categories" name="catalog.product.edit.tab.categories"/>
78
+ </block>
79
+ </adminhtml_catalog_product_categories>
80
+
81
+ <adminhtml_catalog_product_reviews>
82
+ <block type="core/text_list" name="root" output="toHtml">
83
+ <block type="adminhtml/catalog_product_edit_tab_reviews" name="admin.product.reviews"/>
84
+ </block>
85
+ </adminhtml_catalog_product_reviews>
86
+
87
+ <adminhtml_catalog_product_taggrid>
88
+ <block type="core/text_list" name="root" output="toHtml">
89
+ <block type="adminhtml/catalog_product_edit_tab_tag" name="admin.product.tags"/>
90
+ </block>
91
+ </adminhtml_catalog_product_taggrid>
92
+
93
+ <adminhtml_catalog_product_tagcustomergrid>
94
+ <block type="core/text_list" name="root" output="toHtml">
95
+ <block type="adminhtml/catalog_product_edit_tab_tag_customer" name="admin.product.tags.customers"/>
96
+ </block>
97
+ </adminhtml_catalog_product_tagcustomergrid>
98
+
99
+ <adminhtml_catalog_product_options>
100
+ <block type="core/text_list" name="root" output="toHtml">
101
+ <block type="adminhtml/catalog_product_edit_tab_options" name="admin.product.options"/>
102
+ </block>
103
+ </adminhtml_catalog_product_options>
104
+
105
+ <adminhtml_catalog_product_grid>
106
+ <block type="core/text_list" name="root" output="toHtml">
107
+ <block type="adminhtml/catalog_product_grid" name="admin.product.grid"/>
108
+ </block>
109
+ </adminhtml_catalog_product_grid>
110
+
111
+ <adminhtml_catalog_product_related>
112
+ <block type="core/text_list" name="root" output="toHtml">
113
+ <block type="adminhtml/catalog_product_edit_tab_related" name="catalog.product.edit.tab.related"/>
114
+ <block type="adminhtml/widget_grid_serializer" name="related_grid_serializer">
115
+ <reference name="related_grid_serializer">
116
+ <action method="initSerializerBlock">
117
+ <grid_block_name>catalog.product.edit.tab.related</grid_block_name>
118
+ <data_callback>getSelectedRelatedProducts</data_callback>
119
+ <hidden_input_name>links[related]</hidden_input_name>
120
+ <reload_param_name>products_related</reload_param_name>
121
+ </action>
122
+ <action method="addColumnInputName">
123
+ <input_name>position</input_name>
124
+ </action>
125
+ </reference>
126
+ </block>
127
+ </block>
128
+ </adminhtml_catalog_product_related>
129
+
130
+ <adminhtml_catalog_product_relatedgrid>
131
+ <block type="core/text_list" name="root" output="toHtml">
132
+ <block type="adminhtml/catalog_product_edit_tab_related" name="catalog.product.edit.tab.related"/>
133
+ </block>
134
+ </adminhtml_catalog_product_relatedgrid>
135
+
136
+ <adminhtml_catalog_product_superconfig>
137
+ <block type="adminhtml/catalog_product_edit_tab_super_config_grid" name="admin.product.edit.tab.super.config.grid" output="toHtml" />
138
+ </adminhtml_catalog_product_superconfig>
139
+
140
+ <adminhtml_catalog_product_alertspricegrid>
141
+ <block type="adminhtml/catalog_product_edit_tab_alerts_price" name="admin.product.edit.tab.alerts.price" output="toHtml" />
142
+ </adminhtml_catalog_product_alertspricegrid>
143
+
144
+ <adminhtml_catalog_product_alertsstockgrid>
145
+ <block type="adminhtml/catalog_product_edit_tab_alerts_stock" name="admin.product.edit.tab.alerts.stock" output="toHtml" />
146
+ </adminhtml_catalog_product_alertsstockgrid>
147
+
148
+ <adminhtml_catalog_product_upsell>
149
+ <block type="core/text_list" name="root" output="toHtml">
150
+ <block type="adminhtml/catalog_product_edit_tab_upsell" name="catalog.product.edit.tab.upsell"/>
151
+ <block type="adminhtml/widget_grid_serializer" name="upsell_grid_serializer">
152
+ <reference name="upsell_grid_serializer">
153
+ <action method="initSerializerBlock">
154
+ <grid_block_name>catalog.product.edit.tab.upsell</grid_block_name>
155
+ <data_callback>getSelectedUpsellProducts</data_callback>
156
+ <hidden_input_name>links[upsell]</hidden_input_name>
157
+ <reload_param_name>products_upsell</reload_param_name>
158
+ </action>
159
+ <action method="addColumnInputName">
160
+ <input_name>position</input_name>
161
+ </action>
162
+ </reference>
163
+ </block>
164
+ </block>
165
+ </adminhtml_catalog_product_upsell>
166
+
167
+ <adminhtml_catalog_product_upsellgrid>
168
+ <block type="core/text_list" name="root" output="toHtml">
169
+ <block type="adminhtml/catalog_product_edit_tab_upsell" name="catalog.product.edit.tab.upsell"/>
170
+ </block>
171
+ </adminhtml_catalog_product_upsellgrid>
172
+
173
+ <adminhtml_catalog_product_crosssell>
174
+ <block type="core/text_list" name="root" output="toHtml">
175
+ <block type="adminhtml/catalog_product_edit_tab_crosssell" name="catalog.product.edit.tab.crosssell"/>
176
+ <block type="adminhtml/widget_grid_serializer" name="crosssell_grid_serializer">
177
+ <reference name="crosssell_grid_serializer">
178
+ <action method="initSerializerBlock">
179
+ <grid_block_name>catalog.product.edit.tab.crosssell</grid_block_name>
180
+ <data_callback>getSelectedCrossSellProducts</data_callback>
181
+ <hidden_input_name>links[crosssell]</hidden_input_name>
182
+ <reload_param_name>products_crosssell</reload_param_name>
183
+ </action>
184
+ <action method="addColumnInputName">
185
+ <input_name>position</input_name>
186
+ </action>
187
+ </reference>
188
+ </block>
189
+ </block>
190
+ </adminhtml_catalog_product_crosssell>
191
+
192
+ <adminhtml_catalog_product_crosssellgrid>
193
+ <block type="core/text_list" name="root" output="toHtml">
194
+ <block type="adminhtml/catalog_product_edit_tab_crosssell" name="catalog.product.edit.tab.crosssell"/>
195
+ </block>
196
+ </adminhtml_catalog_product_crosssellgrid>
197
+ <!--
198
+ Layout handle for simple products
199
+ -->
200
+
201
+ <adminhtml_catalog_product_simple />
202
+
203
+ <!--
204
+ Layout handle for grouped products
205
+ -->
206
+ <adminhtml_catalog_product_grouped>
207
+ <reference name="product_tabs">
208
+ <action method="addTab"><name>super</name><block>adminhtml/catalog_product_edit_tab_super_group</block></action>
209
+ </reference>
210
+ </adminhtml_catalog_product_grouped>
211
+
212
+ <adminhtml_catalog_product_supergroup>
213
+ <block type="core/text_list" name="root" output="toHtml">
214
+ <block type="adminhtml/catalog_product_edit_tab_super_group" name="catalog.product.edit.tab.super.group" />
215
+ <block type="adminhtml/widget_grid_serializer" name="grouped_grid_serializer">
216
+ <reference name="grouped_grid_serializer">
217
+ <action method="initSerializerBlock">
218
+ <grid_block_name>catalog.product.edit.tab.super.group</grid_block_name>
219
+ <data_callback>getSelectedGroupedProducts</data_callback>
220
+ <hidden_input_name>links[grouped]</hidden_input_name>
221
+ <reload_param_name>products_grouped</reload_param_name>
222
+ </action>
223
+ <action method="addColumnInputName">
224
+ <input_name>qty</input_name>
225
+ <input_name>position</input_name>
226
+ </action>
227
+ </reference>
228
+ </block>
229
+ </block>
230
+ </adminhtml_catalog_product_supergroup>
231
+
232
+ <adminhtml_catalog_product_supergroupgridonly>
233
+ <block type="core/text_list" name="root">
234
+ <block type="adminhtml/catalog_product_edit_tab_super_group" name="catalog.product.edit.tab.super.group" />
235
+ </block>
236
+ </adminhtml_catalog_product_supergroupgridonly>
237
+ <!--
238
+ Layout handle for configurable products
239
+ -->
240
+
241
+ <adminhtml_catalog_product_configurable_new>
242
+ <remove name="product_tabs"/>
243
+ <reference name="left">
244
+ <block type="adminhtml/catalog_product_edit_tabs_configurable" name="configurable_product_tabs"></block>
245
+ </reference>
246
+ </adminhtml_catalog_product_configurable_new>
247
+
248
+ <adminhtml_catalog_product_configurable>
249
+ <reference name="product_tabs">
250
+ <action method="addTab"><name>configurable</name><block>adminhtml/catalog_product_edit_tab_super_config</block></action>
251
+ <action method="bindShadowTabs"><first>configurable</first><second>customer_options</second></action>
252
+ </reference>
253
+ </adminhtml_catalog_product_configurable>
254
+
255
+ <adminhtml_catalog_product_action_attribute_edit>
256
+ <reference name="left">
257
+ <block type="adminhtml/store_switcher" name="store_switcher" template="store/switcher.phtml" />
258
+ <block type="adminhtml/catalog_product_edit_action_attribute_tabs" name="attributes_tabs">
259
+ <block type="adminhtml/catalog_product_edit_action_attribute_tab_attributes" name="tab_attributes"/>
260
+ <block type="adminhtml/catalog_product_edit_action_attribute_tab_inventory" name="tab_inventory" template="catalog/product/edit/action/inventory.phtml" />
261
+ <block type="adminhtml/catalog_product_edit_action_attribute_tab_websites" name="tab_websites" template="catalog/product/edit/action/websites.phtml" />
262
+ <action method="addTab"><name>attributes</name><block>tab_attributes</block></action>
263
+ <action method="addTab"><name>inventory</name><block>tab_inventory</block></action>
264
+ <action method="addTab"><name>websites</name><block>tab_websites</block></action>
265
+ </block>
266
+ </reference>
267
+ <reference name="content">
268
+ <block type="adminhtml/catalog_product_edit_action_attribute" name="attribute" template="catalog/product/edit/action/attribute.phtml" />
269
+ </reference>
270
+ </adminhtml_catalog_product_action_attribute_edit>
271
+
272
+ <adminhtml_catalog_product_attribute_edit>
273
+ <reference name="left">
274
+ <block type="adminhtml/catalog_product_attribute_edit_tabs" name="attribute_edit_tabs"></block>
275
+ </reference>
276
+ <reference name="content">
277
+ <block type="adminhtml/catalog_product_attribute_edit" name="attribute_edit_content"></block>
278
+ </reference>
279
+ <reference name="js">
280
+ <block type="adminhtml/template" name="attribute_edit_js" template="catalog/product/attribute/js.phtml"></block>
281
+ </reference>
282
+ </adminhtml_catalog_product_attribute_edit>
283
+
284
+ <adminhtml_catalog_category_edit>
285
+ <update handle="editor"/>
286
+ <reference name="left">
287
+ <block name="category.tree" type="adminhtml/catalog_category_tree" template="catalog/category/tree.phtml" />
288
+ </reference>
289
+ <reference name="content">
290
+ <block name="category.edit" type="adminhtml/catalog_category_edit" template="catalog/category/edit.phtml" />
291
+ </reference>
292
+ <reference name="js">
293
+ <block type="core/template" template="catalog/wysiwyg/js.phtml" name="catalog.wysiwyg.js" />
294
+ </reference>
295
+ </adminhtml_catalog_category_edit>
296
+
297
+ <ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE>
298
+ <block type="adminhtml/catalog_product_composite_fieldset" name="product.composite.fieldset" output="toHtml">
299
+ <block name="product.composite.fieldset.options" type="adminhtml/catalog_product_composite_fieldset_options" template="catalog/product/composite/fieldset/options.phtml">
300
+ <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/composite/fieldset/options/type/text.phtml</template></action>
301
+ <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/composite/fieldset/options/type/file.phtml</template></action>
302
+ <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/composite/fieldset/options/type/select.phtml</template></action>
303
+ <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/composite/fieldset/options/type/date.phtml</template></action>
304
+ <block type="core/template" name="product.composite.fieldset.options.js" as="options_js" template="catalog/product/composite/fieldset/options/js.phtml"/>
305
+ </block>
306
+ <block type="adminhtml/catalog_product_composite_fieldset_qty" name="product.composite.fieldset.qty" template="catalog/product/composite/fieldset/qty.phtml"/>
307
+ </block>
308
+ </ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE>
309
+
310
+ <ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR>
311
+ <block type="adminhtml/catalog_product_composite_error" name="product.composite.error" output="toHtml" />
312
+ </ADMINHTML_CATALOG_PRODUCT_COMPOSITE_CONFIGURE_ERROR>
313
+
314
+ <ADMINHTML_CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT>
315
+ <block type="adminhtml/catalog_product_composite_update_result" name="product.composite.update.result" output="toHtml" />
316
+ </ADMINHTML_CATALOG_PRODUCT_COMPOSITE_UPDATE_RESULT>
317
+ <!--
318
+ Additional block in composite_fieldset block dependant on product type
319
+ -->
320
+ <PRODUCT_TYPE_configurable>
321
+ <reference name="product.composite.fieldset">
322
+ <block type="adminhtml/catalog_product_composite_fieldset_configurable" name="product.composite.fieldset.configurable" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/configurable.phtml" />
323
+ </reference>
324
+ </PRODUCT_TYPE_configurable>
325
+ <PRODUCT_TYPE_grouped>
326
+ <reference name="product.composite.fieldset">
327
+ <block type="adminhtml/catalog_product_composite_fieldset_grouped" name="product.composite.fieldset.grouped" before="product.composite.fieldset.options" template="catalog/product/composite/fieldset/grouped.phtml"/>
328
+ <remove name="product.composite.fieldset.qty"/>
329
+ </reference>
330
+ </PRODUCT_TYPE_grouped>
331
+
332
+ </layout>
app/design/adminhtml/default/default/layout/centinel.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+
31
+ <adminhtml_centinel_index_authenticationstart>
32
+ <block type="centinel/authentication_start" name="root" output="toHtml" template="centinel/authentication/start.phtml"/>
33
+ </adminhtml_centinel_index_authenticationstart>
34
+
35
+ <adminhtml_centinel_index_authenticationcomplete>
36
+ <block type="centinel/authentication_complete" name="root" output="toHtml" template="centinel/authentication/complete.phtml"/>
37
+ </adminhtml_centinel_index_authenticationcomplete>
38
+
39
+ <adminhtml_sales_order_create_index>
40
+ <reference name="head">
41
+ <action method="addJs"><script>mage/adminhtml/sales/centinel.js</script></action>
42
+ </reference>
43
+ <reference name="data">
44
+ <block type="centinel/adminhtml_validation" as="card_validation" name="card_validation" template="sales/order/create/abstract.phtml">
45
+ <block type="centinel/adminhtml_validation_form" template="centinel/validation/form.phtml" name="form" />
46
+ </block>
47
+ </reference>
48
+ </adminhtml_sales_order_create_index>
49
+
50
+ <adminhtml_sales_order_create_start>
51
+ <update handle="adminhtml_sales_order_create_index"/>
52
+ </adminhtml_sales_order_create_start>
53
+
54
+ <adminhtml_sales_order_create_load_block_data>
55
+ <reference name="data">
56
+ <block type="centinel/adminhtml_validation" as="card_validation" name="card_validation" template="sales/order/create/abstract.phtml">
57
+ <block type="centinel/adminhtml_validation_form" template="centinel/validation/form.phtml" name="form" />
58
+ </block>
59
+ </reference>
60
+ </adminhtml_sales_order_create_load_block_data>
61
+
62
+ <adminhtml_sales_order_create_load_block_card_validation>
63
+ <reference name="content">
64
+ <block type="centinel/adminhtml_validation" as="card_validation" name="card_validation" template="sales/order/create/abstract.phtml">
65
+ <block type="centinel/adminhtml_validation_form" template="centinel/validation/form.phtml" name="form" />
66
+ </block>
67
+ </reference>
68
+ </adminhtml_sales_order_create_load_block_card_validation>
69
+
70
+ </layout>
app/design/adminhtml/default/default/layout/cms.xml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_cms_page_index>
31
+ <reference name="content">
32
+ <block type="adminhtml/cms_page" name="cms_page"></block>
33
+ </reference>
34
+ </adminhtml_cms_page_index>
35
+
36
+ <adminhtml_cms_page_new>
37
+ <update handle="adminhtml_cms_page_edit" />
38
+ </adminhtml_cms_page_new>
39
+
40
+ <adminhtml_cms_page_edit>
41
+ <update handle="editor"/>
42
+ <reference name="content">
43
+ <block type="adminhtml/cms_page_edit" name="cms_page_edit"></block>
44
+ </reference>
45
+ <reference name="left">
46
+ <block type="adminhtml/cms_page_edit_tabs" name="cms_page_edit_tabs">
47
+ <block type="adminhtml/cms_page_edit_tab_main" name="cms_page_edit_tab_main" />
48
+ <block type="adminhtml/cms_page_edit_tab_content" name="cms_page_edit_tab_content" />
49
+ <block type="adminhtml/cms_page_edit_tab_design" name="cms_page_edit_tab_design" />
50
+ <block type="adminhtml/cms_page_edit_tab_meta" name="cms_page_edit_tab_meta" />
51
+ <action method="addTab"><name>main_section</name><block>cms_page_edit_tab_main</block></action>
52
+ <action method="addTab"><name>content_section</name><block>cms_page_edit_tab_content</block></action>
53
+ <action method="addTab"><name>design_section</name><block>cms_page_edit_tab_design</block></action>
54
+ <action method="addTab"><name>meta_section</name><block>cms_page_edit_tab_meta</block></action>
55
+ </block>
56
+ </reference>
57
+ </adminhtml_cms_page_edit>
58
+
59
+ <adminhtml_cms_block_index>
60
+ <reference name="content">
61
+ <block type="adminhtml/cms_block" name="cms_block"></block>
62
+ </reference>
63
+ </adminhtml_cms_block_index>
64
+
65
+ <adminhtml_cms_block_new>
66
+ <update handle="adminhtml_cms_block_edit" />
67
+ </adminhtml_cms_block_new>
68
+
69
+ <adminhtml_cms_block_edit>
70
+ <update handle="editor"/>
71
+ <reference name="content">
72
+ <block type="adminhtml/cms_block_edit" name="cms_block_edit"></block>
73
+ </reference>
74
+ </adminhtml_cms_block_edit>
75
+
76
+ <adminhtml_cms_wysiwyg_images_index>
77
+ <remove name="footer" />
78
+ <remove name="head" />
79
+ <reference name="left">
80
+ <block name="wysiwyg_images.js" type="adminhtml/cms_wysiwyg_images_content" template="cms/browser/js.phtml" />
81
+ <block name="wysiwyg_images.tree" type="adminhtml/cms_wysiwyg_images_tree" template="cms/browser/tree.phtml" />
82
+ </reference>
83
+ <reference name="content">
84
+ <block name="wysiwyg_images.content" type="adminhtml/cms_wysiwyg_images_content" template="cms/browser/content.phtml">
85
+ <block name="wysiwyg_images.uploader" type="adminhtml/cms_wysiwyg_images_content_uploader" template="cms/browser/content/uploader.phtml" />
86
+ <block name="wysiwyg_images.newfolder" type="adminhtml/cms_wysiwyg_images_content_newfolder" template="cms/browser/content/newfolder.phtml" />
87
+ </block>
88
+ </reference>
89
+ </adminhtml_cms_wysiwyg_images_index>
90
+
91
+ <adminhtml_cms_wysiwyg_images_contents>
92
+ <block name="wysiwyg_images.files" type="adminhtml/cms_wysiwyg_images_content_files" template="cms/browser/content/files.phtml" output="toHtml" />
93
+ </adminhtml_cms_wysiwyg_images_contents>
94
+
95
+ </layout>
app/design/adminhtml/default/default/layout/compiler.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_compiler_process_index>
31
+ <reference name="content">
32
+ <block type="compiler/process" name="compiler_process" template="compiler/process.phtml"></block>
33
+ </reference>
34
+ </adminhtml_compiler_process_index>
35
+ </layout>
app/design/adminhtml/default/default/layout/connect.xml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_extension_custom_edit>
31
+ <reference name="content">
32
+ <block type="connect/adminhtml_extension_custom_edit" name="connect_extension_edit"></block>
33
+ </reference>
34
+ <reference name="left">
35
+ <block type="connect/adminhtml_extension_custom_edit_tabs" name="connect_extension_edit_tabs">
36
+ <block type="connect/adminhtml_extension_custom_edit_tab_package" name="tab_package"
37
+ template="connect/extension/custom/package.phtml" />
38
+ <block type="connect/adminhtml_extension_custom_edit_tab_release" name="tab_release"
39
+ template="connect/extension/custom/release.phtml" />
40
+ <block type="connect/adminhtml_extension_custom_edit_tab_authors" name="tab_authors"
41
+ template="connect/extension/custom/authors.phtml" />
42
+ <block type="connect/adminhtml_extension_custom_edit_tab_depends" name="tab_depends"
43
+ template="connect/extension/custom/depends.phtml" />
44
+ <block type="connect/adminhtml_extension_custom_edit_tab_contents" name="tab_contents"
45
+ template="connect/extension/custom/contents.phtml" />
46
+ <block type="connect/adminhtml_extension_custom_edit_tab_local" name="tab_local" />
47
+
48
+ <action method="addTab"><name>package_info</name><block>tab_package</block></action>
49
+ <action method="addTab"><name>release_info</name><block>tab_release</block></action>
50
+ <action method="addTab"><name>authors</name><block>tab_authors</block></action>
51
+ <action method="addTab"><name>dependencies</name><block>tab_depends</block></action>
52
+ <action method="addTab"><name>contents</name><block>tab_contents</block></action>
53
+ <action method="addTab"><name>load_local_package</name><block>tab_local</block></action>
54
+ </block>
55
+ </reference>
56
+ </adminhtml_extension_custom_edit>
57
+
58
+ <adminhtml_extension_custom_loadtab>
59
+ <block type="core/text_list" name="root">
60
+ <block type="connect/adminhtml_extension_custom_edit_tab_load" name="connect_extension_load_local_package_grid"
61
+ template="connect/extension/custom/load.phtml">
62
+ <block type="connect/adminhtml_extension_custom_edit_tab_grid" name="local_package_grid" />
63
+ </block>
64
+ </block>
65
+ </adminhtml_extension_custom_loadtab>
66
+
67
+ <adminhtml_extension_custom_grid>
68
+ <block type="core/text_list" name="root">
69
+ <block type="connect/adminhtml_extension_custom_edit_tab_grid" name="connect_extension_edit_local_package_grid" />
70
+ </block>
71
+ </adminhtml_extension_custom_grid>
72
+ </layout>
73
+
app/design/adminhtml/default/default/layout/currencysymbol.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_system_currencysymbol_index>
30
+ <reference name="content">
31
+ <block type="currencysymbol/adminhtml_system_currencysymbol" name="mage.system.currencysymbol" template="currencysymbol/grid.phtml"/>
32
+ </reference>
33
+ </adminhtml_system_currencysymbol_index>
34
+ </layout>
app/design/adminhtml/default/default/layout/customer.xml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_customer_edit>
31
+ <reference name="content">
32
+ <block type="adminhtml/customer_edit" name="customer_edit"></block>
33
+ </reference>
34
+ <reference name="head">
35
+ <block type="adminhtml/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
36
+ <action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
37
+ <action method="addJs"><file>varien/configurable.js</file></action>
38
+ </reference>
39
+ <reference name="left">
40
+ <block type="adminhtml/customer_edit_tabs" name="customer_edit_tabs">
41
+ <block type="adminhtml/customer_edit_tab_view" name="customer_edit_tab_view" template="customer/tab/view.phtml">
42
+ <block type="adminhtml/customer_edit_tab_view_sales" name="sales" template="customer/tab/view/sales.phtml" before="-" />
43
+ <block type="adminhtml/customer_edit_tab_view_accordion" name="accordion" />
44
+ </block>
45
+ <action method="addTab"><name>customer_edit_tab_view</name><block>customer_edit_tab_view</block></action>
46
+ </block>
47
+ </reference>
48
+ <reference name="js">
49
+ <block type="adminhtml/template" template="customer/edit/js.phtml" name="customer.edit.js" as="customer_edit_js"></block>
50
+ </reference>
51
+ </adminhtml_customer_edit>
52
+ <adminhtml_customer_group_index>
53
+ <reference name="content">
54
+ <block type="adminhtml/customer_group" name="customer_group"></block>
55
+ </reference>
56
+ </adminhtml_customer_group_index>
57
+ <adminhtml_customer_wishlist>
58
+ <block type="adminhtml/customer_edit_tab_wishlist" name="customer.wishlist.edit.tab" output="toHtml" />
59
+ </adminhtml_customer_wishlist>
60
+
61
+ <adminhtml_customer_orders>
62
+ <block type="core/text_list" name="root" output="toHtml">
63
+ <block type="adminhtml/customer_edit_tab_orders" name="adminhtml.customer.edit.tab.orders"/>
64
+ </block>
65
+ </adminhtml_customer_orders>
66
+
67
+ <adminhtml_customer_carts>
68
+ <block type="core/text_list" name="root" output="toHtml">
69
+ <block type="adminhtml/customer_edit_tab_carts" name="admin.customer.carts"/>
70
+ </block>
71
+ </adminhtml_customer_carts>
72
+
73
+ <adminhtml_customer_viewcart>
74
+ <block type="core/text_list" name="root" output="toHtml">
75
+ <block type="adminhtml/customer_edit_tab_view_cart" name="admin.customer.view.cart"/>
76
+ </block>
77
+ </adminhtml_customer_viewcart>
78
+
79
+ <adminhtml_customer_viewwishlist>
80
+ <block type="core/text_list" name="root" output="toHtml">
81
+ <block type="adminhtml/customer_edit_tab_view_wishlist" name="admin.customer.view.wishlist"/>
82
+ </block>
83
+ </adminhtml_customer_viewwishlist>
84
+
85
+ <adminhtml_customer_lastorders>
86
+ <block type="core/text_list" name="root" output="toHtml">
87
+ <block type="adminhtml/customer_edit_tab_view_orders" name="admin.customer.lastorders"/>
88
+ </block>
89
+ </adminhtml_customer_lastorders>
90
+
91
+ <adminhtml_customer_productreviews>
92
+ <block type="core/text_list" name="root" output="toHtml">
93
+ <block type="adminhtml/customer_edit_tab_reviews" name="admin.customer.reviews"/>
94
+ </block>
95
+ </adminhtml_customer_productreviews>
96
+
97
+ <adminhtml_customer_producttags>
98
+ <block type="core/text_list" name="root" output="toHtml">
99
+ <block type="adminhtml/customer_edit_tab_tag" name="admin.customer.tags"/>
100
+ </block>
101
+ </adminhtml_customer_producttags>
102
+
103
+ <adminhtml_customer_taggrid>
104
+ <block type="core/text_list" name="root" output="toHtml">
105
+ <block type="adminhtml/customer_edit_tab_tag" name="admin.customer.tags"/>
106
+ </block>
107
+ </adminhtml_customer_taggrid>
108
+
109
+ <adminhtml_customer_newsletter>
110
+ <block type="core/text_list" name="root" output="toHtml">
111
+ <block type="adminhtml/customer_edit_tab_newsletter_grid" name="admin.customer.newsletter.grid"/>
112
+ </block>
113
+ </adminhtml_customer_newsletter>
114
+
115
+ <adminhtml_customer_grid>
116
+ <block type="core/text_list" name="root" output="toHtml">
117
+ <block type="adminhtml/customer_grid" name="admin.customer.grid"/>
118
+ </block>
119
+ </adminhtml_customer_grid>
120
+
121
+ <adminhtml_customer_cart>
122
+ <block type="core/text_list" name="root" output="toHtml">
123
+ <block type="adminhtml/customer_edit_tab_cart" name="admin.customer.view.edit.cart" />
124
+ </block>
125
+ </adminhtml_customer_cart>
126
+ </layout>
app/{code/community/Gec/Customimport/Helper/Data.php → design/adminhtml/default/default/layout/customimport.xml} RENAMED
@@ -1,23 +1,30 @@
1
- <?php
2
- /**
3
- # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
4
- # @author Serenus Infotech <magento@serenusinfotech.com>
5
- #
6
- # This program is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU Affero General Public License as
8
- # published by the Free Software Foundation, either version 3 of the
9
- # License, or (at your option) any later version.
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # You should have received a copy of the GNU Affero General Public License
17
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
- **/
19
-
20
- class Gec_Customimport_Helper_Data extends Mage_Core_Helper_Abstract
21
- {
22
-
23
- }
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ # Copyright (C) 2013 Global Era (http://www.globalera.com). All Rights Reserved
5
+ # @author Serenus Infotech <magento@serenusinfotech.com>
6
+ #
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as
9
+ # published by the Free Software Foundation, either version 3 of the
10
+ # License, or (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
+ **/
20
+ -->
21
+ <layout version="0.1.0">
22
+ <customimport_adminhtml_index_index>
23
+ <!--<reference name="root">
24
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
25
+ </reference>-->
26
+ <reference name="content">
27
+ <block type="customimport/adminhtml_customimport" name="hello" template="customimport/customimport.phtml"/>
28
+ </reference>
29
+ </customimport_adminhtml_index_index>
30
+ </layout>
app/design/adminhtml/default/default/layout/dataflow.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <adminhtml_system_convert_gui_run>
32
+ <remove name="root"/>
33
+ <block type="adminhtml/page" name="convert_root" output="toHtml" template="page.phtml">
34
+ <block type="adminhtml/page_head" name="convert_root_head" as="head" template="page/head.phtml">
35
+ <action method="addJs"><script>prototype/prototype.js</script></action>
36
+ <action method="addJs"><script>prototype/validation.js</script></action>
37
+ <action method="addJs"><script>varien/js.js</script></action>
38
+ <action method="addJs"><script>mage/translate.js</script></action>
39
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
40
+ </block>
41
+ <block type="adminhtml/system_convert_profile_run" name="system_convert_profile_run" template="system/convert/profile/process.phtml" output="toHtml"/>
42
+ </block>
43
+ </adminhtml_system_convert_gui_run>
44
+
45
+ <adminhtml_system_convert_profile_run>
46
+ <remove name="root"/>
47
+ <block type="adminhtml/page" name="convert_root" output="toHtml" template="page.phtml">
48
+ <block type="adminhtml/page_head" name="convert_root_head" as="head" template="page/head.phtml">
49
+ <action method="addJs"><script>prototype/prototype.js</script></action>
50
+ <action method="addJs"><script>prototype/validation.js</script></action>
51
+ <action method="addJs"><script>varien/js.js</script></action>
52
+ <action method="addJs"><script>mage/translate.js</script></action>
53
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
54
+ </block>
55
+ <block type="adminhtml/system_convert_profile_run" name="system_convert_profile_run" template="system/convert/profile/process.phtml" output="toHtml"/>
56
+ </block>
57
+ </adminhtml_system_convert_profile_run>
58
+
59
+ </layout>
app/design/adminhtml/default/default/layout/downloadable.xml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <adminhtml_catalog_product_downloadable>
32
+ <reference name="product_tabs">
33
+ <action method="addTab"><name>downloadable_items</name><block>downloadable/adminhtml_catalog_product_edit_tab_downloadable</block></action>
34
+ </reference>
35
+ </adminhtml_catalog_product_downloadable>
36
+
37
+ <adminhtml_sales_order_view>
38
+ <reference name="order_items">
39
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>downloadable/sales/order/view/items/renderer/downloadable.phtml</template></action>
40
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/name.phtml</template></action>
41
+ </reference>
42
+ </adminhtml_sales_order_view>
43
+
44
+ <adminhtml_sales_order_invoice_new>
45
+ <reference name="order_items">
46
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml</template></action>
47
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/invoice/name.phtml</template></action>
48
+ </reference>
49
+ </adminhtml_sales_order_invoice_new>
50
+
51
+ <adminhtml_sales_order_invoice_updateqty>
52
+ <reference name="order_items">
53
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/invoice/create/items/renderer/downloadable.phtml</template></action>
54
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/invoice/name.phtml</template></action>
55
+ </reference>
56
+ </adminhtml_sales_order_invoice_updateqty>
57
+
58
+ <adminhtml_sales_order_invoice_view>
59
+ <reference name="invoice_items">
60
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/invoice/view/items/renderer/downloadable.phtml</template></action>
61
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/invoice/name.phtml</template></action>
62
+ </reference>
63
+ </adminhtml_sales_order_invoice_view>
64
+
65
+ <adminhtml_sales_order_creditmemo_new>
66
+ <reference name="order_items">
67
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml</template></action>
68
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/creditmemo/name.phtml</template></action>
69
+ </reference>
70
+ </adminhtml_sales_order_creditmemo_new>
71
+
72
+ <adminhtml_sales_order_creditmemo_updateqty>
73
+ <reference name="order_items">
74
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/creditmemo/create/items/renderer/downloadable.phtml</template></action>
75
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/creditmemo/name.phtml</template></action>
76
+ </reference>
77
+ </adminhtml_sales_order_creditmemo_updateqty>
78
+
79
+ <adminhtml_sales_order_creditmemo_view>
80
+ <reference name="creditmemo_items">
81
+ <action method="addItemRender"><type>downloadable</type><block>adminhtml/sales_items_renderer_default</block><template>downloadable/sales/order/creditmemo/view/items/renderer/downloadable.phtml</template></action>
82
+ <action method="addColumnRender"><column>downloadable</column><block>downloadable/adminhtml_sales_items_column_downloadable_name</block><template>downloadable/sales/items/column/downloadable/creditmemo/name.phtml</template></action>
83
+ </reference>
84
+ </adminhtml_sales_order_creditmemo_view>
85
+
86
+ <adminhtml_customer_wishlist>
87
+ <reference name="customer.wishlist.edit.tab">
88
+ <action method="addProductConfigurationHelper"><type>downloadable</type><name>downloadable/catalog_product_configuration</name></action>
89
+ </reference>
90
+ </adminhtml_customer_wishlist>
91
+
92
+ <PRODUCT_TYPE_downloadable>
93
+ <reference name="product.composite.fieldset">
94
+ <block type="downloadable/adminhtml_catalog_product_composite_fieldset_downloadable" name="product.composite.fieldset.downloadable" before="product.composite.fieldset.options" template="downloadable/product/composite/fieldset/downloadable.phtml" />
95
+ </reference>
96
+ </PRODUCT_TYPE_downloadable>
97
+ </layout>
app/design/adminhtml/default/default/layout/giftmessage.xml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_sales_order_view>
31
+ <reference name="order_item_extra_info">
32
+ <block type="giftmessage/adminhtml_sales_order_view_giftoptions" name="gift_options_link" template="giftmessage/sales/order/view/giftoptions.phtml">
33
+ <block type="giftmessage/adminhtml_sales_order_view_items" name="gift_options_item_data" template="giftmessage/sales/order/view/items.phtml" />
34
+ </block>
35
+ </reference>
36
+ <reference name="order_tab_info">
37
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
38
+ <block type="giftmessage/adminhtml_sales_order_view_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
39
+ </block>
40
+ </reference>
41
+ </adminhtml_sales_order_view>
42
+
43
+ <adminhtml_sales_order_create_index>
44
+ <reference name="order_item_extra_info">
45
+ <block type="giftmessage/adminhtml_sales_order_create_giftoptions" name="gift_options_link" template="giftmessage/sales/order/create/giftoptions.phtml">
46
+ <block type="giftmessage/adminhtml_sales_order_create_items" name="gift_options_item_data" template="giftmessage/sales/order/create/items.phtml" />
47
+ </block>
48
+ </reference>
49
+ <reference name="items_grid">
50
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
51
+ <block type="giftmessage/adminhtml_sales_order_create_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
52
+ </block>
53
+ </reference>
54
+ </adminhtml_sales_order_create_index>
55
+
56
+ <adminhtml_sales_order_create_load_block_data>
57
+ <reference name="order_item_extra_info">
58
+ <block type="giftmessage/adminhtml_sales_order_create_giftoptions" name="gift_options_link" template="giftmessage/sales/order/create/giftoptions.phtml">
59
+ <block type="giftmessage/adminhtml_sales_order_create_items" name="gift_options_item_data" template="giftmessage/sales/order/create/items.phtml" />
60
+ </block>
61
+ </reference>
62
+ <reference name="items_grid">
63
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
64
+ <block type="giftmessage/adminhtml_sales_order_create_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
65
+ </block>
66
+ </reference>
67
+ </adminhtml_sales_order_create_load_block_data>
68
+
69
+ <adminhtml_sales_order_create_load_block_items>
70
+ <reference name="order_item_extra_info">
71
+ <block type="giftmessage/adminhtml_sales_order_create_giftoptions" name="gift_options_link" template="giftmessage/sales/order/create/giftoptions.phtml">
72
+ <block type="giftmessage/adminhtml_sales_order_create_items" name="gift_options_item_data" template="giftmessage/sales/order/create/items.phtml" />
73
+ </block>
74
+ </reference>
75
+ <reference name="items_grid">
76
+ <block type="adminhtml/template" name="popup_window" template="giftmessage/popup.phtml">
77
+ <block type="giftmessage/adminhtml_sales_order_create_form" name="gift_options_form" template="giftmessage/giftoptionsform.phtml" />
78
+ </block>
79
+ </reference>
80
+ </adminhtml_sales_order_create_load_block_items>
81
+ </layout>
82
+
app/design/adminhtml/default/default/layout/importexport.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_import_index>
30
+ <reference name="content">
31
+ <block type="adminhtml/template" template="importexport/import/form/before.phtml" name="import.form.before" alias="form_before"/>
32
+ <block type="importexport/adminhtml_import_edit" name="import.form.container"/>
33
+ <block type="adminhtml/template" template="importexport/import/form/after.phtml" name="import.form.after" alias="form_after"/>
34
+ </reference>
35
+ </adminhtml_import_index>
36
+ <adminhtml_import_validate>
37
+ <block type="importexport/adminhtml_import_frame_result" template="importexport/import/frame/result.phtml" name="import.frame.result" alias="import_frame_result" output="toHtml"/>
38
+ </adminhtml_import_validate>
39
+ <adminhtml_import_start>
40
+ <block type="importexport/adminhtml_import_frame_result" template="importexport/import/frame/result.phtml" name="import.frame.result" alias="import_frame_result" output="toHtml"/>
41
+ </adminhtml_import_start>
42
+ <adminhtml_import_busy>
43
+ <reference name="content">
44
+ <block type="core/template" template="importexport/busy.phtml" name="busy" alias="busy"/>
45
+ </reference>
46
+ </adminhtml_import_busy>
47
+ <adminhtml_export_index>
48
+ <reference name="content">
49
+ <block type="adminhtml/template" template="importexport/export/form/before.phtml" name="export.form.before" alias="form_before"/>
50
+ <block type="importexport/adminhtml_export_edit" name="export.form.container"/>
51
+ <block type="adminhtml/template" template="importexport/export/form/after.phtml" name="export.form.after" alias="form_after"/>
52
+ </reference>
53
+ </adminhtml_export_index>
54
+ <adminhtml_export_getfilter>
55
+ <block type="core/text_list" name="root">
56
+ <block type="importexport/adminhtml_export_filter" name="export.filter"/>
57
+ </block>
58
+ </adminhtml_export_getfilter>
59
+ </layout>
app/design/adminhtml/default/default/layout/index.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <default>
30
+ <reference name="notifications">
31
+ <block type="index/adminhtml_notifications" name="index_notifications" template="index/notifications.phtml"></block>
32
+ </reference>
33
+ </default>
34
+
35
+ <adminhtml_process_edit>
36
+ <reference name="content">
37
+ <block type="index/adminhtml_process_edit" name="process_edit"></block>
38
+ </reference>
39
+ <reference name="left">
40
+ <block type="index/adminhtml_process_edit_tabs" name="index_edit_tabs">
41
+ <action method="addTab"><name>main_section</name><block>index/adminhtml_process_edit_tab_main</block></action>
42
+ </block>
43
+ </reference>
44
+ </adminhtml_process_edit>
45
+
46
+ <adminhtml_process_list>
47
+ <reference name="content">
48
+ <block type="index/adminhtml_process" name="process" />
49
+ </reference>
50
+ </adminhtml_process_list>
51
+ </layout>
app/design/adminhtml/default/default/layout/main.xml ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+
29
+ Supported layout update handles (action):
30
+
31
+
32
+ Supported layout update handles (special):
33
+ - adminhtml
34
+ - default
35
+ - admin_noroute
36
+ - admin_denied
37
+ - preview
38
+ - systemPreview
39
+ -->
40
+
41
+ <layout>
42
+
43
+ <!--
44
+ Form key for inserting into various forms
45
+ -->
46
+ <formkey>
47
+ <block type="core/template" name="formkey" as="formkey" template="formkey.phtml"/>
48
+ </formkey>
49
+
50
+ <!--
51
+ Default layout, loads most of the pages
52
+ -->
53
+
54
+ <default>
55
+ <block type="adminhtml/page" name="root" output="toHtml" template="page.phtml">
56
+ <block type="adminhtml/page_head" name="head" as="head" template="page/head.phtml">
57
+ <action method="setTitle" translate="title"><title>Magento Admin</title></action>
58
+ <action method="addJs"><script>prototype/prototype.js</script></action>
59
+ <action method="addItem"><type>js</type><name>extjs/fix-defer-before.js</name><params/><if/><condition>can_load_ext_js</condition></action>
60
+ <action method="addJs"><script>prototype/window.js</script></action>
61
+ <action method="addJs"><script>scriptaculous/builder.js</script></action>
62
+ <action method="addJs"><script>scriptaculous/effects.js</script></action>
63
+ <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
64
+ <action method="addJs"><script>scriptaculous/controls.js</script></action>
65
+ <action method="addJs"><script>scriptaculous/slider.js</script></action>
66
+ <action method="addJs"><script>lib/ccard.js</script></action>
67
+ <action method="addJs"><script>prototype/validation.js</script></action>
68
+ <action method="addJs"><script>varien/js.js</script></action>
69
+ <action method="addJs"><script>mage/translate.js</script></action>
70
+
71
+ <action method="addJs"><script>mage/adminhtml/hash.js</script></action>
72
+ <action method="addJs"><script>mage/adminhtml/events.js</script></action>
73
+ <action method="addJs"><script>mage/adminhtml/loader.js</script></action>
74
+ <action method="addJs"><script>mage/adminhtml/grid.js</script></action>
75
+ <action method="addJs"><script>mage/adminhtml/tabs.js</script></action>
76
+ <action method="addJs"><script>mage/adminhtml/form.js</script></action>
77
+ <action method="addJs"><script>mage/adminhtml/accordion.js</script></action>
78
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
79
+ <action method="addJs"><script>mage/adminhtml/uploader.js</script></action>
80
+ <action method="addJs"><script>mage/adminhtml/product.js</script></action>
81
+
82
+ <action method="addCss"><name>reset.css</name></action>
83
+ <action method="addCss"><name>boxes.css</name></action>
84
+ <action method="addCss"><name>custom.css</name></action>
85
+
86
+ <action method="addItem"><type>skin_css</type><name>iestyles.css</name><params/><if>lt IE 8</if></action>
87
+ <action method="addItem"><type>skin_css</type><name>below_ie7.css</name><params/><if>lt IE 7</if></action>
88
+ <action method="addItem"><type>skin_css</type><name>ie7.css</name><params/><if>IE 7</if></action>
89
+
90
+ <action method="addCss"><name>print.css</name><params>media="print"</params></action>
91
+
92
+ <action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params>defer</params><if>lt IE 7</if></action>
93
+ <action method="addItem"><type>js</type><name>varien/iehover-fix.js</name><params/><if>lt IE 7</if></action>
94
+
95
+ <action method="addItem"><type>skin_css</type><name>menu.css</name><params>media="screen, projection"</params></action>
96
+
97
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
98
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
99
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
100
+
101
+ <action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if/><condition>can_load_ext_js</condition></action>
102
+ <action method="addItem"><type>js</type><name>extjs/fix-defer.js</name><params/><if/><condition>can_load_ext_js</condition></action>
103
+ <action method="addItem"><type>js</type><name>extjs/ext-tree-checkbox.js</name><params/><if/><condition>can_load_ext_js</condition></action>
104
+ <action method="addItem"><type>js_css</type><name>extjs/resources/css/ext-all.css</name><params/><if/><condition>can_load_ext_js</condition></action>
105
+ <action method="addItem"><type>js_css</type><name>extjs/resources/css/ytheme-magento.css</name><params/><if/><condition>can_load_ext_js</condition></action>
106
+
107
+ <action method="addItem"><type>js</type><name>mage/adminhtml/rules.js</name><params/><if/><condition>can_load_rules_js</condition></action>
108
+
109
+ <action method="addItem"><type>js</type><name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name><params/><if/><condition>can_load_tiny_mce</condition></action>
110
+
111
+ <block type="core/html_calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/>
112
+ </block>
113
+
114
+ <block type="adminhtml/page_notices" name="global_notices" as="global_notices" template="page/notices.phtml" />
115
+ <block type="adminhtml/page_header" name="header" as="header"></block>
116
+ <block type="adminhtml/page_menu" name="menu" as="menu"></block>
117
+ <block type="core/text_list" name="notifications" as="notifications">
118
+ <block type="adminhtml/notification_baseurl" name="notification_baseurl" as="notification_baseurl" template="notification/baseurl.phtml"></block>
119
+ <block type="adminhtml/cache_notifications" name="cache_notifications" template="system/cache/notifications.phtml"></block>
120
+ <block type="adminhtml/notification_survey" name="notification_survey" template="notification/survey.phtml"/>
121
+ <block type="adminhtml/notification_security" name="notification_security" as="notification_security" template="notification/security.phtml"></block>
122
+ </block>
123
+ <block type="adminhtml/widget_breadcrumbs" name="breadcrumbs" as="breadcrumbs"></block>
124
+
125
+ <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in Mage_Core_Model_Layout::createBlock() -->
126
+ <block type="core/template" name="formkey" as="formkey" template="formkey.phtml"/>
127
+
128
+ <!-- deprecated since 1.7.0.0 see Mage_Page_Block_Js_Translate -->
129
+ <block type="page/js_translate" name="js_translate" as="js_translate" template="page/js/translate.phtml"/>
130
+ <block type="core/text_list" name="left" as="left"/>
131
+ <block type="core/text_list" name="content" as="content"/>
132
+ <block type="core/messages" name="messages" as="messages"/>
133
+ <block type="core/text_list" name="js" as="js"/>
134
+ <block type="adminhtml/page_footer" name="footer" as="footer">
135
+ <action method="setBugreportUrl"><url>http://www.magentocommerce.com/bug-tracking</url></action>
136
+ <action method="setConnectWithMagentoUrl"><url>http://magento.com/resources/technical</url></action>
137
+ </block>
138
+ <block type="core/profiler" name="profiler" as="profiler"/>
139
+ <block type="core/text_list" name="before_body_end" as="before_body_end"/>
140
+
141
+ </block>
142
+ </default>
143
+
144
+ <!--
145
+ Layout for pop up windows
146
+ -->
147
+ <popup>
148
+ <update handle="default"/>
149
+ <remove name="header"/>
150
+ <remove name="menu"/>
151
+ <reference name="root">
152
+ <action method="setTemplate"><template>popup.phtml</template></action>
153
+ </reference>
154
+ </popup>
155
+
156
+ <!--
157
+ Layout for overlay pop up windows
158
+ -->
159
+ <overlay_popup>
160
+ <update handle="popup"/>
161
+ <reference name="root">
162
+ <action method="setTemplate"><template>overlay_popup.phtml</template></action>
163
+ </reference>
164
+ </overlay_popup>
165
+
166
+ <!--
167
+ Layout for editor element
168
+ -->
169
+ <editor>
170
+ <reference name="head">
171
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
172
+ <action method="addJs"><script>mage/adminhtml/variables.js</script></action>
173
+ <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
174
+ <action method="addJs"><script>lib/flex.js</script></action>
175
+ <action method="addJs"><script>lib/FABridge.js</script></action>
176
+ <action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
177
+ <action method="addJs"><script>mage/adminhtml/browser.js</script></action>
178
+ <action method="addJs"><script>prototype/window.js</script></action>
179
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
180
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
181
+ </reference>
182
+ </editor>
183
+
184
+ <!--
185
+ No page found
186
+ -->
187
+
188
+ <adminhtml_noroute>
189
+ <reference name="content">
190
+ <block type="core/text" name="content.noRoute">
191
+ <action method="setText" translate="text" module="adminhtml"><text><![CDATA[<h1 class="page-heading">404 Error</h1><p>Page not found.</p>]]></text></action>
192
+ </block>
193
+ </reference>
194
+ </adminhtml_noroute>
195
+
196
+ <!--
197
+ Access denied
198
+ -->
199
+
200
+ <adminhtml_denied>
201
+ <reference name="content">
202
+ <block type="adminhtml/denied" name="content.denied" template="access_denied.phtml"/>
203
+ </reference>
204
+ </adminhtml_denied>
205
+
206
+ <!--
207
+ Base preview layout (?)
208
+ -->
209
+
210
+ <preview>
211
+ <block type="core/template" name="root" output="toHtml" template="newsletter/template/preview.phtml">
212
+ <block type="adminhtml/newsletter_template_preview" name="content" as="content"></block>
213
+ </block>
214
+ </preview>
215
+
216
+ <newsletter_template_preview>
217
+ <block type="core/template" name="root" output="toHtml" template="newsletter/template/preview.phtml">
218
+ <block type="adminhtml/newsletter_template_preview" name="content" as="content"></block>
219
+ </block>
220
+ </newsletter_template_preview>
221
+
222
+ <newsletter_template_preview_switcher>
223
+ <block type="core/template" name="root" output="toHtml" template="newsletter/template/preview/iframeswitcher.phtml">
224
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher" />
225
+ <block type="adminhtml/newsletter_template_preview_form" name="preview_form" />
226
+ </block>
227
+ </newsletter_template_preview_switcher>
228
+
229
+ <newsletter_queue_preview>
230
+ <block type="core/template" name="root" output="toHtml" template="newsletter/queue/preview.phtml">
231
+ <block type="adminhtml/newsletter_queue_preview" name="content" as="content"></block>
232
+ </block>
233
+ </newsletter_queue_preview>
234
+
235
+ <!--
236
+ Base customer alerts preview layout (?)
237
+ -->
238
+
239
+ <alert_preview>
240
+ <block type="core/template" name="root" output="toHtml" template="alert/template/preview.phtml">
241
+ <block type="adminhtml/alert_template_preview" name="content" as="content"></block>
242
+ </block>
243
+ </alert_preview>
244
+ <!--
245
+ Base preview layout
246
+ -->
247
+
248
+ <systemPreview>
249
+ <block type="core/template" name="root" output="toHtml" template="system/email/template/preview.phtml">
250
+ <block type="adminhtml/system_email_template_preview" name="content" as="content"></block>
251
+ </block>
252
+ </systemPreview>
253
+
254
+ <adminhtml_dashboard_customersmost>
255
+ <block type="core/text_list" name="root" output="toHtml">
256
+ <block type="adminhtml/dashboard_tab_customers_most" name="adminhtml.dashboard.tab.customers.most"/>
257
+ </block>
258
+ </adminhtml_dashboard_customersmost>
259
+
260
+ <adminhtml_dashboard_customersnewest>
261
+ <block type="core/text_list" name="root" output="toHtml">
262
+ <block type="adminhtml/dashboard_tab_customers_newest" name="adminhtml.dashboard.tab.customers.newest"/>
263
+ </block>
264
+ </adminhtml_dashboard_customersnewest>
265
+
266
+ <adminhtml_dashboard_productsviewed>
267
+ <block type="core/text_list" name="root" output="toHtml">
268
+ <block type="adminhtml/dashboard_tab_products_viewed" name="adminhtml.dashboard.tab.products.viewed"/>
269
+ </block>
270
+ </adminhtml_dashboard_productsviewed>
271
+
272
+ <adminhtml_index_login>
273
+ <block type="core/text_list" name="root" output="toHtml">
274
+ <block type="adminhtml/template" name="content" template="login.phtml">
275
+ <block type="core/text_list" name="form.additional.info" />
276
+ </block>
277
+ </block>
278
+ </adminhtml_index_login>
279
+
280
+ <adminhtml_index_forgotpassword>
281
+ <block type="core/text_list" name="root" output="toHtml">
282
+ <block type="adminhtml/template" name="content" template="forgotpassword.phtml">
283
+ <block type="core/text_list" name="form.additional.info" />
284
+ </block>
285
+ </block>
286
+ </adminhtml_index_forgotpassword>
287
+ <!--
288
+ Empty hanle for ajax response etc.
289
+ -->
290
+ <empty>
291
+ </empty>
292
+ </layout>
app/design/adminhtml/default/default/layout/moneybookers.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category design
17
+ * @package default_default
18
+ * @copyright Copyright (c) 2015 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <layout>
23
+ <adminhtml_system_config_edit>
24
+ <reference name="content">
25
+ <block type="moneybookers/jsinit" name="moneybookers_jsinit" template="moneybookers/jsinit.phtml"></block>
26
+ </reference>
27
+ </adminhtml_system_config_edit>
28
+ </layout>
app/design/adminhtml/default/default/layout/newsletter.xml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_newsletter_template_edit>
31
+ <update handle="editor"/>
32
+ <reference name="content">
33
+ <block type="adminhtml/newsletter_template_edit" name="template_edit" template="newsletter/template/edit.phtml" />
34
+ </reference>
35
+ </adminhtml_newsletter_template_edit>
36
+
37
+ <adminhtml_newsletter_queue_edit>
38
+ <update handle="editor"/>
39
+ <reference name="content">
40
+ <block type="adminhtml/newsletter_queue_edit" name="queue_edit" template="newsletter/queue/edit.phtml" />
41
+ </reference>
42
+ </adminhtml_newsletter_queue_edit>
43
+
44
+ <adminhtml_newsletter_queue_preview>
45
+ <reference name="root">
46
+ <action method="setTemplate"><template>newsletter/preview/iframeswitcher.phtml</template></action>
47
+ <block type="adminhtml/newsletter_queue_preview_form" name="preview_form" />
48
+ <block type="adminhtml/store_switcher" name="store_switcher" template="newsletter/preview/store.phtml" />
49
+ </reference>
50
+ </adminhtml_newsletter_queue_preview>
51
+
52
+ <adminhtml_newsletter_template_preview>
53
+ <reference name="root">
54
+ <action method="setTemplate"><template>newsletter/preview/iframeswitcher.phtml</template></action>
55
+ <block type="adminhtml/newsletter_template_preview_form" name="preview_form" />
56
+ <block type="adminhtml/store_switcher" name="store_switcher" template="newsletter/preview/store.phtml" />
57
+ </reference>
58
+ </adminhtml_newsletter_template_preview>
59
+
60
+ <newsletter_queue_preview>
61
+ <block type="adminhtml/newsletter_queue_preview" name="preview_template" />
62
+ </newsletter_queue_preview>
63
+
64
+ <newsletter_template_preview>
65
+ <block type="adminhtml/newsletter_template_preview" name="preview_template" />
66
+ </newsletter_template_preview>
67
+ </layout>
app/design/adminhtml/default/default/layout/oauth.xml ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <!-- Consumers -->
30
+ <adminhtml_oauth_consumer_index>
31
+ <reference name="content">
32
+ <block type="oauth/adminhtml_oauth_consumer" name="oauth_consumer"/>
33
+ </reference>
34
+ </adminhtml_oauth_consumer_index>
35
+
36
+ <adminhtml_oauth_consumer_grid>
37
+ <remove name="root"/>
38
+ <block type="oauth/adminhtml_oauth_consumer_grid" name="oauth_consumer.grid" output="toHtml"/>
39
+ </adminhtml_oauth_consumer_grid>
40
+
41
+ <adminhtml_oauth_consumer_new>
42
+ <reference name="content">
43
+ <block type="oauth/adminhtml_oauth_consumer_edit" name="oauth_consumer.edit">
44
+ <block type="oauth/adminhtml_oauth_consumer_edit_form" name="form"/>
45
+ </block>
46
+ </reference>
47
+ </adminhtml_oauth_consumer_new>
48
+
49
+ <adminhtml_oauth_consumer_edit>
50
+ <reference name="content">
51
+ <block type="oauth/adminhtml_oauth_consumer_edit" name="oauth_consumer.edit">
52
+ <block type="oauth/adminhtml_oauth_consumer_edit_form" name="form"/>
53
+ </block>
54
+ </reference>
55
+ </adminhtml_oauth_consumer_edit>
56
+ <!-- EOF Consumers -->
57
+
58
+ <!-- My Applications -->
59
+ <adminhtml_oauth_admin_token_index>
60
+ <reference name="content">
61
+ <block type="oauth/adminhtml_oauth_admin_token" name="oauth_admin_token"/>
62
+ </reference>
63
+ </adminhtml_oauth_admin_token_index>
64
+
65
+ <adminhtml_oauth_admin_token_grid>
66
+ <remove name="root"/>
67
+ <block type="oauth/adminhtml_oauth_admin_token_grid" name="oauth_admin_token.grid" output="toHtml"/>
68
+ </adminhtml_oauth_admin_token_grid>
69
+ <!-- EOF My Applications -->
70
+
71
+
72
+
73
+ <oauth_root_handle>
74
+ <reference name="root">
75
+ <action method="setTemplate">
76
+ <template>empty.phtml</template>
77
+ </action>
78
+ </reference>
79
+ <reference name="head">
80
+ <action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
81
+ <action method="removeItem"><type>js</type><name>prototype/window.js</name></action>
82
+ <action method="removeItem"><type>js</type><name>scriptaculous/builder.js</name></action>
83
+ <action method="removeItem"><type>js</type><name>scriptaculous/dragdrop.js</name></action>
84
+ <action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
85
+ <action method="removeItem"><type>js</type><name>scriptaculous/slider.js</name></action>
86
+ <action method="removeItem"><type>js</type><name>lib/ccard.js</name></action>
87
+ <action method="removeItem"><type>js</type><name>varien/js.js</name></action>
88
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/hash.js</name></action>
89
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/events.js</name></action>
90
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/loader.js</name></action>
91
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/grid.js</name></action>
92
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/tabs.js</name></action>
93
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/accordion.js</name></action>
94
+ <!-- <action method="removeItem"><type>js</type><name>mage/adminhtml/tools.js</name></action>-->
95
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/uploader.js</name></action>
96
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/product.js</name></action>
97
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/rules.js</name></action>
98
+ <action method="removeItem"><type>js</type><name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name></action>
99
+ <action method="removeItem"><type>js</type><name>lib/ds-sleight.js</name></action>
100
+ <action method="removeItem"><type>js</type><name>varien/iehover-fix.js</name></action>
101
+
102
+ <action method="removeItem"><type>css</type><name>print.css</name></action>
103
+ <action method="removeItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name></action>
104
+ <action method="removeItem"><type>js_css</type><name>extjs/resources/css/ext-all.css</name></action>
105
+ <action method="removeItem"><type>js_css</type><name>extjs/resources/css/ytheme-magento.css</name></action>
106
+ <action method="removeItem"><type>skin_css</type><name>menu.css</name></action>
107
+
108
+ <action method="removeItem"><type>js</type><name>calendar/calendar.js</name></action>
109
+ <action method="removeItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
110
+ <action method="removeItem"><type>js</type><name>extjs/fix-defer-before.js</name></action>
111
+ <action method="removeItem"><type>js</type><name>extjs/ext-tree.js</name></action>
112
+ <action method="removeItem"><type>js</type><name>extjs/fix-defer.js</name></action>
113
+ <action method="removeItem"><type>js</type><name>extjs/ext-tree-checkbox.js</name></action>
114
+ </reference>
115
+ </oauth_root_handle>
116
+
117
+ <oauth_root_handle_simple>
118
+ <remove name="js_cookie" />
119
+ <block type="adminhtml/page" name="root" output="toHtml" template="empty.phtml">
120
+ <block type="adminhtml/page_head" name="head" as="head" template="oauth/authorize/head-simple.phtml">
121
+ <action method="addCss"><name>oauth-simple.css</name></action>
122
+ </block>
123
+ <block type="core/text_list" name="content"/>
124
+ </block>
125
+ </oauth_root_handle_simple>
126
+
127
+ <!-- Authorize -->
128
+ <!--Handle for simple pages-->
129
+ <adminhtml_oauth_authorize_index translate="label">
130
+ <update handle="oauth_root_handle"/>
131
+ <label>OAuth authorization for admin</label>
132
+ <reference name="content">
133
+ <block type="oauth/adminhtml_oauth_authorize" name="oauth.authorize.form" template="oauth/authorize/form/login.phtml"/>
134
+ <block type="oauth/adminhtml_oauth_authorize_button" name="oauth.authorize.button" template="oauth/authorize/button.phtml" />
135
+ </reference>
136
+ </adminhtml_oauth_authorize_index>
137
+
138
+ <adminhtml_oauth_authorize_simple translate="label">
139
+ <update handle="oauth_root_handle_simple"/>
140
+ <label>OAuth authorization simple for admin</label>
141
+ <reference name="content">
142
+ <block type="oauth/adminhtml_oauth_authorize" name="oauth.authorize.form" template="oauth/authorize/form/login-simple.phtml"/>
143
+ <block type="oauth/adminhtml_oauth_authorize_button" name="oauth.authorize.button" template="oauth/authorize/button-simple.phtml" />
144
+ </reference>
145
+ </adminhtml_oauth_authorize_simple>
146
+ <!-- EOF Authorize -->
147
+
148
+ <!-- Confirm Authorization -->
149
+ <adminhtml_oauth_authorize_confirm translate="label">
150
+ <update handle="oauth_root_handle"/>
151
+ <label>Confirm token authorization for admin</label>
152
+ <reference name="content">
153
+ <block type="core/template" name="oauth.authorize.confirm" template="oauth/authorize/confirm.phtml" />
154
+ </reference>
155
+ </adminhtml_oauth_authorize_confirm>
156
+
157
+ <adminhtml_oauth_authorize_confirmsimple translate="label">
158
+ <update handle="oauth_root_handle_simple"/>
159
+ <label>Confirm token authorization Pop Up for admin</label>
160
+ <reference name="content">
161
+ <block type="core/template" name="oauth.authorize.confirm" template="oauth/authorize/confirm-simple.phtml" />
162
+ </reference>
163
+ </adminhtml_oauth_authorize_confirmsimple>
164
+ <!-- EOF Confirm Authorization -->
165
+
166
+ <!-- Reject Authorization -->
167
+ <adminhtml_oauth_authorize_reject translate="label">
168
+ <update handle="oauth_root_handle"/>
169
+ <label>Reject token authorization for admin</label>
170
+ <reference name="content">
171
+ <block type="core/template" name="oauth.authorize.reject" template="oauth/authorize/reject.phtml" />
172
+ </reference>
173
+ </adminhtml_oauth_authorize_reject>
174
+
175
+ <adminhtml_oauth_authorize_rejectsimple translate="label">
176
+ <update handle="oauth_root_handle_simple"/>
177
+ <label>Reject token authorization Pop Up for admin</label>
178
+ <reference name="content">
179
+ <block type="core/template" name="oauth.authorize.reject" template="oauth/authorize/reject-simple.phtml" />
180
+ </reference>
181
+ </adminhtml_oauth_authorize_rejectsimple>
182
+ <!-- EOF Reject Authorization -->
183
+
184
+ <adminhtml_oauth_authorizedtokens_index>
185
+ <reference name="content">
186
+ <block type="oauth/adminhtml_oauth_authorizedTokens" name="oauth_authorizedTokens"/>
187
+ </reference>
188
+ </adminhtml_oauth_authorizedtokens_index>
189
+
190
+ <adminhtml_oauth_authorizedtokens_grid>
191
+ <remove name="root"/>
192
+ <block type="oauth/adminhtml_oauth_authorizedTokens_grid" name="oauth_authorizedTokens.grid" output="toHtml"/>
193
+ </adminhtml_oauth_authorizedtokens_grid>
194
+ </layout>
app/design/adminhtml/default/default/layout/pagecache.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_cache_index>
31
+ <reference name="cache.additional">
32
+ <block type="pagecache/adminhtml_cache_additional" name="page.cache.additional" template = "pagecache/cache/additional.phtml" />
33
+ </reference>
34
+ </adminhtml_cache_index>
35
+ </layout>
app/design/adminhtml/default/default/layout/promo.xml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <!-- Catalog Price Rule -->
31
+ <adminhtml_promo_catalog_index>
32
+ <reference name="content">
33
+ <block type="adminhtml/promo_catalog" name="promo_catalog"/>
34
+ </reference>
35
+ </adminhtml_promo_catalog_index>
36
+ <adminhtml_promo_catalog_edit>
37
+ <reference name="head">
38
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
39
+ <action method="setCanLoadRulesJs"><flag>1</flag></action>
40
+ </reference>
41
+ <reference name="left">
42
+ <block type="adminhtml/promo_catalog_edit_tabs" name="promo_catalog_edit_tabs">
43
+ <block type="adminhtml/promo_catalog_edit_tab_main" name="promo_catalog_edit_tab_main"/>
44
+ <block type="adminhtml/promo_catalog_edit_tab_conditions" name="promo_catalog_edit_tab_conditions"/>
45
+ <block type="adminhtml/promo_catalog_edit_tab_actions" name="promo_catalog_edit_tab_actions"/>
46
+ <action method="addTab"><name>main_section</name><block>promo_catalog_edit_tab_main</block></action>
47
+ <action method="addTab"><name>conditions_section</name><block>promo_catalog_edit_tab_conditions</block></action>
48
+ <action method="addTab"><name>actions_section</name><block>promo_catalog_edit_tab_actions</block></action>
49
+ </block>
50
+ </reference>
51
+ <reference name="content">
52
+ <block type="adminhtml/promo_catalog_edit" name="promo_catalog_edit"/>
53
+ </reference>
54
+ <reference name="js">
55
+ <block type="adminhtml/promo_catalog_edit_js" template="promo/js.phtml" />
56
+ </reference>
57
+ </adminhtml_promo_catalog_edit>
58
+
59
+ <!-- Shopping Cart Price Rule -->
60
+ <adminhtml_promo_quote_index>
61
+ <reference name="content">
62
+ <block type="adminhtml/promo_quote" name="promo_quote"></block>
63
+ </reference>
64
+ </adminhtml_promo_quote_index>
65
+ <adminhtml_promo_quote_edit>
66
+ <reference name="head">
67
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
68
+ <action method="setCanLoadRulesJs"><flag>1</flag></action>
69
+ </reference>
70
+ <reference name="left">
71
+ <block type="adminhtml/promo_quote_edit_tabs" name="promo_quote_edit_tabs">
72
+ <block type="adminhtml/promo_quote_edit_tab_main" name="promo_quote_edit_tab_main" />
73
+ <block type="adminhtml/promo_quote_edit_tab_conditions" name="promo_quote_edit_tab_conditions"/>
74
+ <block type="adminhtml/promo_quote_edit_tab_actions" name="promo_quote_edit_tab_actions"/>
75
+ <block type="adminhtml/promo_quote_edit_tab_labels" name="promo_quote_edit_tab_labels"/>
76
+ <block type="adminhtml/promo_quote_edit_tab_coupons" name="promo_quote_edit_tab_coupons">
77
+ <block type="adminhtml/promo_quote_edit_tab_coupons_form" name="promo_quote_edit_tab_coupons_form"/>
78
+ <block type="adminhtml/promo_quote_edit_tab_coupons_grid" name="promo_quote_edit_tab_coupons_grid"/>
79
+ </block>
80
+ <action method="addTab"><name>main_section</name><block>promo_quote_edit_tab_main</block></action>
81
+ <action method="addTab"><name>conditions_section</name><block>promo_quote_edit_tab_conditions</block></action>
82
+ <action method="addTab"><name>actions_section</name><block>promo_quote_edit_tab_actions</block></action>
83
+ <action method="addTab"><name>labels_section</name><block>promo_quote_edit_tab_labels</block></action>
84
+ <action method="addTab"><name>coupons_section</name><block>promo_quote_edit_tab_coupons</block></action>
85
+ </block>
86
+ <block type="adminhtml/template" template="promo/salesrulejs.phtml" name="promo_quote_edit_jsinit"/>
87
+ </reference>
88
+ <reference name="content">
89
+ <block type="adminhtml/promo_quote_edit" name="promo_quote_edit"></block>
90
+ </reference>
91
+ </adminhtml_promo_quote_edit>
92
+ <adminhtml_promo_quote_grid>
93
+ <remove name="root" />
94
+ <block type="adminhtml/promo_quote_edit_tab_product" name="promo_quote_grid" output="toHtml" />
95
+ </adminhtml_promo_quote_grid>
96
+ <adminhtml_promo_quote_couponsgrid>
97
+ <block type="core/text_list" name="root" output="toHtml">
98
+ <block type="adminhtml/promo_quote_edit_tab_coupons_grid" name="promo_quote_edit_tab_coupons_grid" />
99
+ </block>
100
+ </adminhtml_promo_quote_couponsgrid>
101
+ </layout>
app/design/adminhtml/default/default/layout/report.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_report_statistics_index>
31
+ <reference name="content">
32
+ <block type="adminhtml/report_refresh_statistics" template="report/refresh/statistics.phtml" name="sales.report.refreshstatistics" />
33
+ </reference>
34
+ </adminhtml_report_statistics_index>
35
+ <adminhtml_report_product_viewed>
36
+ <reference name="messages">
37
+ <action method="addNotice" translate="message">
38
+ <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message>
39
+ </action>
40
+ </reference>
41
+ <reference name="content">
42
+ <block type="adminhtml/report_product_viewed" template="report/grid/container.phtml" name="product.report.grid.container">
43
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
44
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
45
+ </block>
46
+ <block type="adminhtml/report_filter_form" name="grid.filter.form">
47
+ <action method="setFieldVisibility">
48
+ <field>report_type</field>
49
+ <visibility>0</visibility>
50
+ </action>
51
+ </block>
52
+ </block>
53
+ </reference>
54
+ </adminhtml_report_product_viewed>
55
+ </layout>
app/design/adminhtml/default/default/layout/rss.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+
31
+ <!--
32
+
33
+ -->
34
+ <adminhtml_rss_catalog_review>
35
+ <block type="rss/catalog_review" output="toHtml" name="rss.catalog.review" />
36
+ </adminhtml_rss_catalog_review>
37
+
38
+ <adminhtml_rss_catalog_notifystock>
39
+ <block type="rss/catalog_notifyStock" output="toHtml" name="rss.catalog.notifystock" />
40
+ </adminhtml_rss_catalog_notifystock>
41
+
42
+ <adminhtml_rss_order_new>
43
+ <block type="rss/order_new" output="toHtml" name="rss.order.new"/>
44
+ </adminhtml_rss_order_new>
45
+ </layout>
app/design/adminhtml/default/default/layout/sales.xml ADDED
@@ -0,0 +1,1080 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_sales_order_grid>
31
+ <update handle="formkey"/>
32
+ <block type="adminhtml/sales_order_grid" name="sales_order.grid" output="toHtml"></block>
33
+ </adminhtml_sales_order_grid>
34
+
35
+ <adminhtml_sales_order_index>
36
+ <reference name="content">
37
+ <block type="adminhtml/sales_order" name="sales_order.grid.container"></block>
38
+ </reference>
39
+ </adminhtml_sales_order_index>
40
+
41
+ <adminhtml_sales_order_transactions>
42
+ <block type="adminhtml/sales_transactions_grid" name="sales_transactions.grid" output="toHtml"></block>
43
+ </adminhtml_sales_order_transactions>
44
+
45
+ <adminhtml_sales_billing_agreement_index>
46
+ <reference name="content">
47
+ <block type="sales/adminhtml_billing_agreement" name="sales.billing.agreement.grid.container"></block>
48
+ </reference>
49
+ </adminhtml_sales_billing_agreement_index>
50
+
51
+ <adminhtml_sales_billing_agreement_grid>
52
+ <block type="sales/adminhtml_billing_agreement_grid" name="sales.billing.agreement.grid" output="toHtml"></block>
53
+ </adminhtml_sales_billing_agreement_grid>
54
+
55
+ <adminhtml_sales_billing_agreement_view>
56
+ <reference name="content">
57
+ <block type="sales/adminhtml_billing_agreement_view" name="sales.billing.agreement.view"></block>
58
+ </reference>
59
+ <reference name="left">
60
+ <block type="sales/adminhtml_billing_agreement_view_tabs" name="sales.billing.agreement.tabs">
61
+ <action method="addTab"><name>billing_agreement_info</name><block>sales/adminhtml_billing_agreement_view_tab_info</block></action>
62
+ <action method="addTab"><name>billing_agreement_orders</name><block>sales/adminhtml_billing_agreement_view_tab_orders</block></action>
63
+ </block>
64
+ </reference>
65
+ </adminhtml_sales_billing_agreement_view>
66
+
67
+ <adminhtml_sales_billing_agreement_ordersgrid>
68
+ <block type="sales/adminhtml_billing_agreement_view_tab_orders" name="related.orders.grid" output="toHtml"></block>
69
+ </adminhtml_sales_billing_agreement_ordersgrid>
70
+
71
+ <adminhtml_sales_billing_agreement_customergrid>
72
+ <block type="sales/adminhtml_customer_edit_tab_agreement" name="customer.billing.agreement.grid" output="toHtml"></block>
73
+ </adminhtml_sales_billing_agreement_customergrid>
74
+
75
+ <adminhtml_sales_order_view>
76
+ <reference name="head">
77
+ <action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
78
+ <action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
79
+ </reference>
80
+ <reference name="content">
81
+ <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
82
+ </reference>
83
+ <reference name="left">
84
+ <block type="adminhtml/sales_order_view_tabs" name="sales_order_tabs">
85
+ <block type="adminhtml/sales_order_view_tab_info" name="order_tab_info" template="sales/order/view/tab/info.phtml">
86
+ <block type="adminhtml/sales_order_view_messages" name="order_messages"></block>
87
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
88
+ <block type="adminhtml/sales_order_view_items" name="order_items" template="sales/order/view/items.phtml">
89
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>sales/order/view/items/renderer/default.phtml</template></action>
90
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
91
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
92
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
93
+ <block type="core/text_list" name="order_item_extra_info" />
94
+ </block>
95
+ <block type="adminhtml/sales_order_payment" name="order_payment"/>
96
+ <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml"></block>
97
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
98
+ <block type="adminhtml/sales_order_view_giftmessage" name="order_giftmessage" template="sales/order/view/giftmessage.phtml"></block>
99
+ </block>
100
+ <block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
101
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
102
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
103
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
104
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
105
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
106
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
107
+ </block>
108
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
109
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
110
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
111
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
112
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
113
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
114
+ <action method="setSourceField"><value>giftcert_amount</value></action>
115
+ <action method="setLabel"><value>Gift Certificate</value></action>
116
+ </block>
117
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
118
+ <action method="setSourceField"><value>adjustment_positive</value></action>
119
+ <action method="setLabel"><value>Adjustment Refund</value></action>
120
+ </block>
121
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
122
+ <action method="setSourceField"><value>adjustment_negative</value></action>
123
+ <action method="setLabel"><value>Adjustment Fee</value></action>
124
+ </block>
125
+ </block>-->
126
+ </block>
127
+ </block>
128
+ <action method="addTab"><name>order_info</name><block>order_tab_info</block></action>
129
+ <action method="addTab"><name>order_invoices</name><block>adminhtml/sales_order_view_tab_invoices</block></action>
130
+ <action method="addTab"><name>order_creditmemos</name><block>adminhtml/sales_order_view_tab_creditmemos</block></action>
131
+ <action method="addTab"><name>order_shipments</name><block>adminhtml/sales_order_view_tab_shipments</block></action>
132
+ <action method="addTab"><name>order_history</name><block>adminhtml/sales_order_view_tab_history</block></action>
133
+ <action method="addTab"><name>order_transactions</name><block>adminhtml/sales_order_view_tab_transactions</block></action>
134
+ </block>
135
+ </reference>
136
+ </adminhtml_sales_order_view>
137
+
138
+ <adminhtml_sales_order_addcomment>
139
+ <block type="adminhtml/sales_order_view_history" name="order_history" template="sales/order/view/history.phtml" output="toHtml"/>
140
+ </adminhtml_sales_order_addcomment>
141
+
142
+ <adminhtml_sales_order_invoice_new>
143
+ <reference name="content">
144
+ <block type="adminhtml/sales_order_invoice_create" name="sales_invoice_create">
145
+ <block type="adminhtml/sales_order_invoice_create_form" name="form" template="sales/order/invoice/create/form.phtml">
146
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
147
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
148
+ <block type="adminhtml/sales_order_invoice_create_items" name="order_items" template="sales/order/invoice/create/items.phtml">
149
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/invoice/create/items/renderer/default.phtml</template></action>
150
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
151
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
152
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
153
+ <block type="core/text_list" name="order_item_extra_info"></block>
154
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
155
+
156
+ <block type="adminhtml/sales_order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
157
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
158
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
159
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
160
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
161
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
162
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
163
+ </block>
164
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
165
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
166
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
167
+ <action method="setSourceField"><value>tax_amount</value></action>
168
+ <action method="setLabel"><value>Tax</value></action>
169
+ </block>
170
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
171
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
172
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
173
+ <action method="setSourceField"><value>giftcert_amount</value></action>
174
+ <action method="setLabel"><value>Gift Certificate</value></action>
175
+ </block>
176
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
177
+ <action method="setSourceField"><value>adjustment_positive</value></action>
178
+ <action method="setLabel"><value>Adjustment Refund</value></action>
179
+ </block>
180
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
181
+ <action method="setSourceField"><value>adjustment_negative</value></action>
182
+ <action method="setLabel"><value>Adjustment Fee</value></action>
183
+ </block>
184
+ </block>-->
185
+ </block>
186
+ </block>
187
+ </block>
188
+ </block>
189
+ </reference>
190
+ </adminhtml_sales_order_invoice_new>
191
+
192
+ <adminhtml_sales_order_invoice_updateqty>
193
+ <block type="adminhtml/sales_order_invoice_create_items" name="order_items" template="sales/order/invoice/create/items.phtml">
194
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/invoice/create/items/renderer/default.phtml</template></action>
195
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
196
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
197
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
198
+ <block type="core/text_list" name="order_item_extra_info"></block>
199
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
200
+ <block type="adminhtml/sales_order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
201
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
202
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
203
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
204
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
205
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
206
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
207
+ </block>
208
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
209
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
210
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
211
+ <action method="setSourceField"><value>tax_amount</value></action>
212
+ <action method="setLabel"><value>Tax</value></action>
213
+ </block>
214
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
215
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
216
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
217
+ <action method="setSourceField"><value>giftcert_amount</value></action>
218
+ <action method="setLabel"><value>Gift Certificate</value></action>
219
+ </block>
220
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
221
+ <action method="setSourceField"><value>adjustment_positive</value></action>
222
+ <action method="setLabel"><value>Adjustment Refund</value></action>
223
+ </block>
224
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
225
+ <action method="setSourceField"><value>adjustment_negative</value></action>
226
+ <action method="setLabel"><value>Adjustment Fee</value></action>
227
+ </block>
228
+ </block>-->
229
+ </block>
230
+ </block>
231
+ </adminhtml_sales_order_invoice_updateqty>
232
+
233
+ <adminhtml_sales_order_invoice_addcomment>
234
+ <block type="adminhtml/sales_order_invoice_view_comments" name="invoice_comments">
235
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml"></block>
236
+ </block>
237
+ </adminhtml_sales_order_invoice_addcomment>
238
+
239
+ <adminhtml_sales_order_invoice_view>
240
+ <reference name="content">
241
+ <block type="adminhtml/sales_order_invoice_view" name="sales_invoice_view">
242
+ <block type="adminhtml/sales_order_invoice_view_form" name="form" template="sales/order/invoice/view/form.phtml">
243
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
244
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
245
+
246
+ <block type="adminhtml/sales_order_invoice_view_items" name="invoice_items" template="sales/order/invoice/view/items.phtml">
247
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/invoice/view/items/renderer/default.phtml</template></action>
248
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
249
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
250
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
251
+ <block type="core/text_list" name="order_item_extra_info"></block>
252
+ </block>
253
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml">
254
+ <action method="setParentType"><type>invoice</type></action>
255
+ </block>
256
+ <block type="adminhtml/sales_order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
257
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
258
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
259
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
260
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
261
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
262
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
263
+ </block>
264
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
265
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
266
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
267
+ <action method="setSourceField"><value>tax_amount</value></action>
268
+ <action method="setLabel"><value>Tax</value></action>
269
+ </block>
270
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
271
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
272
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
273
+ <action method="setSourceField"><value>giftcert_amount</value></action>
274
+ <action method="setLabel"><value>Gift Certificate</value></action>
275
+ </block>
276
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
277
+ <action method="setSourceField"><value>adjustment_positive</value></action>
278
+ <action method="setLabel"><value>Adjustment Refund</value></action>
279
+ </block>
280
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
281
+ <action method="setSourceField"><value>adjustment_negative</value></action>
282
+ <action method="setLabel"><value>Adjustment Fee</value></action>
283
+ </block>
284
+ </block>-->
285
+ </block>
286
+ </block>
287
+ </block>
288
+ </reference>
289
+ </adminhtml_sales_order_invoice_view>
290
+
291
+ <adminhtml_sales_order_shipment_new>
292
+ <reference name="head">
293
+ <action method="addJs"><file>mage/adminhtml/sales/packaging.js</file></action>
294
+ </reference>
295
+ <reference name="content">
296
+ <block type="adminhtml/sales_order_shipment_create" name="sales_shipment_create">
297
+ <block type="adminhtml/sales_order_shipment_create_form" name="form" template="sales/order/shipment/create/form.phtml">
298
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
299
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
300
+ <block type="adminhtml/sales_order_shipment_create_tracking" name="shipment_tracking" template="sales/order/shipment/create/tracking.phtml"></block>
301
+ <block type="adminhtml/sales_order_shipment_create_items" name="order_items" template="sales/order/shipment/create/items.phtml">
302
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/shipment/create/items/renderer/default.phtml</template></action>
303
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
304
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
305
+ <block type="core/text_list" name="order_item_extra_info"></block>
306
+ </block>
307
+ <block type="adminhtml/sales_order_shipment_packaging" name="shipment_packaging" template="sales/order/shipment/packaging/popup.phtml" />
308
+ </block>
309
+ </block>
310
+ </reference>
311
+ </adminhtml_sales_order_shipment_new>
312
+
313
+ <adminhtml_sales_order_shipment_addtrack>
314
+ <block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" template="sales/order/shipment/view/tracking.phtml"></block>
315
+ </adminhtml_sales_order_shipment_addtrack>
316
+
317
+ <adminhtml_sales_order_shipment_removetrack>
318
+ <block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" template="sales/order/shipment/view/tracking.phtml"></block>
319
+ </adminhtml_sales_order_shipment_removetrack>
320
+
321
+ <adminhtml_sales_order_shipment_addcomment>
322
+ <block type="adminhtml/sales_order_shipment_view_comments" name="shipment_comments">
323
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml"></block>
324
+ </block>
325
+ </adminhtml_sales_order_shipment_addcomment>
326
+
327
+ <adminhtml_sales_order_shipment_view>
328
+ <reference name="head">
329
+ <action method="addJs"><file>mage/adminhtml/sales/packaging.js</file></action>
330
+ </reference>
331
+ <reference name="content">
332
+ <block type="adminhtml/sales_order_shipment_view" name="sales_shipment_view">
333
+ <block type="adminhtml/sales_order_shipment_view_form" name="form" template="sales/order/shipment/view/form.phtml">
334
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
335
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
336
+ <block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" template="sales/order/shipment/view/tracking.phtml"></block>
337
+ <block type="adminhtml/sales_order_shipment_view_items" name="shipment_items" template="sales/order/shipment/view/items.phtml">
338
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/shipment/view/items/renderer/default.phtml</template></action>
339
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
340
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
341
+ <block type="core/text_list" name="order_item_extra_info"></block>
342
+ </block>
343
+ <block type="adminhtml/sales_order_invoice_create_tracking" name="invoice_tracking" template="sales/order/shipment/create/tracking.phtml"></block>
344
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml">
345
+ <action method="setParentType"><type>shipment</type></action>
346
+ </block>
347
+ <block type="adminhtml/sales_order_shipment_packaging" name="shipment_packaging" template="sales/order/shipment/packaging/popup.phtml" />
348
+ <block type="adminhtml/sales_order_shipment_packaging" name="shipment_packed" template="sales/order/shipment/packaging/packed.phtml"/>
349
+ </block>
350
+ </block>
351
+ </reference>
352
+ </adminhtml_sales_order_shipment_view>
353
+
354
+ <adminhtml_sales_order_creditmemo_new>
355
+ <reference name="content">
356
+ <block type="adminhtml/sales_order_creditmemo_create" name="sales_creditmemo_create">
357
+ <block type="adminhtml/sales_order_creditmemo_create_form" name="form" template="sales/order/creditmemo/create/form.phtml">
358
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
359
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
360
+ <block type="adminhtml/sales_order_creditmemo_create_items" name="order_items" template="sales/order/creditmemo/create/items.phtml">
361
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/creditmemo/create/items/renderer/default.phtml</template></action>
362
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
363
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
364
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
365
+ <block type="core/text_list" name="order_item_extra_info"></block>
366
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
367
+
368
+ <block type="adminhtml/sales_order_creditmemo_totals" name="creditmemo_totals" template="sales/order/totals.phtml">
369
+ <block type="adminhtml/sales_order_creditmemo_create_adjustments" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
370
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
371
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
372
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml">
373
+ <action method="setGrandTotalTitle"><title>Total Refund</title></action>
374
+ </block>
375
+ </block>
376
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
377
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
378
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
379
+ <action method="setSourceField"><value>tax_amount</value></action>
380
+ <action method="setLabel"><value>Tax</value></action>
381
+ </block>
382
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/item.phtml">
383
+ <action method="setSourceField"><value>discount_amount</value></action>
384
+ <action method="setLabel"><value>Discount</value></action>
385
+ </block>
386
+ <block type="adminhtml/sales_order_totals_item" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
387
+ </block>-->
388
+ </block>
389
+ <block type="core/text_list" name="submit_before" />
390
+ <block type="core/text_list" name="submit_after" />
391
+ </block>
392
+ </block>
393
+ </block>
394
+ </reference>
395
+ </adminhtml_sales_order_creditmemo_new>
396
+
397
+ <adminhtml_sales_order_creditmemo_updateqty>
398
+ <block type="adminhtml/sales_order_creditmemo_create_items" name="order_items" template="sales/order/creditmemo/create/items.phtml">
399
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/creditmemo/create/items/renderer/default.phtml</template></action>
400
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
401
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
402
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
403
+ <block type="core/text_list" name="order_item_extra_info"></block>
404
+ <block type="adminhtml/sales_order_totalbar" name="order_totalbar" template="sales/order/totalbar.phtml"></block>
405
+
406
+ <block type="adminhtml/sales_order_creditmemo_totals" name="creditmemo_totals" template="sales/order/totals.phtml">
407
+ <block type="adminhtml/sales_order_creditmemo_create_adjustments" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
408
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
409
+ <!--<block type="adminhtml/sales_order_totals" name="order_totals" template="sales/order/totals.phtml">
410
+ <block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
411
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml">
412
+ <action method="setGrandTotalTitle"><title>Total Refund</title></action>
413
+ </block>
414
+ </block>
415
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
416
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
417
+ <block type="adminhtml/sales_order_totals_item" name="tax" template="sales/order/totals/item.phtml">
418
+ <action method="setSourceField"><value>tax_amount</value></action>
419
+ <action method="setLabel"><value>Tax</value></action>
420
+ </block>
421
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/item.phtml">
422
+ <action method="setSourceField"><value>discount_amount</value></action>
423
+ <action method="setLabel"><value>Discount</value></action>
424
+ </block>
425
+ <block type="adminhtml/sales_order_totals_item" name="adjustments" template="sales/order/creditmemo/create/totals/adjustments.phtml" />
426
+ </block>-->
427
+ </block>
428
+
429
+ <block type="core/text_list" name="submit_before" />
430
+ <block type="core/text_list" name="submit_after" />
431
+ </block>
432
+ </adminhtml_sales_order_creditmemo_updateqty>
433
+
434
+ <adminhtml_sales_order_creditmemo_addcomment>
435
+ <block type="adminhtml/sales_order_creditmemo_view_comments" name="creditmemo_comments">
436
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml"></block>
437
+ </block>
438
+ </adminhtml_sales_order_creditmemo_addcomment>
439
+
440
+ <adminhtml_sales_order_creditmemo_view>
441
+ <reference name="content">
442
+ <block type="adminhtml/sales_order_creditmemo_view" name="sales_creditmemo_view">
443
+ <block type="adminhtml/sales_order_creditmemo_view_form" name="form" template="sales/order/creditmemo/view/form.phtml">
444
+ <block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
445
+ <block type="adminhtml/sales_order_payment" name="order_payment"></block>
446
+ <block type="adminhtml/sales_order_creditmemo_view_items" name="creditmemo_items" template="sales/order/creditmemo/view/items.phtml">
447
+ <action method="addItemRender"><type>default</type><block>adminhtml/sales_items_renderer_default</block><template>sales/order/creditmemo/view/items/renderer/default.phtml</template></action>
448
+ <action method="addColumnRender"><column>qty</column><block>adminhtml/sales_items_column_qty</block><template>sales/items/column/qty.phtml</template></action>
449
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name</block><template>sales/items/column/name.phtml</template></action>
450
+ <action method="addColumnRender"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>sales/items/column/name.phtml</template><type>grouped</type></action>
451
+ <block type="core/text_list" name="order_item_extra_info"></block>
452
+ </block>
453
+ <block type="adminhtml/sales_order_comments_view" name="order_comments" template="sales/order/comments/view.phtml">
454
+ <action method="setParentType"><type>creditmemo</type></action>
455
+ </block>
456
+
457
+ <block type="adminhtml/sales_order_creditmemo_totals" name="creditmemo_totals" template="sales/order/totals.phtml">
458
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
459
+ <!--<block type="adminhtml/sales_order_totals_item" name="footer" template="sales/order/totals/footer.phtml">
460
+ <block type="adminhtml/sales_order_totals_item" name="grand" template="sales/order/totals/grand.phtml" />
461
+ <block type="adminhtml/sales_order_totals_item" name="paid" template="sales/order/totals/paid.phtml" />
462
+ <block type="adminhtml/sales_order_totals_item" name="refunded" template="sales/order/totals/refunded.phtml" />
463
+ <block type="adminhtml/sales_order_totals_item" name="due" template="sales/order/totals/due.phtml" />
464
+ </block>
465
+ <block type="adminhtml/sales_order_totals_item" name="sales.order.view.totals.main" as="main" template="sales/order/totals/main.phtml">
466
+ <block type="adminhtml/sales_order_totals_subtotal" name="subtotal" template="sales/order/totals/subtotal.phtml" />
467
+ <block type="adminhtml/sales_order_totals_tax" name="tax" template="sales/order/totals/tax.phtml" />
468
+ <block type="adminhtml/sales_order_totals_item" name="shipping" template="sales/order/totals/shipping.phtml" />
469
+ <block type="adminhtml/sales_order_totals_item" name="discount" template="sales/order/totals/discount.phtml" />
470
+ <block type="adminhtml/sales_order_totals_item" name="giftcert" template="sales/order/totals/item.phtml">
471
+ <action method="setSourceField"><value>giftcert_amount</value></action>
472
+ <action method="setLabel"><value>Gift Certificate</value></action>
473
+ </block>
474
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_positive" template="sales/order/totals/item.phtml">
475
+ <action method="setSourceField"><value>adjustment_positive</value></action>
476
+ <action method="setLabel"><value>Adjustment Refund</value></action>
477
+ </block>
478
+ <block type="adminhtml/sales_order_totals_item" name="adjustment_negative" template="sales/order/totals/item.phtml">
479
+ <action method="setSourceField"><value>adjustment_negative</value></action>
480
+ <action method="setLabel"><value>Adjustment Fee</value></action>
481
+ </block>
482
+ </block>-->
483
+ </block>
484
+ </block>
485
+ </block>
486
+ </reference>
487
+ </adminhtml_sales_order_creditmemo_view>
488
+
489
+ <adminhtml_sales_transactions_index>
490
+ <reference name="content">
491
+ <block type="adminhtml/sales_transactions" name="sales_transactions.grid.container"></block>
492
+ </reference>
493
+ </adminhtml_sales_transactions_index>
494
+ <adminhtml_sales_transactions_grid>
495
+ <block type="adminhtml/sales_transactions_grid" name="sales_transactions.grid" output="toHtml"></block>
496
+ </adminhtml_sales_transactions_grid>
497
+ <adminhtml_sales_transactions_view>
498
+ <reference name="content">
499
+ <block type="adminhtml/sales_transactions_detail" name="sales_transactions.detail" template="sales/transactions/detail.phtml">
500
+ <block type="adminhtml/sales_transactions_detail_grid" name="sales_transactions.detail.grid" as="detail_grid"/>
501
+ <block type="adminhtml/sales_transactions_child_grid" name="sales_transactions.child.grid" as="child_grid"/>
502
+ </block>
503
+ </reference>
504
+ </adminhtml_sales_transactions_view>
505
+
506
+ <adminhtml_sales_order_create_index>
507
+ <reference name="left">
508
+ <action method="setIsCollapsed"><value>true</value></action>
509
+ </reference>
510
+ <reference name="head">
511
+ <action method="addJs"><file>mage/adminhtml/sales.js</file></action>
512
+ <action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
513
+ <action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
514
+ <action method="addJs"><file>varien/configurable.js</file></action>
515
+ <action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
516
+ <block type="adminhtml/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
517
+ </reference>
518
+ <reference name="js">
519
+ <block type="adminhtml/template" template="sales/order/create/js.phtml" name="create" />
520
+ </reference>
521
+ <reference name="root">
522
+ <block type="adminhtml/sales_order_create" name="content">
523
+ <block type="adminhtml/sales_order_create_form" template="sales/order/create/form.phtml" name="form">
524
+ <block type="adminhtml/sales_order_create_messages" name="message" />
525
+ <block type="adminhtml/sales_order_create_customer" template="sales/order/create/abstract.phtml" name="customer">
526
+ <block type="adminhtml/sales_order_create_customer_grid" name="grid" />
527
+ </block>
528
+ <block type="adminhtml/sales_order_create_store" template="sales/order/create/abstract.phtml" name="store">
529
+ <block type="adminhtml/sales_order_create_store_select" template="sales/order/create/store/select.phtml" name="select" />
530
+ </block>
531
+ <block type="adminhtml/sales_order_create_data" template="sales/order/create/data.phtml" name="data">
532
+ <block type="adminhtml/sales_order_create_sidebar" template="sales/order/create/sidebar.phtml" name="sidebar">
533
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="cart" />
534
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="wishlist" />
535
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="reorder" />
536
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="viewed" />
537
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="compared" />
538
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="pcompared" />
539
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="pviewed" />
540
+ </block>
541
+ <block type="adminhtml/sales_order_create_form_account" template="sales/order/create/form/account.phtml" name="form_account" />
542
+ <block type="adminhtml/sales_order_create_shipping_address" template="sales/order/create/form/address.phtml" name="shipping_address" />
543
+ <block type="adminhtml/sales_order_create_billing_address" template="sales/order/create/form/address.phtml" name="billing_address" />
544
+ <block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
545
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="sales/order/create/shipping/method/form.phtml" name="form" />
546
+ </block>
547
+ <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
548
+ <block type="adminhtml/sales_order_create_billing_method_form" template="sales/order/create/billing/method/form.phtml" name="form" />
549
+ </block>
550
+ <block type="adminhtml/sales_order_create_newsletter" template="sales/order/create/abstract.phtml" name="newsletter">
551
+ <block type="adminhtml/sales_order_create_newsletter_form" template="sales/order/create/newsletter/form.phtml" name="form" />
552
+ </block>
553
+ <block type="adminhtml/sales_order_create_search" template="sales/order/create/abstract.phtml" name="search">
554
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
555
+ </block>
556
+ <block type="adminhtml/sales_order_create_items" template="sales/order/create/items.phtml" name="items">
557
+ <block type="adminhtml/sales_order_create_items_grid" template="sales/order/create/items/grid.phtml" name="items_grid">
558
+ <block type="adminhtml/sales_order_create_coupons" template="sales/order/create/coupons/form.phtml" name="coupons">
559
+ <block type="adminhtml/sales_order_create_coupons_form" template="sales/order/create/coupons/form.phtml" name="form" />
560
+ </block>
561
+ </block>
562
+ </block>
563
+ <block type="adminhtml/sales_order_create_comment" template="sales/order/create/comment.phtml" name="comment" />
564
+ <block type="adminhtml/sales_order_create_totals" template="sales/order/create/totals.phtml" name="totals" />
565
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
566
+ <block type="adminhtml/sales_order_create_giftmessage" template="sales/order/create/giftmessage.phtml" name="giftmessage" />
567
+ </block>
568
+ <block type="core/text_list" name="order_item_extra_info"></block>
569
+ </block>
570
+ </block>
571
+ </block>
572
+ </reference>
573
+ </adminhtml_sales_order_create_index>
574
+
575
+ <adminhtml_sales_order_edit_index>
576
+ <update handle="adminhtml_sales_order_create_index" />
577
+ </adminhtml_sales_order_edit_index>
578
+
579
+ <adminhtml_sales_order_create_load_block_json>
580
+ <reference name="root">
581
+ <block type="adminhtml/sales_order_create_load" name="content" />
582
+ </reference>
583
+ </adminhtml_sales_order_create_load_block_json>
584
+
585
+ <adminhtml_sales_order_create_load_block_plain>
586
+ <reference name="root">
587
+ <block type="core/text_list" name="content" />
588
+ </reference>
589
+ </adminhtml_sales_order_create_load_block_plain>
590
+
591
+ <adminhtml_sales_order_create_load_block_data>
592
+ <reference name="content">
593
+ <block type="adminhtml/sales_order_create_data" template="sales/order/create/data.phtml" name="data">
594
+ <block type="adminhtml/sales_order_create_sidebar" template="sales/order/create/sidebar.phtml" name="sidebar">
595
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="cart" />
596
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="wishlist" />
597
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="reorder" />
598
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="viewed" />
599
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="compared" />
600
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="pcompared" />
601
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="pviewed" />
602
+ </block>
603
+ <block type="adminhtml/sales_order_create_form_account" template="sales/order/create/form/account.phtml" name="form_account" />
604
+ <block type="adminhtml/sales_order_create_shipping_address" template="sales/order/create/form/address.phtml" name="shipping_address" />
605
+ <block type="adminhtml/sales_order_create_billing_address" template="sales/order/create/form/address.phtml" name="billing_address" />
606
+ <block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
607
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="sales/order/create/shipping/method/form.phtml" name="form" />
608
+ </block>
609
+ <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
610
+ <block type="adminhtml/sales_order_create_billing_method_form" template="sales/order/create/billing/method/form.phtml" name="form" />
611
+ </block>
612
+ <block type="adminhtml/sales_order_create_newsletter" template="sales/order/create/abstract.phtml" name="newsletter">
613
+ <block type="adminhtml/sales_order_create_newsletter_form" template="sales/order/create/newsletter/form.phtml" name="form" />
614
+ </block>
615
+ <block type="adminhtml/sales_order_create_search" template="sales/order/create/abstract.phtml" name="search">
616
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
617
+ </block>
618
+ <block type="adminhtml/sales_order_create_items" template="sales/order/create/items.phtml" name="items">
619
+ <block type="adminhtml/sales_order_create_items_grid" template="sales/order/create/items/grid.phtml" name="items_grid">
620
+ <block type="adminhtml/sales_order_create_coupons" template="sales/order/create/coupons/form.phtml" name="coupons">
621
+ <block type="adminhtml/sales_order_create_coupons_form" template="sales/order/create/coupons/form.phtml" name="form" />
622
+ </block>
623
+ </block>
624
+ </block>
625
+ <block type="adminhtml/sales_order_create_comment" template="sales/order/create/comment.phtml" name="comment" />
626
+ <block type="adminhtml/sales_order_create_totals" template="sales/order/create/totals.phtml" name="totals" />
627
+ <block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
628
+ <block type="adminhtml/sales_order_create_giftmessage" template="sales/order/create/giftmessage.phtml" name="giftmessage" />
629
+ </block>
630
+ <block type="core/text_list" name="order_item_extra_info"></block>
631
+ </block>
632
+ </reference>
633
+ </adminhtml_sales_order_create_load_block_data>
634
+
635
+ <adminhtml_sales_order_create_load_block_header>
636
+ <reference name="content">
637
+ <block type="adminhtml/sales_order_create_header" name="header" />
638
+ </reference>
639
+ </adminhtml_sales_order_create_load_block_header>
640
+
641
+
642
+ <adminhtml_sales_order_create_load_block_sidebar>
643
+ <reference name="content">
644
+ <block type="adminhtml/sales_order_create_sidebar" template="sales/order/create/sidebar.phtml" name="sidebar">
645
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="cart" />
646
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="wishlist" />
647
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="reorder" />
648
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="viewed" />
649
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="compared" />
650
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="pcompared" />
651
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="pviewed" />
652
+ </block>
653
+ </reference>
654
+ </adminhtml_sales_order_create_load_block_sidebar>
655
+
656
+ <adminhtml_sales_order_create_load_block_form_account>
657
+ <reference name="content">
658
+ <block type="adminhtml/sales_order_create_form_account" template="sales/order/create/form/account.phtml" name="form_account" />
659
+ </reference>
660
+ </adminhtml_sales_order_create_load_block_form_account>
661
+
662
+ <adminhtml_sales_order_create_load_block_shipping_address>
663
+ <reference name="content">
664
+ <block type="adminhtml/sales_order_create_shipping_address" template="sales/order/create/form/address.phtml" name="shipping_address" />
665
+ </reference>
666
+ </adminhtml_sales_order_create_load_block_shipping_address>
667
+
668
+ <adminhtml_sales_order_create_load_block_billing_address>
669
+ <reference name="content">
670
+ <block type="adminhtml/sales_order_create_billing_address" template="sales/order/create/form/address.phtml" name="billing_address" />
671
+ </reference>
672
+ </adminhtml_sales_order_create_load_block_billing_address>
673
+
674
+ <adminhtml_sales_order_create_load_block_shipping_method>
675
+ <reference name="content">
676
+ <block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
677
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="sales/order/create/shipping/method/form.phtml" name="form" />
678
+ </block>
679
+ </reference>
680
+ </adminhtml_sales_order_create_load_block_shipping_method>
681
+
682
+ <adminhtml_sales_order_create_load_block_billing_method>
683
+ <reference name="content">
684
+ <block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
685
+ <block type="adminhtml/sales_order_create_billing_method_form" template="sales/order/create/billing/method/form.phtml" name="form" />
686
+ </block>
687
+ </reference>
688
+ </adminhtml_sales_order_create_load_block_billing_method>
689
+
690
+ <adminhtml_sales_order_create_load_block_newsletter>
691
+ <reference name="content">
692
+ <block type="adminhtml/sales_order_create_newsletter" template="sales/order/create/abstract.phtml" name="newsletter">
693
+ <block type="adminhtml/sales_order_create_newsletter_form" template="sales/order/create/newsletter/form.phtml" name="form" />
694
+ </block>
695
+ </reference>
696
+ </adminhtml_sales_order_create_load_block_newsletter>
697
+
698
+ <adminhtml_sales_order_create_load_block_search>
699
+ <reference name="content">
700
+ <block type="adminhtml/sales_order_create_search" template="sales/order/create/abstract.phtml" name="search">
701
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
702
+ </block>
703
+ </reference>
704
+ </adminhtml_sales_order_create_load_block_search>
705
+
706
+ <adminhtml_sales_order_create_load_block_search_grid>
707
+ <reference name="content">
708
+ <block type="adminhtml/sales_order_create_search_grid" name="grid" />
709
+ </reference>
710
+ </adminhtml_sales_order_create_load_block_search_grid>
711
+
712
+ <adminhtml_sales_order_create_load_block_items>
713
+ <reference name="content">
714
+ <block type="adminhtml/sales_order_create_items" template="sales/order/create/items.phtml" name="items">
715
+ <block type="adminhtml/sales_order_create_items_grid" template="sales/order/create/items/grid.phtml" name="items_grid">
716
+ <block type="adminhtml/sales_order_create_coupons" template="sales/order/create/coupons/form.phtml" name="coupons">
717
+ <block type="adminhtml/sales_order_create_coupons_form" template="sales/order/create/coupons/form.phtml" name="form" />
718
+ </block>
719
+ </block>
720
+ </block>
721
+ <block type="core/text_list" name="order_item_extra_info"></block>
722
+ </reference>
723
+ </adminhtml_sales_order_create_load_block_items>
724
+
725
+ <adminhtml_sales_order_create_load_block_comment>
726
+ <reference name="content">
727
+ <block type="adminhtml/sales_order_create_comment" template="sales/order/create/comment.phtml" name="comment" />
728
+ </reference>
729
+ </adminhtml_sales_order_create_load_block_comment>
730
+
731
+ <adminhtml_sales_order_create_load_block_totals>
732
+ <reference name="content">
733
+ <block type="adminhtml/sales_order_create_totals" template="sales/order/create/totals.phtml" name="totals" />
734
+ </reference>
735
+ </adminhtml_sales_order_create_load_block_totals>
736
+
737
+ <adminhtml_sales_order_create_load_block_giftmessage>
738
+ <reference name="content">
739
+ <block type="adminhtml/sales_order_create_giftmessage" template="sales/order/create/giftmessage.phtml" name="giftmessage" />
740
+ </reference>
741
+ </adminhtml_sales_order_create_load_block_giftmessage>
742
+
743
+ <adminhtml_sales_order_create_load_block_message>
744
+ <reference name="content">
745
+ <block type="adminhtml/sales_order_create_messages" name="message" />
746
+ </reference>
747
+ </adminhtml_sales_order_create_load_block_message>
748
+
749
+ <adminhtml_sales_order_create_load_block_customer_grid>
750
+ <reference name="content">
751
+ <block type="adminhtml/sales_order_create_customer_grid" name="grid" />
752
+ </reference>
753
+ </adminhtml_sales_order_create_load_block_customer_grid>
754
+
755
+ <adminhtml_sales_order_create_load_block_sidebar_cart>
756
+ <reference name="content">
757
+ <block type="adminhtml/sales_order_create_sidebar_cart" template="sales/order/create/sidebar/items.phtml" name="sidebar_cart" />
758
+ </reference>
759
+ </adminhtml_sales_order_create_load_block_sidebar_cart>
760
+
761
+ <adminhtml_sales_order_create_load_block_sidebar_wishlist>
762
+ <reference name="content">
763
+ <block type="adminhtml/sales_order_create_sidebar_wishlist" template="sales/order/create/sidebar/items.phtml" name="sidebar_wishlist" />
764
+ </reference>
765
+ </adminhtml_sales_order_create_load_block_sidebar_wishlist>
766
+
767
+ <adminhtml_sales_order_create_load_block_sidebar_reorder>
768
+ <reference name="content">
769
+ <block type="adminhtml/sales_order_create_sidebar_reorder" template="sales/order/create/sidebar/items.phtml" name="sidebar_reorder" />
770
+ </reference>
771
+ </adminhtml_sales_order_create_load_block_sidebar_reorder>
772
+
773
+ <adminhtml_sales_order_create_load_block_sidebar_viewed>
774
+ <reference name="content">
775
+ <block type="adminhtml/sales_order_create_sidebar_viewed" template="sales/order/create/sidebar/items.phtml" name="sidebar_viewed" />
776
+ </reference>
777
+ </adminhtml_sales_order_create_load_block_sidebar_viewed>
778
+
779
+ <adminhtml_sales_order_create_load_block_sidebar_compared>
780
+ <reference name="content">
781
+ <block type="adminhtml/sales_order_create_sidebar_compared" template="sales/order/create/sidebar/items.phtml" name="sidebar_compared" />
782
+ </reference>
783
+ </adminhtml_sales_order_create_load_block_sidebar_compared>
784
+
785
+ <adminhtml_sales_order_create_load_block_sidebar_pviewed>
786
+ <reference name="content">
787
+ <block type="adminhtml/sales_order_create_sidebar_pviewed" template="sales/order/create/sidebar/items.phtml" name="sidebar_pviewed" />
788
+ </reference>
789
+ </adminhtml_sales_order_create_load_block_sidebar_pviewed>
790
+
791
+ <adminhtml_sales_order_create_load_block_sidebar_pcompared>
792
+ <reference name="content">
793
+ <block type="adminhtml/sales_order_create_sidebar_pcompared" template="sales/order/create/sidebar/items.phtml" name="sidebar_pcompared" />
794
+ </reference>
795
+ </adminhtml_sales_order_create_load_block_sidebar_pcompared>
796
+
797
+ <report_sales>
798
+ <reference name="messages">
799
+ <action method="addNotice" translate="message">
800
+ <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message>
801
+ </action>
802
+ </reference>
803
+ </report_sales>
804
+
805
+ <adminhtml_report_sales_sales>
806
+ <update handle="report_sales"/>
807
+ <reference name="content">
808
+ <block type="adminhtml/report_sales_sales" template="report/grid/container.phtml" name="sales.report.grid.container">
809
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
810
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
811
+ </block>
812
+ <block type="sales/adminhtml_report_filter_form_order" name="grid.filter.form">
813
+ <action method="addReportTypeOption" translate="value">
814
+ <key>created_at_order</key>
815
+ <value>Order Created Date</value>
816
+ </action>
817
+ <action method="addReportTypeOption" translate="value">
818
+ <key>updated_at_order</key>
819
+ <value>Order Updated Date</value>
820
+ </action>
821
+ <action method="setFieldOption" translate="value">
822
+ <field>report_type</field>
823
+ <option>note</option>
824
+ <value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
825
+ </action>
826
+ </block>
827
+ </block>
828
+ </reference>
829
+ </adminhtml_report_sales_sales>
830
+
831
+ <adminhtml_report_sales_tax>
832
+ <update handle="report_sales"/>
833
+ <reference name="content">
834
+ <block type="adminhtml/report_sales_tax" template="report/grid/container.phtml" name="sales.report.grid.container">
835
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
836
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
837
+ </block>
838
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
839
+ <action method="addReportTypeOption" translate="value">
840
+ <key>created_at_order</key>
841
+ <value>Order Created Date</value>
842
+ </action>
843
+ <action method="addReportTypeOption" translate="value">
844
+ <key>updated_at_order</key>
845
+ <value>Order Updated Date</value>
846
+ </action>
847
+ <action method="setFieldOption" translate="value">
848
+ <field>report_type</field>
849
+ <option>note</option>
850
+ <value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
851
+ </action>
852
+ </block>
853
+ </block>
854
+ </reference>
855
+ </adminhtml_report_sales_tax>
856
+
857
+ <adminhtml_report_sales_shipping>
858
+ <update handle="report_sales"/>
859
+ <reference name="content">
860
+ <block type="adminhtml/report_sales_shipping" template="report/grid/container.phtml" name="sales.report.grid.container">
861
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
862
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
863
+ </block>
864
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
865
+ <action method="addReportTypeOption" translate="value">
866
+ <key>created_at_order</key>
867
+ <value>Order Created Date</value>
868
+ </action>
869
+ <action method="addReportTypeOption" translate="value">
870
+ <key>created_at_shipment</key>
871
+ <value>First Invoice Created Date</value>
872
+ </action>
873
+ </block>
874
+ </block>
875
+ </reference>
876
+ </adminhtml_report_sales_shipping>
877
+
878
+ <adminhtml_report_sales_invoiced>
879
+ <update handle="report_sales"/>
880
+ <reference name="content">
881
+ <block type="adminhtml/report_sales_invoiced" template="report/grid/container.phtml" name="sales.report.grid.container">
882
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
883
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
884
+ </block>
885
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
886
+ <action method="addReportTypeOption" translate="value">
887
+ <key>created_at_order</key>
888
+ <value>Order Created Date</value>
889
+ </action>
890
+ <action method="addReportTypeOption" translate="value">
891
+ <key>created_at_invoice</key>
892
+ <value>Last Invoice Created Date</value>
893
+ </action>
894
+ </block>
895
+ </block>
896
+ </reference>
897
+ </adminhtml_report_sales_invoiced>
898
+
899
+ <adminhtml_report_sales_refunded>
900
+ <update handle="report_sales"/>
901
+ <reference name="content">
902
+ <block type="adminhtml/report_sales_refunded" template="report/grid/container.phtml" name="sales.report.grid.container">
903
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
904
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
905
+ </block>
906
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
907
+ <action method="addReportTypeOption" translate="value">
908
+ <key>created_at_order</key>
909
+ <value>Order Created Date</value>
910
+ </action>
911
+ <action method="addReportTypeOption" translate="value">
912
+ <key>created_at_refunded</key>
913
+ <value>Last Credit Memo Created Date</value>
914
+ </action>
915
+ </block>
916
+ </block>
917
+ </reference>
918
+ </adminhtml_report_sales_refunded>
919
+
920
+ <adminhtml_report_sales_coupons>
921
+ <update handle="report_sales"/>
922
+ <reference name="content">
923
+ <block type="adminhtml/report_sales_coupons" template="report/grid/container.phtml" name="sales.report.grid.container">
924
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
925
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
926
+ </block>
927
+ <block type="sales/adminhtml_report_filter_form_coupon" name="grid.filter.form">
928
+ <action method="addReportTypeOption" translate="value">
929
+ <key>created_at_order</key>
930
+ <value>Order Created Date</value>
931
+ </action>
932
+ <action method="addReportTypeOption" translate="value">
933
+ <key>updated_at_order</key>
934
+ <value>Order Updated Date</value>
935
+ </action>
936
+ <action method="setFieldOption" translate="value">
937
+ <field>report_type</field>
938
+ <option>note</option>
939
+ <value>Order Updated Date report is real-time, does not need statistics refreshing.</value>
940
+ </action>
941
+ </block>
942
+ </block>
943
+ </reference>
944
+ </adminhtml_report_sales_coupons>
945
+
946
+ <adminhtml_report_sales_bestsellers>
947
+ <update handle="report_sales"/>
948
+ <reference name="content">
949
+ <block type="adminhtml/report_sales_bestsellers" template="report/grid/container.phtml" name="sales.report.grid.container">
950
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
951
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
952
+ </block>
953
+ <block type="sales/adminhtml_report_filter_form" name="grid.filter.form">
954
+ <action method="setFieldVisibility">
955
+ <field>report_type</field>
956
+ <visibility>0</visibility>
957
+ </action>
958
+ <action method="setFieldVisibility">
959
+ <field>show_order_statuses</field>
960
+ <visibility>0</visibility>
961
+ </action>
962
+ <action method="setFieldVisibility">
963
+ <field>order_statuses</field>
964
+ <visibility>0</visibility>
965
+ </action>
966
+ </block>
967
+ </block>
968
+ </reference>
969
+ </adminhtml_report_sales_bestsellers>
970
+
971
+ <adminhtml_sales_recurring_profile_index>
972
+ <reference name="content">
973
+ <block type="sales/adminhtml_recurring_profile" name="sales.recurring.profile.grid.container"/>
974
+ </reference>
975
+ </adminhtml_sales_recurring_profile_index>
976
+
977
+ <adminhtml_sales_recurring_profile_grid>
978
+ <remove name="root"/>
979
+ <block type="sales/adminhtml_recurring_profile_grid" name="sales.recurring.profile.grid" output="toHtml"/>
980
+ </adminhtml_sales_recurring_profile_grid>
981
+
982
+ <adminhtml_sales_recurring_profile_customergrid>
983
+ <block type="sales/adminhtml_customer_edit_tab_recurring_profile" name="customer.recurring.profile.grid" output="toHtml"></block>
984
+ </adminhtml_sales_recurring_profile_customergrid>
985
+
986
+ <adminhtml_sales_recurring_profile_view>
987
+ <reference name="content">
988
+ <block type="sales/adminhtml_recurring_profile_view" name="sales.recurring.profile.view" template="widget/view/container.phtml">
989
+ <action method="setDestElementId"><value>sales_recurring_profile_view</value></action>
990
+ </block>
991
+ </reference>
992
+ <reference name="left">
993
+ <block type="adminhtml/widget_tabs" name="sales.recurring.profile.view.tabs">
994
+ <action method="setDestElementId"><value>sales_recurring_profile_view</value></action>
995
+ <action method="setTitle" translate="value"><value>Recurring Profile View</value></action>
996
+ <action method="setId"><value>sales_recurring_profile_view_tabs</value></action>
997
+ <block type="sales/adminhtml_recurring_profile_view_tab_info" as="info_tab" name="sales.recurring.profile.tab.info" template="sales/recurring/profile/view.phtml">
998
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.general" as="general" template="sales/recurring/profile/view/info.phtml">
999
+ <action method="prepareReferenceInfo"/>
1000
+ <action method="addToParentGroup"><value>info_blocks_row_1</value></action>
1001
+ <action method="setViewColumn"><value>1</value></action>
1002
+ <action method="setViewLabel" translate="value"><value>Reference</value></action>
1003
+ </block>
1004
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.item" as="item" template="sales/recurring/profile/view/info.phtml">
1005
+ <action method="prepareItemInfo"/>
1006
+ <action method="addToParentGroup"><value>info_blocks_row_1</value></action>
1007
+ <action method="setViewColumn"><value>2</value></action>
1008
+ <action method="setViewLabel" translate="value"><value>Purchased Item</value></action>
1009
+ </block>
1010
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.schedule" as="profile" template="sales/recurring/profile/view/info.phtml">
1011
+ <action method="prepareScheduleInfo"/>
1012
+ <action method="addToParentGroup"><value>info_blocks_row_2</value></action>
1013
+ <action method="setViewColumn"><value>1</value></action>
1014
+ <action method="setViewLabel" translate="value"><value>Profile Schedule</value></action>
1015
+ </block>
1016
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.fees" as="fees" template="sales/recurring/profile/view/info.phtml">
1017
+ <action method="prepareFeesInfo"/>
1018
+ <action method="addToParentGroup"><value>info_blocks_row_2</value></action>
1019
+ <action method="setViewColumn"><value>2</value></action>
1020
+ <action method="setViewLabel" translate="value"><value>Profile Payments</value></action>
1021
+ </block>
1022
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.billing" as="billing_address" template="sales/recurring/profile/view/info.phtml">
1023
+ <action method="prepareAddressInfo"/>
1024
+ <action method="addToParentGroup"><value>info_blocks_row_3</value></action>
1025
+ <action method="setViewColumn"><value>1</value></action>
1026
+ <action method="setViewLabel" translate="value"><value>Billing Address</value></action>
1027
+ </block>
1028
+ <block type="sales/recurring_profile_view" name="sales.recurring.profile.view.shipping" as="shipping_address" template="sales/recurring/profile/view/info.phtml">
1029
+ <action method="setAddressType"><value>shipping</value></action>
1030
+ <action method="prepareAddressInfo"/>
1031
+ <action method="addToParentGroup"><value>info_blocks_row_3</value></action>
1032
+ <action method="setViewColumn"><value>2</value></action>
1033
+ <action method="setViewLabel" translate="value"><value>Shipping Address</value></action>
1034
+ </block>
1035
+ </block>
1036
+ <block type="sales/adminhtml_recurring_profile_view_tab_orders" as="orders_tab" name="sales.recurring.profile.tab.orders"/>
1037
+ <action method="addTab"><name>recurring_profile_info</name><block>info_tab</block></action>
1038
+ <action method="addTab"><name>recurring_profile_orders</name><block>orders_tab</block></action>
1039
+ </block>
1040
+ </reference>
1041
+ </adminhtml_sales_recurring_profile_view>
1042
+
1043
+ <adminhtml_sales_recurring_profile_orders>
1044
+ <remove name="root"/>
1045
+ <block type="sales/adminhtml_recurring_profile_view_tab_orders" name="sales.recurring.profile.tab.orders" output="toHtml"/>
1046
+ </adminhtml_sales_recurring_profile_orders>
1047
+
1048
+ <adminhtml_customer_edit>
1049
+ <reference name="customer_edit_tabs">
1050
+ <action method="addTab"><name>customer_edit_tab_agreements</name><block>sales/adminhtml_customer_edit_tab_agreement</block></action>
1051
+ <action method="addTab"><name>customer_edit_tab_recurring_profile</name><block>sales/adminhtml_customer_edit_tab_recurring_profile</block></action>
1052
+ </reference>
1053
+ </adminhtml_customer_edit>
1054
+
1055
+ <adminhtml_sales_order_status_index>
1056
+ <reference name="content">
1057
+ <block type="adminhtml/sales_order_status" name="sales_order_status.grid.container"></block>
1058
+ </reference>
1059
+ </adminhtml_sales_order_status_index>
1060
+ <adminhtml_sales_order_status_new>
1061
+ <reference name="content">
1062
+ <block type="adminhtml/sales_order_status_new" name="sales_order_status.new.container"></block>
1063
+ </reference>
1064
+ </adminhtml_sales_order_status_new>
1065
+ <adminhtml_sales_order_status_edit>
1066
+ <reference name="content">
1067
+ <block type="adminhtml/sales_order_status_edit" name="sales_order_status.edit.container"></block>
1068
+ </reference>
1069
+ </adminhtml_sales_order_status_edit>
1070
+ <adminhtml_sales_order_status_assign>
1071
+ <reference name="content">
1072
+ <block type="adminhtml/sales_order_status_assign" name="sales_order_status.assign.container"></block>
1073
+ </reference>
1074
+ </adminhtml_sales_order_status_assign>
1075
+ <adminhtml_sales_order_address>
1076
+ <reference name="content">
1077
+ <block type="adminhtml/sales_order_address" name="sales_order_address.form.container"></block>
1078
+ </reference>
1079
+ </adminhtml_sales_order_address>
1080
+ </layout>
app/design/adminhtml/default/default/layout/search.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_catalog_search_edit>
31
+ <reference name="content">
32
+ <block type="adminhtml/catalog_search_edit" name="catalog_search_edit" />
33
+ </reference>
34
+ </adminhtml_catalog_search_edit>
35
+ </layout>
app/design/adminhtml/default/default/layout/tag.xml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <adminhtml_tag_edit>
30
+ <reference name="content">
31
+ <block type="adminhtml/tag_edit" name="tag_edit" template="tag/edit/container.phtml"></block>
32
+ </reference>
33
+ </adminhtml_tag_edit>
34
+ <adminhtml_tag_assigned>
35
+ <remove name="root" />
36
+ <block type="adminhtml/tag_assigned_grid" name="tag_assigned_grid" output="toHtml" />
37
+ <block type="adminhtml/widget_grid_serializer" name="tag_grid_serializer" output="toHtml">
38
+ <reference name="tag_grid_serializer">
39
+ <action method="initSerializerBlock">
40
+ <grid_block_name>tag_assigned_grid</grid_block_name>
41
+ <data_callback>getRelatedProducts</data_callback>
42
+ <hidden_input_name>tag_assigned_products</hidden_input_name>
43
+ <reload_param_name>assigned_products</reload_param_name>
44
+ </action>
45
+ </reference>
46
+ </block>
47
+ </adminhtml_tag_assigned>
48
+ <adminhtml_tag_assignedgridonly>
49
+ <remove name="root" />
50
+ <block type="adminhtml/tag_assigned_grid" name="assigned_grid" output="toHtml" />
51
+ </adminhtml_tag_assignedgridonly>
52
+
53
+ <adminhtml_tag_index>
54
+ <reference name="content">
55
+ <block type="adminhtml/tag_tag" name="adminhtml.tag.tag"/>
56
+ </reference>
57
+ </adminhtml_tag_index>
58
+
59
+ <adminhtml_tag_pending>
60
+ <reference name="content">
61
+ <block type="adminhtml/tag_pending" name="adminhtml.tag.pending"/>
62
+ </reference>
63
+ </adminhtml_tag_pending>
64
+
65
+ <adminhtml_tag_ajaxgrid>
66
+ <block type="core/text_list" name="root" output="toHtml">
67
+ <block type="adminhtml/tag_tag_grid" name="adminhtml.tag.tag.grid"/>
68
+ </block>
69
+ </adminhtml_tag_ajaxgrid>
70
+
71
+ <adminhtml_tag_ajaxpendinggrid>
72
+ <block type="core/text_list" name="root" output="toHtml">
73
+ <block type="adminhtml/tag_grid_pending" name="adminhtml.tag.grid.pending"/>
74
+ </block>
75
+ </adminhtml_tag_ajaxpendinggrid>
76
+
77
+ <adminhtml_tag_product>
78
+ <block type="core/text_list" name="root" output="toHtml">
79
+ <block type="adminhtml/tag_product_grid" name="adminhtml.tag.product.grid"/>
80
+ </block>
81
+ </adminhtml_tag_product>
82
+
83
+ <adminhtml_tag_customer>
84
+ <block type="core/text_list" name="root" output="toHtml">
85
+ <block type="adminhtml/tag_customer_grid" name="adminhtml.tag.customer.grid"/>
86
+ </block>
87
+ </adminhtml_tag_customer>
88
+ </layout>
app/design/adminhtml/default/default/layout/tax.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <layout>
29
+ <default>
30
+ <reference name="notifications">
31
+ <block type="tax/adminhtml_notifications" name="tax_notifications" template="tax/notifications.phtml"></block>
32
+ </reference>
33
+ </default>
34
+ </layout>
app/design/adminhtml/default/default/layout/widget.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_widget_index>
31
+ <block name="wysiwyg_widget" type="widget/adminhtml_widget" output="toHtml" />
32
+ </adminhtml_widget_index>
33
+
34
+ <adminhtml_widget_loadoptions>
35
+ <block name="wysiwyg_widget.options" type="widget/adminhtml_widget_options" output="toHtml" />
36
+ </adminhtml_widget_loadoptions>
37
+
38
+ <adminhtml_widget_instance_index>
39
+ <reference name="content">
40
+ <block type="widget/adminhtml_widget_instance" name="widget_instance" />
41
+ </reference>
42
+ </adminhtml_widget_instance_index>
43
+
44
+ <adminhtml_widget_instance_edit>
45
+ <reference name="head">
46
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
47
+ <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
48
+ <action method="addItem"><type>js</type><name>prototype/window.js</name></action>
49
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
50
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
51
+ </reference>
52
+ <reference name="content">
53
+ <block type="widget/adminhtml_widget_instance_edit" name="widget_instance_edit" />
54
+ </reference>
55
+ <reference name="left">
56
+ <block type="widget/adminhtml_widget_instance_edit_tabs" name="widget_instance_edit_tabs">
57
+ <block type="widget/adminhtml_widget_instance_edit_tab_settings" name="widget_instance_edit_tab_settings" />
58
+ <block type="widget/adminhtml_widget_instance_edit_tab_main" name="widget_instance_edit_tab_main" />
59
+ <block type="widget/adminhtml_widget_instance_edit_tab_properties" name="widget_instance_edit_tab_properties" />
60
+ <action method="addTab"><name>settings_section</name><block>widget_instance_edit_tab_settings</block></action>
61
+ <action method="addTab"><name>main_section</name><block>widget_instance_edit_tab_main</block></action>
62
+ <action method="addTab"><name>properties_section</name><block>widget_instance_edit_tab_properties</block></action>
63
+ </block>
64
+ </reference>
65
+ <reference name="js">
66
+ <block type="adminhtml/template" template="widget/instance/js.phtml" name="widget_instance_js"></block>
67
+ </reference>
68
+ </adminhtml_widget_instance_edit>
69
+ </layout>
app/design/adminhtml/default/default/layout/xmlconnect.xml ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <default>
31
+ <reference name="head">
32
+ <action method="addCss"><name>xmlconnect/boxes.css</name></action>
33
+ <action method="addItem"><type>skin_css</type><name>xmlconnect/iestyles.css</name><params/><if>lte IE 8</if></action>
34
+ </reference>
35
+ </default>
36
+
37
+ <adminhtml_mobile_index>
38
+ <reference name="content">
39
+ <block type="xmlconnect/adminhtml_mobile" name="applications"/>
40
+ </reference>
41
+ </adminhtml_mobile_index>
42
+
43
+ <adminhtml_mobile_history>
44
+ <reference name="content">
45
+ <block type="xmlconnect/adminhtml_history" name="history"/>
46
+ </reference>
47
+ </adminhtml_mobile_history>
48
+
49
+ <adminhtml_mobile_queue>
50
+ <reference name="content">
51
+ <block type="xmlconnect/adminhtml_queue" name="queue"/>
52
+ </reference>
53
+ </adminhtml_mobile_queue>
54
+
55
+ <adminhtml_mobile_template>
56
+ <reference name="content">
57
+ <block type="xmlconnect/adminhtml_template" name="template"/>
58
+ </reference>
59
+ </adminhtml_mobile_template>
60
+
61
+ <adminhtml_mobile_editqueue>
62
+ <reference name="content">
63
+ <block type="xmlconnect/adminhtml_queue_edit" name="queue_edit"/>
64
+ </reference>
65
+ </adminhtml_mobile_editqueue>
66
+
67
+ <adminhtml_mobile_queuemessage>
68
+ <reference name="content">
69
+ <block type="xmlconnect/adminhtml_queue_edit" name="queue_edit"/>
70
+ </reference>
71
+ </adminhtml_mobile_queuemessage>
72
+
73
+ <adminhtml_mobile_edittemplate>
74
+ <reference name="head">
75
+ <action method="setCanLoadExtJs"><flag>1</flag></action>
76
+ <action method="addJs"><script>mage/adminhtml/variables.js</script></action>
77
+ <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
78
+ <action method="addJs"><script>lib/flex.js</script></action>
79
+ <action method="addJs"><script>lib/FABridge.js</script></action>
80
+ <action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
81
+ <action method="addJs"><script>mage/adminhtml/browser.js</script></action>
82
+ <action method="addJs"><script>prototype/window.js</script></action>
83
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
84
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>
85
+ </reference>
86
+ <reference name="content">
87
+ <block type="xmlconnect/adminhtml_template_edit" name="template_edit"/>
88
+ </reference>
89
+ </adminhtml_mobile_edittemplate>
90
+
91
+ <adminhtml_mobile_new>
92
+ <reference name="left">
93
+ <block type="xmlconnect/adminhtml_mobile_edit_tabs" name="mobile_edit_tabs" />
94
+ </reference>
95
+ <reference name="content">
96
+ <block type="xmlconnect/adminhtml_mobile_edit" name="mobile_edit_content"/>
97
+ </reference>
98
+ </adminhtml_mobile_new>
99
+
100
+ <adminhtml_mobile_edit>
101
+ <update handle="editor"/>
102
+ <reference name="left">
103
+ <block type="xmlconnect/adminhtml_mobile_edit_tabs" name="mobile_edit_tabs">
104
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_offlineCatalog" name="mobile_edit_tab_offlineCatalog"/>
105
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_general" name="mobile_edit_tab_general"/>
106
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design" name="mobile_edit_tab_design">
107
+ <block type="adminhtml/media_uploader" name="adminhtml_media_uploader" as="media_uploader"/>
108
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_images" name="mobile_edit_tab_design_images" as="design_images" />
109
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion" name="mobile_edit_tab_design_accordion" as="design_accordion">
110
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion_themes" name="accordion_themes" />
111
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_accordion_tabs" name="accordion_tabs" />
112
+
113
+ <action method="addAccordionItem"><name>themes</name><block>accordion_themes</block></action>
114
+ <action method="addAccordionItem"><name>tabs</name><block>accordion_tabs</block></action>
115
+ </block>
116
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_preview" name="mobile_edit_tab_design_preview" as="app_preview" />
117
+ </block>
118
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_content" name="mobile_edit_tab_content"/>
119
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_payment" name="mobile_edit_tab_payment"/>
120
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_flurryanalytics" name="mobile_edit_tab_flurryanalytics"/>
121
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_submission_history" name="mobile_edit_tab_submission_history_grid"/>
122
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_cache" name="mobile_edit_tab_cache"/>
123
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_social" name="mobile_edit_tab_social" />
124
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_notification" name="mobile_edit_tab_notification">
125
+ <block type="core/template" name="mobile_edit_tab_notification_helper" as="app_notification_helper" template="xmlconnect/mobile/notification_helper.phtml" />
126
+ </block>
127
+
128
+ <action method="addTab"><id>general_section</id><block>mobile_edit_tab_general</block></action>
129
+ <action method="addTab"><id>design_section</id><block>mobile_edit_tab_design</block></action>
130
+ <action method="addTab"><id>content_section</id><block>mobile_edit_tab_content</block></action>
131
+ <action method="addTab"><id>payment_methods</id><block>mobile_edit_tab_payment</block></action>
132
+ <action method="addTab"><id>flurryanalytics_section</id><block>mobile_edit_tab_flurryanalytics</block></action>
133
+ <action method="addTab"><id>history_grid</id><block>mobile_edit_tab_submission_history_grid</block></action>
134
+ <action method="addTab"><id>cache_section</id><block>mobile_edit_tab_cache</block></action>
135
+ <action method="addTab"><id>social_section</id><block>mobile_edit_tab_social</block></action>
136
+ <action method="addTab"><id>notification_section</id><block>mobile_edit_tab_notification</block></action>
137
+ <!--<action method="addTab"><id>offline_catalog</id><block>mobile_edit_tab_offlineCatalog</block></action>-->
138
+ </block>
139
+ </reference>
140
+ <reference name="content">
141
+ <block type="xmlconnect/adminhtml_mobile_edit" name="mobile_edit_content"/>
142
+ </reference>
143
+ <reference name="before_body_end">
144
+ <block type="core/template" name="image_action_block" template="xmlconnect/edit/tab/design/image_edit.phtml"/>
145
+ </reference>
146
+ <reference name="head">
147
+ <action method="addCss"><name>xmlconnect/dropdown.css</name></action>
148
+ <action method="addCss"><name>xmlconnect/styles.css</name></action>
149
+ </reference>
150
+ </adminhtml_mobile_edit>
151
+
152
+ <adminhtml_mobile_submissionhistorygrid>
153
+ <remove name="root"/>
154
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_submission_history" name="submission_history_grid" output="toHtml"/>
155
+ </adminhtml_mobile_submissionhistorygrid>
156
+
157
+ <adminhtml_mobile_submission>
158
+ <reference name="left">
159
+ <block type="xmlconnect/adminhtml_mobile_submission_tabs" name="mobile_submission_tabs">
160
+ <block type="xmlconnect/adminhtml_mobile_submission_tab_container" name="mobile_submission_tab_container">
161
+ <block type="xmlconnect/adminhtml_mobile_submission_tab_container_submission" name="mobile_submission_tab_container_submission" as="edit_form"/>
162
+ <block type="xmlconnect/adminhtml_mobile_edit_tab_design_preview" name="mobile_edit_tab_design_preview" as="app_preview" />
163
+ </block>
164
+ <action method="addTab"><id>submission_section</id><block>mobile_submission_tab_container</block></action>
165
+ </block>
166
+ </reference>
167
+ <reference name="content">
168
+ <block type="xmlconnect/adminhtml_mobile_submission" name="mobile_submission_content"/>
169
+ </reference>
170
+ <reference name="head">
171
+ <action method="addCss"><name>xmlconnect/styles.css</name></action>
172
+ </reference>
173
+ </adminhtml_mobile_submission>
174
+
175
+ <adminhtml_mobile_grid>
176
+ <block type="xmlconnect/adminhtml_mobile_grid" name="mobile_grid" output="toHtml"/>
177
+ </adminhtml_mobile_grid>
178
+
179
+ <adminhtml_mobile_history_grid>
180
+ <block type="xmlconnect/adminhtml_history_grid" name="history_grid" output="toHtml"/>
181
+ </adminhtml_mobile_history_grid>
182
+
183
+ <adminhtml_mobile_template_preview>
184
+ <block type="core/template" name="root" output="toHtml" template="xmlconnect/template/preview.phtml">
185
+ <block type="xmlconnect/adminhtml_template_preview" name="content" as="content"></block>
186
+ </block>
187
+ </adminhtml_mobile_template_preview>
188
+
189
+ <adminhtml_mobile_previewhome>
190
+ <block type="core/text_list" name="root" output="toHtml">
191
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_home_content">
192
+ <action method="setTemplate"><templateType>home</templateType></action>
193
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
194
+ <action method="setActiveTab"><tab>home</tab></action>
195
+ </block>
196
+ </block>
197
+ <block type="core/template" template="xmlconnect/edit/tab/design/preview/banner_rotator.phtml"/>
198
+ </block>
199
+ </adminhtml_mobile_previewhome>
200
+
201
+ <adminhtml_mobile_previewhomehor>
202
+ <block type="core/text_list" name="root" output="toHtml">
203
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_home_hor_content">
204
+ <action method="setTemplate"><templateType>home_hor</templateType></action>
205
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
206
+ <action method="setActiveTab"><tab>home</tab></action>
207
+ </block>
208
+ </block>
209
+ <block type="core/template" template="xmlconnect/edit/tab/design/preview/banner_rotator.phtml"/>
210
+ </block>
211
+ </adminhtml_mobile_previewhomehor>
212
+
213
+ <adminhtml_mobile_previewcataloghor>
214
+ <block type="core/text_list" name="root" output="toHtml">
215
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_catalog_hor_content">
216
+ <action method="setTemplate"><templateType>catalog_hor</templateType></action>
217
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
218
+ <action method="setActiveTab"><tab>shop</tab></action>
219
+ </block>
220
+ </block>
221
+ </block>
222
+ </adminhtml_mobile_previewcataloghor>
223
+
224
+ <adminhtml_mobile_previewcatalog>
225
+ <block type="core/text_list" name="root" output="toHtml">
226
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_catalog_content">
227
+ <action method="setTemplate"><templateType>catalog</templateType></action>
228
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
229
+ <action method="setActiveTab"><tab>shop</tab></action>
230
+ </block>
231
+ </block>
232
+ </block>
233
+ </adminhtml_mobile_previewcatalog>
234
+
235
+ <adminhtml_mobile_previewproductinfo>
236
+ <block type="core/text_list" name="root" output="toHtml">
237
+ <block type="xmlconnect/adminhtml_mobile_preview_content" name="preview_productinfo_content">
238
+ <action method="setTemplate"><templateType>productinfo</templateType></action>
239
+ <block type="xmlconnect/adminhtml_mobile_preview_tabitems" name="preview_tab_items" as="tab_items">
240
+ <action method="setActiveTab"><tab>shop</tab></action>
241
+ </block>
242
+ </block>
243
+ </block>
244
+ </adminhtml_mobile_previewproductinfo>
245
+
246
+ <!-- Admin application actions -->
247
+ <adminhtml_admin_application_index>
248
+ <reference name="left">
249
+ <block type="xmlconnect/adminhtml_admin_application_edit_tabs" name="admin_app_settings_tabs"/>
250
+ </reference>
251
+ <reference name="content">
252
+ <block type="xmlconnect/adminhtml_admin_application_edit" name="admin_app_settings"/>
253
+ </reference>
254
+ </adminhtml_admin_application_index>
255
+
256
+ <adminhtml_connect_config_index>
257
+ <block type="xmlconnect/adminhtml_connect_config" name="admin.connect.config" output="toHtml"/>
258
+ </adminhtml_connect_config_index>
259
+
260
+ <adminhtml_connect_config_localization>
261
+ <block type="xmlconnect/localization" name="xmlconnect.localization" output="toHtml"/>
262
+ </adminhtml_connect_config_localization>
263
+
264
+ <adminhtml_connect_dashboard_index>
265
+ <block type="xmlconnect/adminhtml_connect_dashboard" name="admin.connect.dashboard" output="toHtml">
266
+ <block type="xmlconnect/adminhtml_connect_dashboard_storeSwitcher" name="admin.connect.store.switcher" as="store_switcher"/>
267
+ <block type="xmlconnect/adminhtml_connect_dashboard_salesInfo" name="dashboard.sales.info" as="sales_info"/>
268
+ <block type="xmlconnect/adminhtml_connect_dashboard_graphInfo" name="dashboard.graph.info" as="graph_info">
269
+ <block type="xmlconnect/adminhtml_connect_dashboard_graphOrderData" name="dashboard.graph.order.data" as="graph_order_data"/>
270
+ <block type="xmlconnect/adminhtml_connect_dashboard_graphAmountsData" name="dashboard.graph.amounts.data" as="graph_amounts_data"/>
271
+ <block type="xmlconnect/adminhtml_connect_dashboard_graphTotalsData" name="dashboard.graph.totals.data" as="graph_totals_data"/>
272
+ </block>
273
+ <block type="xmlconnect/adminhtml_connect_dashboard_lastOrders" name="dashboard.last.orders" as="last_orders"/>
274
+ <block type="xmlconnect/adminhtml_connect_dashboard_lastSearchTerms" name="dashboard.last.search.terms" as="last_search_terms"/>
275
+ <block type="xmlconnect/adminhtml_connect_dashboard_newCustomers" name="dashboard.new.customers" as="new_customers"/>
276
+ <block type="xmlconnect/adminhtml_connect_dashboard_topSearchTerms" name="dashboard.top.search.terms" as="top_search_terms"/>
277
+ <block type="xmlconnect/adminhtml_connect_dashboard_mostViewedProducts" name="dashboard.most.viewed.products" as="most_viewed"/>
278
+ <block type="xmlconnect/adminhtml_connect_dashboard_bestSellers" name="dashboard.best.sellers" as="best_sellers"/>
279
+ <block type="xmlconnect/adminhtml_connect_dashboard_customers" name="dashboard.customers" as="customers"/>
280
+ </block>
281
+ </adminhtml_connect_dashboard_index>
282
+ </layout>
app/design/adminhtml/default/default/locale/en_US/translate.csv ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Credit Card Type","Credit Card Type"
2
+ "Add New User","Add New User"
3
+ "Items that you don","Items that you don"
4
+ "State/Province","State/Province"
5
+ "Magento Commerce - Administrative Panel","Magento Commerce - Administrative Panel"
6
+ "3 stars","3 stars"
7
+ "Credit Memo Date","Credit Memo Date"
8
+ "Double click on a group to rename it","Double click on a group to rename it"
9
+ "Rating Not Available","Rating Not Available"
10
+ "Gift Certificate","Gift Certificate"
11
+ "Assigned Answers","Assigned Answers"
12
+ "Fax","Fax"
13
+ "Magento Admin","Magento Admin"
14
+ "Newsletter Message Preview","Newsletter Message Preview"
15
+ "4 stars","4 stars"
16
+ "Company","Company"
17
+ "Invoice Date","Invoice Date"
18
+ "Qty Returned","Qty Returned"
19
+ "Add New Customer Group","Add New Customer Group"
20
+ "Visitors","Visitors"
21
+ "Shipping Method","Shipping Method"
22
+ "Subtotal","Subtotal"
23
+ "5 stars","5 stars"
24
+ "Choose Store","Choose Store"
25
+ "Import Tax Rates","Import Tax Rates"
26
+ "Roles","Roles"
27
+ "If you do not specify an option value for a store then the default value will be used.","If you do not specify an option value for a store then the default value will be used."
28
+ "Shipping","Shipping"
29
+ "Select from existing customer addresses:","Select from existing customer addresses:"
30
+ "Products","Products"
31
+ "Edit User ","Edit User "
32
+ "Item Status","Item Status"
33
+ "Set as default billing address","Set as default billing address"
34
+ "Position","Position"
35
+ "Items Ordered","Items Ordered"
36
+ "Fixed","Fixed"
37
+ "%s","%s"
38
+ "Same as Billing Address","Same as Billing Address"
39
+ "Product In Stores","Product In Stores"
40
+ "Working...","Working..."
41
+ "Apply coupon code","Apply coupon code"
42
+ "per page","per page"
43
+ "Tax","Tax"
44
+ "Telephone","Telephone"
45
+ "Wishlist","Wishlist"
46
+ "Magento","Magento"
47
+ "Expiration Date","Expiration Date"
48
+ "Add New Class","Add New Class"
49
+ "Super product attributes configuration","Super product attributes configuration"
50
+ "Previus page","Previus page"
51
+ "Something went wrong...","Something went wrong..."
52
+ "Lifetime Sales","Lifetime Sales"
53
+ "SKU","SKU"
54
+ "Log Out","Log Out"
55
+ "Failed","Failed"
56
+ "Billing Address","Billing Address"
57
+ "Log into Magento Admin Page","Log into Magento Admin Page"
58
+ "Invoice Status","Invoice Status"
59
+ "CC Type","CC Type"
60
+ "Percentage","Percentage"
61
+ "Are you sure?","Are you sure?"
62
+ "Email","Email"
63
+ "Customer Group:","Customer Group:"
64
+ "Option","Option"
65
+ "Primary Billing Address","Primary Billing Address"
66
+ "Create Backup","Create Backup"
67
+ "Manage Options (values for your attribute)","Manage Options (values for your attribute)"
68
+ "Total Due","Total Due"
69
+ "Copyright 2007","Copyright 2007"
70
+ "Newsletter Subscribers","Newsletter Subscribers"
71
+ "CC Number","CC Number"
72
+ "Add New Tax Rate","Add New Tax Rate"
73
+ "Product Name","Product Name"
74
+ "Country","Country"
75
+ "Purchase order number","Purchase order number"
76
+ "Date and Time","Date and Time"
77
+ "Categories","Categories"
78
+ "Qty Cancelled","Qty Cancelled"
79
+ "Card Verification Number","Card Verification Number"
80
+ "Order Date","Order Date"
81
+ "This tab contains invalid data. Please correct before saving.","This tab contains invalid data. Please correct before saving."
82
+ "Customer Balance","Customer Balance"
83
+ "Update Qty","Update Qty"
84
+ "Customer Groups","Customer Groups"
85
+ "Export to","Export to"
86
+ "configuration","configuration"
87
+ "Sorry, no quotes are available for this order at this time.","Sorry, no quotes are available for this order at this time."
88
+ "Options","Options"
89
+ "Attribute Name","Attribute Name"
90
+ "Total <strong>%d</strong> records found","Total <strong>%d</strong> records found"
91
+ "Comment","Comment"
92
+ "Set as default shipping address","Set as default shipping address"
93
+ "Last Name","Last Name"
94
+ "of","of"
95
+ "Newsletter Problem Reports","Newsletter Problem Reports"
96
+ "Sales Statistics","Sales Statistics"
97
+ "Qty To Return","Qty To Return"
98
+ "New Customer Address","New Customer Address"
99
+ "Roles Resources","Roles Resources"
100
+ "Zip/Post Code","Zip/Post Code"
101
+ "Order Status","Order Status"
102
+ "Store","Store"
103
+ "Product Categories","Product Categories"
104
+ "Online Customers","Online Customers"
105
+ "Next page","Next page"
106
+ "Items Shipped","Items Shipped"
107
+ "Unassigned Attributes","Unassigned Attributes"
108
+ "Not Charged Yet","Not Charged Yet"
109
+ "This group contains system attributes.\nPlease, move system attributes to another group and try again.","This group contains system attributes.\nPlease, move system attributes to another group and try again."
110
+ "copy data from","copy data from"
111
+ "Add","Add"
112
+ "Total Payed","Total Payed"
113
+ "Shopping Cart","Shopping Cart"
114
+ "Order History","Order History"
115
+ "Empty","Empty"
116
+ "Unable to complete request. Please, try again later.","Unable to complete request. Please, try again later."
117
+ "Customers","Customers"
118
+ "Customer does not have any addresses","Customer does not have any addresses"
119
+ "Add New Role","Add New Role"
120
+ "Street Address","Street Address"
121
+ "Are You Sure?","Are You Sure?"
122
+ "Shipping Address","Shipping Address"
123
+ "Paid","Paid"
124
+ "Page","Page"
125
+ "Discount","Discount"
126
+ "Set root category for this store in","Set root category for this store in"
127
+ "Groups","Groups"
128
+ "View","View"
129
+ "Qty Ordered","Qty Ordered"
130
+ "Global Record Search","Global Record Search"
131
+ "Card Number","Card Number"
132
+ "PO Number","PO Number"
133
+ "Grand Total","Grand Total"
134
+ "Please select one or more attributes.","Please select one or more attributes."
135
+ "Dashboard","Dashboard"
136
+ "Are you sure you want to do this?","Are you sure you want to do this?"
137
+ "Please add one or more options","Please add one or more options"
138
+ "Role Users","Role Users"
139
+ "Add New Tax Rule","Add New Tax Rule"
140
+ "Subscribe to newsletter","Subscribe to newsletter"
141
+ "Dashboard Control","Dashboard Control"
142
+ "Default Shipping","Default Shipping"
143
+ "Qty","Qty"
144
+ "Add to Queue","Add to Queue"
145
+ "Average Sale","Average Sale"
146
+ "Cancel","Cancel"
147
+ "All stores","All stores"
148
+ "Personal Information","Personal Information"
149
+ "City","City"
150
+ "Export Tax Rates","Export Tax Rates"
151
+ "1 star","1 star"
152
+ "Current Configuration Scope","Current Configuration Scope"
153
+ "Add New Template","Add New Template"
154
+ "Move to:","Move to:"
155
+ "First Name","First Name"
156
+ "Change Order Status","Change Order Status"
157
+ "Are you sure you want to delete this address?","Are you sure you want to delete this address?"
158
+ "Are you sure you want to do it?","Are you sure you want to do it?"
159
+ "Add to Order","Add to Order"
160
+ "Product ID","Product ID"
161
+ "Payment Method","Payment Method"
162
+ "What is this?","What is this?"
163
+ "Users","Users"
164
+ "Customer Addresses","Customer Addresses"
165
+ "Qty Backordered","Qty Backordered"
166
+ "You can not remove system attribute from this set.","You can not remove system attribute from this set."
167
+ "Price","Price"
168
+ "Who","Who"
169
+ "Rating Not Alvailable","Rating Not Alvailable"
170
+ "Order Comment","Order Comment"
171
+ "Edit Role","Edit Role"
172
+ "Tax Rates Import / Export","Tax Rates Import / Export"
173
+ "Magento Logo","Magento Logo"
174
+ "A name is required","A name is required"
175
+ "Assigned options","Assigned options"
176
+ "Please Enter New Group Name","Please Enter New Group Name"
177
+ "Name","Name"
178
+ "Email Preview","Email Preview"
179
+ "Newsletter Queue","Newsletter Queue"
180
+ "Remove","Remove"
181
+ "Last Log In:","Last Log In:"
182
+ "Logged in as <strong>%s</strong>","Logged in as <strong>%s</strong>"
183
+ "Name on Card","Name on Card"
184
+ "All Stores","All Stores"
185
+ "Send comment to customer","Send comment to customer"
186
+ "Account Created on:","Account Created on:"
187
+ "Backups Control","Backups Control"
188
+ "Add New Address","Add New Address"
189
+ "Account Created in:","Account Created in:"
190
+ "Default Billing","Default Billing"
191
+ "Manage Titles (Size, Color, etc.)","Manage Titles (Size, Color, etc.)"
192
+ "Please confirm site switching. All data not saved will be lost.","Please confirm site switching. All data not saved will be lost."
193
+ "Please select from each ratings above","Please select from each ratings above"
194
+ "Qty Shipped","Qty Shipped"
195
+ "Are you sure you want to cancel add this address?","Are you sure you want to cancel add this address?"
196
+ "The information in this tab has been changed.","The information in this tab has been changed."
197
+ "2 stars","2 stars"
198
+ "Apply","Apply"
199
+ "Total","Total"
200
+ "User roles","User roles"
201
+ "Wishlist Report","Wishlist Report"
app/design/adminhtml/default/default/template/access_denied.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Denied
30
+ */
31
+ ?>
32
+ <h1 class="page-heading"><?php echo $this->helper('adminhtml')->__('Access denied') ?></h1>
33
+ <?php if (!$this->hasAvailaleResources()): ?>
34
+ <p>
35
+ <?php echo $this->helper('adminhtml')->__('Please try to logout and sign in again.') ?><br/>
36
+ <?php echo $this->helper('adminhtml')->__('If this message persists, please contact the store owner.') ?>
37
+ </p>
38
+ <?php else: ?>
39
+ <p><?php echo $this->helper('adminhtml')->__('Access denied.') ?></p>
40
+ <?php endif?>
app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ <!--
29
+ <?php $myBlock = $this->getLayout()->getBlock('roleUsersGrid'); ?>
30
+ <?php if( is_object($myBlock) && $myBlock->getJsObjectName() ): ?>
31
+ var checkBoxes = $H({});
32
+ var warning = false;
33
+ var inRoleUsers = $H(<?php echo $myBlock->_getUsers(true) ?>);
34
+ if (inRoleUsers.size() > 0) warning = true;
35
+ $('in_role_user').value = inRoleUsers.toQueryString();
36
+
37
+ function registerUserRole(grid, element, checked){
38
+ if(checked){
39
+ inRoleUsers.set(element.value, 0);
40
+ } else {
41
+ inRoleUsers.unset(element.value);
42
+ }
43
+ $('in_role_user').value = inRoleUsers.toQueryString();
44
+ grid.reloadParams = {'in_role_user[]':inRoleUsers.keys()};
45
+ }
46
+
47
+ function roleUsersRowClick(grid, event){
48
+ var trElement = Event.findElement(event, 'tr');
49
+ var isInput = Event.element(event).tagName == 'INPUT';
50
+ if(trElement){
51
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
52
+ if(checkbox[0]){
53
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
54
+ if (warning && checkBoxes.size() > 0) {
55
+ if ( !confirm("<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?')) ?>") ) {
56
+ checkbox[0].checked = false;
57
+ checkBoxes.each(function(elem) {
58
+ if (elem.value.status == 1) {
59
+ elem.value.object.checked = true;
60
+ }
61
+ });
62
+ return false;
63
+ }
64
+ warning = false;
65
+ }
66
+ <?php echo $myBlock->getJsObjectName() ?>.setCheckboxChecked(checkbox[0], checked);
67
+ }
68
+ }
69
+ }
70
+
71
+ function roleUsersRowInit(grid, row){
72
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
73
+ if (checkbox) {
74
+ checkBoxes.set(checkbox.value, {'status' : ((checkbox.checked) ? 1 : 0), 'object' : checkbox});
75
+ }
76
+ }
77
+
78
+ function myhandler(obj)
79
+ {
80
+ if (checkBoxes.size() > 0) {
81
+ if ( !confirm("<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?')) ?>") ) {
82
+ obj.checked = false;
83
+ checkBoxes.each(function(elem) {
84
+ if (elem.value.status == 1) {
85
+ elem.value.object.checked = true;
86
+ }
87
+ });
88
+ return false;
89
+ }
90
+ warning = false;
91
+ }
92
+ checkBoxes.each(function(elem) {
93
+ <?php echo $myBlock->getJsObjectName() ?>.setCheckboxChecked(elem.value.object, obj.checked);
94
+ });
95
+ }
96
+
97
+ <?php echo $myBlock->getJsObjectName() ?>.rowClickCallback = roleUsersRowClick;
98
+ <?php echo $myBlock->getJsObjectName() ?>.initRowCallback = roleUsersRowInit;
99
+ <?php echo $myBlock->getJsObjectName() ?>.checkboxCheckCallback = registerUserRole;
100
+ <?php echo $myBlock->getJsObjectName() ?>.checkCheckboxes = myhandler;
101
+ <?php echo $myBlock->getJsObjectName() ?>.rows.each(function(row){roleUsersRowInit(<?php echo $myBlock->getJsObjectName() ?>, row)});
102
+ $('in_role_user_old').value = $('in_role_user').value;
103
+ <?php endif; ?>
104
+ //-->
105
+ </script>
app/design/adminhtml/default/default/template/api/roleinfo.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /** @var $this Mage_Adminhtml_Block_Api_Tab_Roleinfo */
27
+
28
+ ?>
29
+ <div class="content-header">
30
+ <table cellspacing="0">
31
+ <tr>
32
+ <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo ($this->getRoleId() > 0 ) ? ($this->__('Edit Role') . " '{$this->escapeHtml($this->getRoleInfo()->getRoleName())}'") : $this->__('Add New Role') ?></h3></td>
33
+ <td class="form-buttons">
34
+ <?php echo $this->getBackButtonHtml() ?>
35
+ <?php echo $this->getResetButtonHtml() ?>
36
+ <?php echo $this->getDeleteButtonHtml() ?>
37
+ <?php echo $this->getSaveButtonHtml() ?>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ <form action="<?php echo $this->getUrl('*/*/saverole') ?>" method="post" id="role_edit_form">
43
+ <?php echo $this->getBlockHtml('formkey')?>
44
+ </form>
45
+ <script type="text/javascript">
46
+ var roleForm = new varienForm('role_edit_form');
47
+ </script>
app/design/adminhtml/default/default/template/api/roles.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo $this->__('Roles') ?></h3></td>
31
+ <td class="form-buttons">
32
+ <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New Role') ?></span></span></span></button>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </div>
37
+ <?php echo $this->getGridHtml() ?>
app/design/adminhtml/default/default/template/api/rolesedit.phtml ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Roles Resources') ?></h4>
30
+ </div>
31
+ <input type="hidden" name="resource" id="role_resources" value="">
32
+ <fieldset id="role_resources">
33
+
34
+ <span class="field-row">
35
+ <label for="all"><?php echo $this->__('Resource Access') ?></label>
36
+ <select id="all" name="all" onchange="$('resources_container').toggle()" class="select">
37
+ <option value="0" <?php echo ($this->getEverythingAllowed()?'':'selected="selected"'); ?>><?php echo $this->__('Custom') ?></option>
38
+ <option value="1" <?php echo ($this->getEverythingAllowed()?'selected="selected"':''); ?>><?php echo $this->__('All') ?></option>
39
+ </select>
40
+ </span>
41
+
42
+ <span class="field-row" id="resources_container">
43
+ <label><?php echo $this->__('Resources') ?></label>
44
+ <div class="f-left">
45
+ <div class="tree x-tree" id="resource-tree"></div>
46
+ </div>
47
+ </span>
48
+
49
+ </fieldset>
50
+ </div>
51
+ <!-- Draw Resources Tree -->
52
+ <script type="text/javascript">
53
+ <?php if($this->getEverythingAllowed()): ?>
54
+ $('resources_container').hide();
55
+ <?php endif; ?>
56
+ Ext.EventManager.onDocumentReady(function() {
57
+ var tree = new Ext.tree.TreePanel('resource-tree', {
58
+ animate:false,
59
+ loader: false,
60
+ enableDD:false,
61
+ containerScroll: true,
62
+ rootUIProvider: Ext.tree.CheckboxNodeUI,
63
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
64
+ rootVisible: false
65
+ });
66
+
67
+ tree.on('check', checkHandler, tree);
68
+
69
+ // set the root node
70
+ var root = new Ext.tree.TreeNode({
71
+ text: 'root',
72
+ draggable:false,
73
+ checked:'false',
74
+ id:'__root__',
75
+ uiProvider: Ext.tree.CheckboxNodeUI
76
+ });
77
+
78
+ tree.setRootNode(root);
79
+ bildResourcesTree(root, <?php echo $this->getResTreeJson() ?>);
80
+ tree.addListener('click', resourceClick.createDelegate(this));
81
+
82
+ // render the tree
83
+ tree.render();
84
+ // root.expand();
85
+ tree.expandAll();
86
+
87
+ $('role_resources').value = tree.getChecked().join(',');
88
+ });
89
+
90
+ function resourceClick(node, e){
91
+ node.getUI().check(!node.getUI().checked());
92
+ varienElementMethods.setHasChanges(Event.element(e), e);
93
+ };
94
+
95
+ function bildResourcesTree(parent, config){
96
+ if (!config) return null;
97
+
98
+ if (parent && config && config.length){
99
+ for (var i = 0; i < config.length; i++){
100
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
101
+ var node = new Ext.tree.TreeNode(config[i]);
102
+ parent.appendChild(node);
103
+ if(config[i].children){
104
+ bildResourcesTree(node, config[i].children);
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ function checkHandler(node)
111
+ {
112
+ if ( node.attributes.checked && node.parentNode ) {
113
+ var n = node.parentNode;
114
+ this.removeListener('check', checkHandler);
115
+ do {
116
+ if (!n || n.attributes.id == 'admin' || n.attributes.id == '__root__') {
117
+ break;
118
+ } else {
119
+ n.ui.check(true);
120
+ }
121
+ } while (n = n.parentNode );
122
+ this.on('check', checkHandler);
123
+ }
124
+ if ( !node.isLeaf() && node.hasChildNodes() ) {
125
+ this.removeListener('check', checkHandler);
126
+ processChildren(node, node.attributes.checked);
127
+ this.on('check', checkHandler);
128
+ }
129
+ $('role_resources').value = this.getChecked().join(',');
130
+ }
131
+
132
+ function processChildren(node, state)
133
+ {
134
+ if ( !node.hasChildNodes() ) return false;
135
+ for(var i = 0; i < node.childNodes.length; i++ ) {
136
+ node.childNodes[i].ui.check(state);
137
+ if ( node.childNodes[i].hasChildNodes() ) {
138
+ processChildren(node.childNodes[i], state);
139
+ }
140
+ }
141
+ return true;
142
+ }
143
+ </script>
app/design/adminhtml/default/default/template/api/rolesusers.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Role Users') ?></h4>
28
+ <?php echo $this->_getGridHtml() ?>
app/design/adminhtml/default/default/template/api/user_roles_grid_js.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ <!--
29
+ <?php $myBlock = $this->getLayout()->getBlock('user.roles.grid'); ?>
30
+ <?php if( is_object($myBlock) && $myBlock->getJsObjectName()): ?>
31
+ var radioBoxes = $H({});
32
+ var warning = false;
33
+ var userRoles = $H(<?php echo $myBlock->_getSelectedRoles(true) ?>);
34
+ if (userRoles.size() > 0) warning = true;
35
+ $('user_user_roles').value = userRoles.toQueryString();
36
+
37
+ function registerUserRole(grid, element, checked){
38
+ if(checked){
39
+ userRoles.each(function(o){userRoles.remove(o[0]);});
40
+ userRoles[element.value] = 0;
41
+ } else {
42
+ userRoles.remove(element.value);
43
+ }
44
+ $('user_user_roles').value = userRoles.toQueryString();
45
+ grid.reloadParams = {'user_roles[]':userRoles.keys()};
46
+ }
47
+
48
+ function roleRowClick(grid, event){
49
+ var trElement = Event.findElement(event, 'tr');
50
+ var isInput = Event.element(event).tagName == 'INPUT';
51
+ if(trElement){
52
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
53
+ if(checkbox[0] && !checkbox[0].checked){
54
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
55
+ if (checked && warning && radioBoxes.size() > 0) {
56
+ if ( !confirm("<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?')) ?>") ) {
57
+ checkbox[0].checked = false;
58
+ for(i in radioBoxes) {
59
+ if( radioBoxes[i].status == 1) {
60
+ radioBoxes[i].object.checked = true;
61
+ }
62
+ }
63
+ return false;
64
+ }
65
+ warning = false;
66
+ }
67
+ <?php echo $myBlock->getJsObjectName() ?>.setCheckboxChecked(checkbox[0], checked);
68
+ }
69
+ }
70
+ }
71
+
72
+ function rolesRowInit(grid, row){
73
+ var checkbox = $(row).getElementsByClassName('radio')[0];
74
+ if (checkbox) {
75
+ radioBoxes[checkbox.value] = {'status' : ((checkbox.checked) ? 1 : 0), 'object' : checkbox};
76
+ }
77
+ }
78
+
79
+ <?php echo $myBlock->getJsObjectName() ?>.rowClickCallback = roleRowClick;
80
+ <?php echo $myBlock->getJsObjectName() ?>.initRowCallback = rolesRowInit;
81
+ <?php echo $myBlock->getJsObjectName() ?>.checkboxCheckCallback = registerUserRole;
82
+ <?php echo $myBlock->getJsObjectName() ?>.rows.each(function(row){rolesRowInit(<?php echo $myBlock->getJsObjectName() ?>, row)});
83
+ <?php endif; ?>
84
+ //-->
85
+ </script>
app/design/adminhtml/default/default/template/api/userinfo.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;">
31
+ <h3>
32
+ <?php if($this->getUser()->getUserId()): ?>
33
+ <?php $_userName = $this->getUser()->getFirstname() . ' ' . $this->getUser()->getLastname() ?>
34
+ <?php echo $this->__("Edit User '%s'", $_userName) ?>
35
+ <?php else: ?>
36
+ <?php echo $this->__('Add New User') ?>
37
+ <?php endif; ?>
38
+ </h3>
39
+ </td>
40
+ <td class="form-buttons">
41
+ <?php echo $this->getBackButtonHtml() ?>
42
+ <?php echo $this->getResetButtonHtml() ?>
43
+ <?php echo $this->getDeleteButtonHtml() ?>
44
+ <?php echo $this->getSaveButtonHtml() ?>
45
+ </table>
46
+ </div>
47
+ <form action="<?php echo $this->getUrl('*/*/saveuser') ?>" method="post" id="user_edit_form">
48
+ <?php echo $this->getBlockHtml('formkey')?>
49
+ </form>
50
+ <script type="text/javascript">
51
+ var userForm = new varienForm('user_edit_form');
52
+ </script>
app/design/adminhtml/default/default/template/api/usernroles.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="roles">
28
+ <li class="add"><a href="<?php echo $this->getUrl('*/*/edituser') ?>"><?php echo $this->__('Add New User') ?></a></li>
29
+ <li class="add"><a href="<?php echo $this->getUrl('*/*/editroles') ?>"><?php echo $this->__('Add New Role') ?></a></li>
30
+ </div>
31
+ <div class="clear"></div>
app/design/adminhtml/default/default/template/api/userroles.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('User Roles') ?></h4>
30
+ </div>
31
+ <fieldset id="user_roles">
32
+ <?php foreach ($roles as $role): ?>
33
+ <?php
34
+ $checked = false;
35
+ foreach( $user_roles->getItems() as $user_role )
36
+ {
37
+ if( $user_role->getParentId() == $role->getRoleId() ) {
38
+ $checked = true;
39
+ }
40
+ }
41
+ ?>
42
+ <input type="checkbox" value="<?php echo $role->getRoleId(); ?>" <?php echo ($checked ? "checked" : ""); ?> name="roles[]" id="_<?php echo $role->getRoleId(); ?>" /> <label for="_<?php echo $role->getRoleId(); ?>" class="normal"><?php echo $role->getRoleName(); ?></label><br />
43
+ <?php endforeach; ?>
44
+ </fieldset>
45
+ </div>
app/design/adminhtml/default/default/template/api/users.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3><?php echo $this->__('Users') ?></h3></td>
31
+ <td class="a-right">
32
+ <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New User') ?></span></span></span></button>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </div>
37
+ <div>
38
+ <?php echo $this->getGridHtml() ?>
39
+ </div>
40
+
app/design/adminhtml/default/default/template/api2/attribute/buttons.phtml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /** @var $this Mage_Api2_Block_Adminhtml_Attribute_Buttons */
27
+
28
+ ?>
29
+ <div class="content-header">
30
+ <table cellspacing="0">
31
+ <tr>
32
+ <td style="width:50%;">
33
+ <h3 class="icon-head head-permissions-role">
34
+ <?php echo $this->getCaption() ?>
35
+ </h3>
36
+ </td>
37
+ <td class="form-buttons">
38
+ <?php echo $this->getBackButtonHtml() ?>
39
+ <?php echo $this->getResetButtonHtml() ?>
40
+ <?php echo $this->getDeleteButtonHtml() ?>
41
+ <?php echo $this->getSaveButtonHtml() ?>
42
+ </td>
43
+ </tr>
44
+ </table>
45
+ </div>
46
+ <form action="<?php echo $this->getUrl('*/*/save') ?>" method="post" id="role_edit_form">
47
+ <?php echo $this->getBlockHtml('formkey')?>
48
+ </form>
49
+ <script type="text/javascript">
50
+ //<![CDATA[
51
+ var roleForm = new varienForm('role_edit_form');
52
+ //]]>
53
+ </script>
app/design/adminhtml/default/default/template/api2/attribute/resource.phtml ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php
29
+ /**
30
+ * @see Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource
31
+ */
32
+ ?>
33
+
34
+ <?php echo $this->getChildHtml(); ?>
35
+
36
+ <div class="entry-edit">
37
+ <div class="entry-edit-head">
38
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('User Type Resources') ?></h4>
39
+ </div>
40
+ <input type="hidden" name="resource" id="role_resources" value="" />
41
+ <fieldset id="role_resources">
42
+
43
+ <span class="field-row">
44
+ <label for="all"><?php echo $this->__('Resource Access') ?></label>
45
+ <select id="all" name="all" onchange="$('resources_container').toggle()" class="select">
46
+ <option value="0" <?php echo ($this->getEverythingAllowed()?'':'selected'); ?>><?php echo $this->__('Custom') ?></option>
47
+ <option value="1" <?php echo ($this->getEverythingAllowed()?'selected':''); ?>><?php echo $this->__('All') ?></option>
48
+ </select>
49
+ </span>
50
+
51
+ <span class="field-row" id="resources_container">
52
+ <label><?php echo $this->__('Resources') ?></label>
53
+ <div class="f-left">
54
+ <div class="tree x-tree" id="resource-tree"></div>
55
+ </div>
56
+ <?php if ($this->hasEntityOnlyAttributes()): ?>
57
+ <div class="clear"></div>
58
+ <span>* This attribute data will be returned for a single resource only.</span>
59
+ <?php endif; ?>
60
+ </span>
61
+
62
+ </fieldset>
63
+ </div>
64
+ <!-- Draw Resources Tree -->
65
+ <script type="text/javascript">
66
+ //<![CDATA[
67
+ <?php if($this->getEverythingAllowed()): ?>
68
+ $('resources_container').hide();
69
+ <?php endif; ?>
70
+ Ext.EventManager.onDocumentReady(function() {
71
+ var tree = new Ext.tree.TreePanel('resource-tree', {
72
+ animate:false,
73
+ loader: false,
74
+ enableDD:false,
75
+ containerScroll: true,
76
+ rootUIProvider: Ext.tree.CheckboxNodeUI,
77
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
78
+ rootVisible: false
79
+ });
80
+
81
+ tree.on('check', checkHandler, tree);
82
+
83
+ // set the root node
84
+ var root = new Ext.tree.TreeNode({
85
+ text: 'root',
86
+ draggable:false,
87
+ checked:'false',
88
+ id:'__root__',
89
+ uiProvider: Ext.tree.CheckboxNodeUI
90
+ });
91
+
92
+ tree.setRootNode(root);
93
+ bildResourcesTree(root, <?php echo $this->getResTreeJson() ?>);
94
+ tree.addListener('click', resourceClick.createDelegate(this));
95
+
96
+ // render the tree
97
+ tree.render();
98
+ // root.expand();
99
+ tree.expandAll();
100
+
101
+ $('role_resources').value = tree.getChecked().join(',');
102
+ });
103
+
104
+ function resourceClick(node, e){
105
+ node.getUI().check(!node.getUI().checked());
106
+ varienElementMethods.setHasChanges(Event.element(e), e);
107
+ };
108
+
109
+ function bildResourcesTree(parent, config){
110
+ if (!config) return null;
111
+
112
+ if (parent && config && config.length){
113
+ for (var i = 0; i < config.length; i++){
114
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
115
+ var node = new Ext.tree.TreeNode(config[i]);
116
+ parent.appendChild(node);
117
+ if(config[i].children){
118
+ bildResourcesTree(node, config[i].children);
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ function checkHandler(node)
125
+ {
126
+ if ( node.attributes.checked && node.parentNode ) {
127
+ var n = node.parentNode;
128
+ this.removeListener('check', checkHandler);
129
+ do {
130
+ if (!n || n.attributes.id == 'admin' || n.attributes.id == '__root__') {
131
+ break;
132
+ } else {
133
+ n.ui.check(true);
134
+ }
135
+ } while (n = n.parentNode );
136
+ this.on('check', checkHandler);
137
+ }
138
+ if ( !node.isLeaf() && node.hasChildNodes() ) {
139
+ this.removeListener('check', checkHandler);
140
+ processChildren(node, node.attributes.checked);
141
+ this.on('check', checkHandler);
142
+ }
143
+ $('role_resources').value = this.getChecked().join(',');
144
+ }
145
+
146
+ function processChildren(node, state)
147
+ {
148
+ if ( !node.hasChildNodes() ) return false;
149
+ for(var i = 0; i < node.childNodes.length; i++ ) {
150
+ node.childNodes[i].ui.check(state);
151
+ if ( node.childNodes[i].hasChildNodes() ) {
152
+ processChildren(node.childNodes[i], state);
153
+ }
154
+ }
155
+ return true;
156
+ }
157
+ //]]>
158
+ </script>
app/design/adminhtml/default/default/template/api2/permissions/user/edit/tab/roles/js.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ var activeRestRole = getActiveRestRole();
31
+
32
+ /* Retrieve current active rest role */
33
+ function getActiveRestRole() {
34
+ var role;
35
+ api2_roles_sectionJsObject.rows.each(function(row) {
36
+ var radiobox = $(row).getElementsByClassName('radio')[0];
37
+ if ('undefined' != typeof radiobox && radiobox.checked) {
38
+ role = radiobox;
39
+ }
40
+ });
41
+ return role;
42
+ }
43
+
44
+ /* Callback function for rest role row click */
45
+ function restRolesRowClick(grid, event) {
46
+ var newRestRole = getActiveRestRole();
47
+ if (newRestRole.value !== activeRestRole.value) {
48
+ if (!confirm("<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?')) ?>")) {
49
+ newRestRole.checked = !newRestRole.checked;
50
+ activeRestRole.checked = true;
51
+ } else {
52
+ activeRestRole = newRestRole;
53
+ }
54
+ }
55
+ }
56
+
57
+ api2_roles_sectionJsObject.rowClickCallback = restRolesRowClick;
58
+ //]]>
59
+ </script>
app/design/adminhtml/default/default/template/api2/role/buttons.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php /** @var $this Mage_Adminhtml_Block_Api_Tab_Roleinfo */ ?>
28
+ <div class="content-header">
29
+ <table cellspacing="0">
30
+ <tr>
31
+ <td style="width:50%;">
32
+ <h3 class="icon-head head-permissions-role">
33
+ <?php echo $this->getCaption() ?>
34
+ </h3>
35
+ </td>
36
+ <td class="form-buttons">
37
+ <?php echo $this->getBackButtonHtml() ?>
38
+ <?php echo $this->getResetButtonHtml() ?>
39
+ <?php echo $this->getDeleteButtonHtml() ?>
40
+ <?php echo $this->getSaveButtonHtml() ?>
41
+ </td>
42
+ </tr>
43
+ </table>
44
+ </div>
45
+ <form action="<?php echo $this->getUrl('*/*/save') ?>" method="post" id="role_edit_form">
46
+ <?php echo $this->getBlockHtml('formkey')?>
47
+ </form>
48
+ <script type="text/javascript">
49
+ //<![CDATA[
50
+ var roleForm = new varienForm('role_edit_form');
51
+ //]]>
52
+ </script>
app/design/adminhtml/default/default/template/api2/role/users_grid_js.phtml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ <?php
31
+ /** @var $myBlock Mage_Api2_Block_Adminhtml_Roles_Tab_Users */
32
+ $myBlock = $this->getLayout()->getBlock('adminhtml.role.edit.tab.users');
33
+ $name = $myBlock->getJsObjectName();
34
+ ?>
35
+ <?php if (is_object($myBlock) && $name && !$myBlock->isHidden()): ?>
36
+ var checkBoxes = $H(<?php echo $myBlock->getUsers(true) ?>);
37
+ var warning = false;
38
+ if (checkBoxes.size() > 0) {
39
+ warning = true;
40
+ }
41
+ $('in_role_users').value = checkBoxes.toQueryString();
42
+
43
+ function registerUserRole(grid, element, checked)
44
+ {
45
+ if (checked) {
46
+ checkBoxes.set(element.value, 0);
47
+ } else {
48
+ checkBoxes.unset(element.value);
49
+ }
50
+ $('in_role_users').value = checkBoxes.toQueryString();
51
+ grid.reloadParams = {'in_role_users[]':checkBoxes.keys()};
52
+ }
53
+
54
+ function roleUsersRowClick(grid, event)
55
+ {
56
+ var trElement = Event.findElement(event, 'tr');
57
+ var isInput = Event.element(event).tagName == 'INPUT';
58
+ if (trElement) {
59
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
60
+ if(checkbox[0]){
61
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
62
+ if (checked) {
63
+ checkbox[0].checked = true;
64
+ if ( confirm("<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?')) ?>") ) {
65
+ checkBoxes.set(checkbox[0].value, checked);
66
+ varienElementMethods.setHasChanges(checkbox[0]);
67
+ } else {
68
+ checkbox[0].checked = false;
69
+ }
70
+ warning = false;
71
+ } else {
72
+ checkBoxes.unset(checkbox[0].value);
73
+ }
74
+
75
+ $('in_role_users').value = checkBoxes.toQueryString();
76
+ grid.reloadParams = {'in_role_user[]':checkBoxes.keys()};
77
+ }
78
+ }
79
+ }
80
+
81
+ function roleUsersRowInit(grid, row)
82
+ {
83
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
84
+ if (checkbox) {
85
+ if (checkbox.checked) {
86
+ checkBoxes.set(checkbox.value, checkbox.checked);
87
+ } else {
88
+ checkBoxes.unset(checkbox.value);
89
+ }
90
+
91
+ $('in_role_users').value = checkBoxes.toQueryString();
92
+ grid.reloadParams = {'in_role_user[]':checkBoxes.keys()};
93
+ }
94
+ }
95
+
96
+ function myhandler(o)
97
+ {
98
+ if (checkBoxes.size() > 0) {
99
+ if (!confirm("<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?')) ?>") ) {
100
+ o.checked = !o.checked;
101
+ } else {
102
+ checkBoxes.each(function(el){
103
+ el.checked = o.checked;
104
+ });
105
+ return false;
106
+ }
107
+ warning = false;
108
+ }
109
+
110
+ $('in_role_users').value = checkBoxes.toQueryString();
111
+ //grid.reloadParams = {'in_role_user[]':checkBoxes.keys()};
112
+ }
113
+
114
+ <?php echo $name ?>.rowClickCallback = roleUsersRowClick;
115
+ <?php echo $name ?>.initRowCallback = roleUsersRowInit;
116
+ <?php echo $name ?>.checkboxCheckCallback = registerUserRole;
117
+ <?php echo $name ?>.checkCheckboxes = myhandler;
118
+ <?php echo $name ?>.rows.each(function(row){roleUsersRowInit(<?php echo $name ?>, row)});
119
+ $('in_role_users_old').value = $('in_role_users').value;
120
+ <?php endif; ?>
121
+ //]]>
122
+ </script>
app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
28
+ * @var $this Mage_Authorizenet_Block_Directpost_Iframe
29
+ */
30
+ ?>
31
+ <?php
32
+ $_params = $this->getParams();
33
+ /* @var $_helper Mage_Authorizenet_Helper_Data */
34
+ $_helper = $this->helper('authorizenet');
35
+ ?>
36
+ <html>
37
+ <head>
38
+ <script type="text/javascript">
39
+ //<![CDATA[
40
+ <?php if (isset($_params['redirect'])): ?>
41
+ window.location="<?php echo $this->escapeUrl($_params['redirect']) ?>";
42
+ <?php endif; ?>
43
+ <?php if (isset($_params['redirect_parent'])): ?>
44
+ window.top.location="<?php echo $this->escapeUrl($_params['redirect_parent']) ?>";
45
+ <?php endif; ?>
46
+ <?php if (isset($_params['error_msg'])): ?>
47
+ window.top.directPostModel.showError(<?php echo $this->helper('core')->jsonEncode($_params['error_msg']) ?>);
48
+ <?php if (isset($_params['x_invoice_num'])): ?>
49
+ window.top.directPostModel.successUrl="<?php echo $_helper->getSuccessOrderUrl($_params) ?>";
50
+ <?php endif; ?>
51
+ <?php endif; ?>
52
+ //]]>
53
+ </script>
54
+ </head>
55
+ <body></body>
56
+ </html>
app/design/adminhtml/default/default/template/authorizenet/directpost/info.phtml ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /**
28
+ * @see Mage_Authorizenet_Block_Directpost_Form
29
+ */
30
+ ?>
31
+ <?php
32
+ $_form = $this;
33
+ $_code = $_form->getMethodCode();
34
+ $_method = $_form->getMethod();
35
+ $_controller = $this->helper('authorizenet')->getControllerName();
36
+ $_orderUrl = $this->helper('authorizenet')->getPlaceOrderAdminUrl();
37
+ ?>
38
+ <!-- IFRAME for request to our server -->
39
+ <iframe id="order-directpost-iframe" allowtransparency="true" frameborder="0" name="iframeSubmitOrder" style="display:none;width:100%;background-color:transparent" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
40
+ <!-- IFRAME for request to Authorize.net -->
41
+ <iframe id="directpost-iframe" allowtransparency="true" frameborder="0" name="iframeDirectPost" style="display:none;width:100%;background-color:transparent" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
42
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
43
+ <li>
44
+ <div class="input-box">
45
+ <label for="<?php echo $_code ?>_cc_type"><?php echo Mage::helper('payment')->__('Credit Card Type') ?> <span class="required">*</span></label><br/>
46
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
47
+ <?php $_ccType = $_form->getInfoData('cc_type') ?>
48
+ <option value=""></option>
49
+ <?php foreach ($_form->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
50
+ <option value="<?php echo $_typeCode ?>" <?php if($_typeCode==$_ccType): ?>selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
51
+ <?php endforeach ?>
52
+ </select>
53
+ </div>
54
+ </li>
55
+ <li>
56
+ <div class="input-box">
57
+ <label for="<?php echo $_code ?>_cc_number"><?php echo Mage::helper('payment')->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
58
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('payment')->__('Credit Card Number')) ?>" class="input-text validate-cc-number" value="<?php echo $this->getInfoData('cc_number')?>" />
59
+ </div>
60
+ </li>
61
+ <li>
62
+ <div class="input-box">
63
+ <label for="<?php echo $_code ?>_expiration"><?php echo Mage::helper('payment')->__('Expiration Date') ?> <span class="required">*</span></label><br/>
64
+ <select id="<?php echo $_code ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="validate-cc-exp required-entry">
65
+ <?php $_ccExpMonth = $_form->getInfoData('cc_exp_month') ?>
66
+ <?php foreach ($_form->getCcMonths() as $k=>$v): ?>
67
+ <option value="<?php echo $k ?>" <?php if($k==$_ccExpMonth): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
68
+ <?php endforeach ?>
69
+ </select>
70
+ <?php $_ccExpYear = $_form->getInfoData('cc_exp_year') ?>
71
+ <select id="<?php echo $_code ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
72
+ <?php foreach ($_form->getCcYears() as $k=>$v): ?>
73
+ <option value="<?php echo $k ? $k : '' ?>" <?php if($k==$_ccExpYear): ?>selected="selected"<?php endif ?>><?php echo $v ?></option>
74
+ <?php endforeach ?>
75
+ </select>
76
+ </div>
77
+ </li>
78
+ <?php if($_form->hasVerification()): ?>
79
+ <li>
80
+ <div class="input-box">
81
+ <label for="<?php echo $_code ?>_cc_cid"><?php echo Mage::helper('payment')->__('Card Verification Number') ?> <span class="required">*</span></label><br/>
82
+ <input type="text" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('payment')->__('Card Verification Number')) ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value="<?php echo $this->getInfoData('cc_cid')?>" />
83
+ </div>
84
+ </li>
85
+ <?php endif; ?>
86
+ </ul>
87
+ <script type="text/javascript">
88
+ //<![CDATA[
89
+ /**
90
+ * Disable cart server validation in admin
91
+ */
92
+ AdminOrder.prototype.prepareParams = function(params) {
93
+ if (!params) {
94
+ params = {};
95
+ }
96
+ if (!params.customer_id) {
97
+ params.customer_id = this.customerId;
98
+ }
99
+ if (!params.store_id) {
100
+ params.store_id = this.storeId;
101
+ }
102
+ if (!params.currency_id) {
103
+ params.currency_id = this.currencyId;
104
+ }
105
+ if (!params.form_key) {
106
+ params.form_key = FORM_KEY;
107
+ }
108
+
109
+ if (this.paymentMethod != '<?php echo $_code ?>') {
110
+ var data = this.serializeData('order-billing_method');
111
+ if (data) {
112
+ data.each(function(value) {
113
+ params[value[0]] = value[1];
114
+ });
115
+ }
116
+ } else {
117
+ params['payment[method]'] = '<?php echo $_code ?>';
118
+ }
119
+ return params;
120
+ };
121
+ AdminOrder.prototype.getPaymentData = function(currentMethod) {
122
+ if (typeof (currentMethod) == 'undefined') {
123
+ if (this.paymentMethod) {
124
+ currentMethod = this.paymentMethod;
125
+ } else {
126
+ return false;
127
+ }
128
+ }
129
+ if (currentMethod == '<?php echo $_code ?>') {
130
+ return false;
131
+ }
132
+ var data = {};
133
+ var fields = $('payment_form_' + currentMethod).select('input', 'select');
134
+ for ( var i = 0; i < fields.length; i++) {
135
+ data[fields[i].name] = fields[i].getValue();
136
+ }
137
+ if ((typeof data['payment[cc_type]']) != 'undefined'
138
+ && (!data['payment[cc_type]'] || !data['payment[cc_number]'])) {
139
+ return false;
140
+ }
141
+ return data;
142
+ };
143
+ <?php if (!$this->isAjaxRequest()): ?>
144
+ document.observe('dom:loaded', function(){
145
+ <?php endif; ?>
146
+ directPostModel = new directPost(
147
+ '<?php echo $_code ?>',
148
+ 'directpost-iframe',
149
+ '<?php echo $_controller ?>',
150
+ '<?php echo $_orderUrl ?>',
151
+ '<?php echo $_method->getCgiUrl() ?>',
152
+ '<?php echo $this->getUrl('*/*/save', array('_secure' => $this->getRequest()->isSecure())) ?>');
153
+ <?php if (!$this->isAjaxRequest()): ?>
154
+ });
155
+ <?php endif; ?>
156
+ //]]>
157
+ </script>
app/design/adminhtml/default/default/template/backup/dialogs.phtml ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="backup-dialog" style="display: none;" id="rollback-warning">
28
+ <div class="entry-edit">
29
+ <div class="entry-edit-head">
30
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4>
31
+ </div>
32
+ <div class="content">
33
+ <div><?php echo $this->__('Any data created since the backup was made will be lost including admin users, customers and orders.')?></div>
34
+ <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div>
35
+ </div>
36
+ <div class="buttons-set">
37
+ <div class="f-right">
38
+ <button type="button" class="scalable " onclick="backup.requestPassword()"><span><?php echo $this->__('OK')?></span></button>
39
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="backup-dialog" style="display: none;" id="backup-warning">
46
+ <div class="entry-edit">
47
+ <div class="entry-edit-head">
48
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4>
49
+ </div>
50
+ <div class="content">
51
+ <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div>
52
+ <div><?php echo $this->__("The backup's creation process will take time.")?></div>
53
+ <div><?php echo $this->__('You will need to wait when the action ends.')?></div>
54
+ <div><?php echo $this->__('Do you really want to proceed?')?></div>
55
+ </div>
56
+ <div class="buttons-set">
57
+ <div class="f-right">
58
+ <button type="button" class="scalable " onclick="backup.requestBackupOptions()"><span><?php echo $this->__('OK')?></span></button>
59
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+
65
+ <div class="backup-dialog" style="display: none;" id="backup-options">
66
+ <div class="entry-edit">
67
+ <div class="entry-edit-head">
68
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Backup options') ?></h4>
69
+ </div>
70
+ <div class="content">
71
+ <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div>
72
+ <div><?php echo $this->__('Please specify backup creation options')?></div>
73
+ <form action="" method="post" id="backup-form" onsubmit="return backup.submitBackup();">
74
+ <table class="form-list question" cellspacing="0">
75
+ <tr>
76
+ <td style="padding-right: 8px;"><label for="backup_name" class="nobr"><?php echo $this->__('Backup Name')?></label></td>
77
+ <td>
78
+ <input type="text" name="backup_name" id="backup_name" class="validate-alphanum-with-spaces validate-length maximum-length-50" style="width: 343px" maxlength="50" />
79
+ <p class="note"><span><?php echo $this->__('Please use only letters (a-z or A-Z), numbers (0-9) or spaces in this field.'); ?></span></p>
80
+ </td>
81
+ </tr>
82
+ <tr>
83
+ <td>&nbsp;</td>
84
+ <td class="maintenance-checkbox-container">
85
+ <input type="checkbox" name="maintenance_mode" value="1" id="backup_maintenance_mode"/>
86
+ <label for="backup_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while backup creation')?></label>
87
+ </td>
88
+ </tr>
89
+ <tr id="exclude-media-checkbox-container" style="display: none;">
90
+ <td>&nbsp;</td>
91
+ <td>
92
+ <input type="checkbox" name="exclude_media" value="1" id="exclude_media"/>
93
+ <label for="exclude_media"><?php echo $this->__('Exclude media folder from backup')?></label>
94
+ </td>
95
+ </tr>
96
+ </table>
97
+ </form>
98
+ </div>
99
+ <div class="buttons-set">
100
+ <div class="f-right">
101
+ <button type="button" class="scalable " onclick="backup.submitBackup()"><span><?php echo $this->__('OK')?></span></button>
102
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ </div>
107
+
108
+ <div class="backup-dialog" style="display: none;" id="rollback-request-password">
109
+ <div class="entry-edit">
110
+ <div class="entry-edit-head">
111
+ <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Please enter password') ?></h4>
112
+ </div>
113
+ <div class="content">
114
+ <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div>
115
+ <div><?php echo $this->__('Please enter password to confirm rollback.')?></div>
116
+ <div><?php echo $this->__('This action cannot be undone.')?></div>
117
+ <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div>
118
+ <form action="" method="post" id="rollback-form" onsubmit="return backup.submitRollback();">
119
+ <div class="password-box-container">
120
+ <table class="form-list" cellspacing="0">
121
+ <tr>
122
+ <td style="padding-right: 8px;"><label for="password" class="nobr"><?php echo $this->__('User Password')?> <span class="required">*</span></label></td>
123
+ <td><input type="password" name="password" id="password" class="required-entry"></td>
124
+ </tr>
125
+ <tr>
126
+ <td>&nbsp;</td>
127
+ <td class="maintenance-checkbox-container">
128
+ <input type="checkbox" name="maintenance_mode" value="1" id="rollback_maintenance_mode"/>
129
+ <label for="rollback_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while rollback processing')?></label>
130
+ </td>
131
+ </tr>
132
+ <tr id="use-ftp-checkbox-row" style="display: none;">
133
+ <td>&nbsp;</td>
134
+ <td><input type="checkbox" name="use_ftp" value="1" id="use_ftp" onClick="backup.toggleFtpCredentialsForm();"/> <label for="use_ftp"><?php echo $this->__('Use FTP Connection')?></label></td>
135
+ </tr>
136
+ </table>
137
+ </div>
138
+ <div class="entry-edit" id="ftp-credentials-container" style="display: none;">
139
+ <div class="entry-edit-head">
140
+ <h4 class=""><?php echo $this->__('FTP credentials')?></h4>
141
+ </div>
142
+ <fieldset>
143
+ <table class="form-list" cellspacing="0">
144
+ <tr>
145
+ <td class="label"><label for="ftp_host"><?php echo $this->__('FTP Host')?> <span class="required">*</span></label></td>
146
+ <td class="value"><input type="text" name="ftp_host" id="ftp_host"></td>
147
+ </tr>
148
+ <tr>
149
+ <td class="label"><label for="ftp_user"><?php echo $this->__('FTP Login')?> <span class="required">*</span></label></td>
150
+ <td class="value"><input type="text" name="ftp_user" id="ftp_user"></td>
151
+ </tr>
152
+ <tr>
153
+ <td class="label"><label for="ftp_pass"><?php echo $this->__('FTP Password')?> <span class="required">*</span></label></td>
154
+ <td class="value"><input type="password" name="ftp_pass" id="ftp_pass"></td>
155
+ </tr>
156
+ <tr>
157
+ <td class="label"><label for="ftp_path"><?php echo $this->__('Magento root directory')?></label></td>
158
+ <td class="value"><input type="text" name="ftp_path" id="ftp_path"></td>
159
+ </tr>
160
+ </table>
161
+ </fieldset>
162
+ </div>
163
+ </form>
164
+ </div>
165
+ <div class="buttons-set">
166
+ <div class="f-right">
167
+ <button type="button" class="scalable " onclick="backup.submitRollback()"><span><?php echo $this->__('OK')?></span></button>
168
+ <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ </div>
173
+
174
+ <div id="popup-window-mask" style="display: none;"></div>
175
+
176
+ <?php
177
+ $helper = Mage::helper('backup');
178
+ $rollbackUrl = $this->getUrl('*/*/rollback');
179
+ $backupUrl = $this->getUrl('*/*/create');
180
+ ?>
181
+
182
+ <script type="text/javascript">
183
+ //<![CDATA[
184
+ document.observe('dom:loaded', function () {
185
+ backup = new AdminBackup();
186
+ backup.rollbackUrl = '<?php echo $helper->jsQuoteEscape($rollbackUrl);?>';
187
+ backup.backupUrl = '<?php echo $helper->jsQuoteEscape($backupUrl);?>';
188
+ });
189
+ //]]>
190
+ </script>
app/design/adminhtml/default/default/template/backup/left.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <h3><?php echo Mage::helper('backup')->__('Create Backup') ?></h3>
app/design/adminhtml/default/default/template/backup/list.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-backups-control"><?php echo Mage::helper('backup')->__('Backups') ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getCreateSnapshotButtonHtml(); ?>
33
+ <?php echo $this->getCreateMediaBackupButtonHtml(); ?>
34
+ <?php echo $this->getCreateButtonHtml(); ?>
35
+ </td>
36
+ </tr>
37
+ </table>
38
+ </div>
39
+ <?php echo $this->getGridHtml() ?>
40
+ <?php echo $this->getDialogsHtml() ?>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Bundle */ ?>
29
+ <?php $options = Mage::helper('core')->decorateArray($this->getOptions()); ?>
30
+ <?php if (count($options)): ?>
31
+ <div id="catalog_product_composite_configure_fields_bundle" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
32
+ <h4><?php echo Mage::helper('catalog')->__('Bundle Items') ?></h4>
33
+ <div class="product-options">
34
+ <dl>
35
+ <?php foreach ($options as $option) : ?>
36
+ <?php if ($option->getSelections()) : ?>
37
+ <?php echo $this->getOptionHtml($option); ?>
38
+ <?php endif; ?>
39
+ <?php endforeach; ?>
40
+ </dl>
41
+ </div>
42
+ </div>
43
+
44
+ <script>
45
+ var BundleControl = Class.create();
46
+ BundleControl.prototype = {
47
+ initialize: function (config) {
48
+ this.config = config;
49
+ },
50
+
51
+ changeSelection: function (selection) {
52
+ if (selection.multiple) {
53
+ return;
54
+ }
55
+ var parts = selection.id.split('-'), optionId = parts[2],
56
+ showQtyInput = selection.value && selection.value != 'none',
57
+ options = this.config.options[optionId],
58
+ selectionOptions = options && options.selections && options.selections[selection.value] || {};
59
+
60
+ selectionOptions.can_change_qty = Number(selectionOptions.can_change_qty) && showQtyInput;
61
+ this.updateQtyInput(optionId, selectionOptions);
62
+ },
63
+
64
+ updateQtyInput: function(optionId, selectionOptions) {
65
+ var elem = $('bundle-option-' + optionId + '-qty-input'),
66
+ default_qty = Number(selectionOptions.default_qty);
67
+ if (!elem) {
68
+ return;
69
+ }
70
+ if (selectionOptions.can_change_qty) {
71
+ elem.removeClassName('qty-disabled');
72
+ elem.disabled = false;
73
+ if (elem.value == '0') {
74
+ elem.value = default_qty || 1;
75
+ }
76
+ } else {
77
+ elem.addClassName('qty-disabled');
78
+ elem.disabled = true;
79
+ elem.value = default_qty || 0;
80
+ }
81
+ },
82
+
83
+ updateForDefaults: function () {
84
+ for (var optionId in this.config.options) {
85
+ var selection = $('bundle-option-' + optionId);
86
+ if (selection) {
87
+ this.changeSelection(selection);
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ProductConfigure.bundleControl = new BundleControl(<?php echo $this->getJsonConfig() ?>);
93
+ </script>
94
+
95
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/checkbox.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Checkbox */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
32
+ <dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
33
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
34
+ <div class="input-box">
35
+ <?php if (count($_selections) == 1 && $_option->getRequired()): ?>
36
+ <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
37
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"'/>
38
+ <?php else:?>
39
+ <ul class="options-list">
40
+ <?php foreach($_selections as $_selection): ?>
41
+ <li><input class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" type="checkbox" name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>"/>
42
+ <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection) ?></label></span>
43
+ <?php if($_option->getRequired()): ?>
44
+ <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
45
+ <?php endif; ?>
46
+ </li>
47
+ <?php endforeach; ?>
48
+ </ul>
49
+ <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
50
+ <?php endif; ?>
51
+ </div>
52
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/multi.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Multi */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
32
+ <dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
33
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
34
+ <div class="input-box">
35
+ <?php if (count($_selections) == 1 && $_option->getRequired()): ?>
36
+ <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
37
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/>
38
+ <?php else: ?>
39
+ <select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>][]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select multiselect change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)">
40
+ <?php if(!$_option->getRequired()): ?>
41
+ <option value=""><?php echo $this->__('None') ?></option>
42
+ <?php endif; ?>
43
+ <?php foreach ($_selections as $_selection): ?>
44
+ <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection, false) ?></option>
45
+ <?php endforeach; ?>
46
+ </select>
47
+ <?php endif; ?>
48
+ </div>
49
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/radio.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Radio */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_default = $_option->getDefaultSelection(); ?>
32
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
33
+ <?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
34
+
35
+ <dt>
36
+ <span class="qty-holder">
37
+ <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;</label><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
38
+ </span>
39
+ <label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
40
+ </dt>
41
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
42
+ <div class="input-box">
43
+ <?php if ($this->_showSingle()): ?>
44
+ <?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
45
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" />
46
+ <?php else:?>
47
+ <ul class="options-list">
48
+ <?php if (!$_option->getRequired()): ?>
49
+ <li><input type="radio" class="radio" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable())?'':' checked="checked" ' ?> value="" onclick="ProductConfigure.bundleControl.changeSelection(this)"/>
50
+ <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>"><?php echo $this->__('None') ?></label></span>
51
+ </li>
52
+ <?php endif; ?>
53
+ <?php foreach ($_selections as $_selection): ?>
54
+ <li><input type="radio" class="radio<?php echo $_option->getRequired()?' validate-one-required-by-name':'' ?> change-container-classname" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?>value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"/>
55
+ <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionTitlePrice($_selection) ?></label></span>
56
+ <?php if ($_option->getRequired()): ?>
57
+ <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
58
+ <?php endif; ?>
59
+ </li>
60
+ <?php endforeach; ?>
61
+ </ul>
62
+ <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
63
+ <?php endif; ?>
64
+ </div>
65
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/type/select.phtml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
28
+ <?php /* @var $this Mage_Bundle_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Options_Type_Select */ ?>
29
+ <?php $_option = $this->getOption(); ?>
30
+ <?php $_selections = $_option->getSelections(); ?>
31
+ <?php $_default = $_option->getDefaultSelection(); ?>
32
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
33
+ <?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
34
+
35
+ <dt>
36
+ <span class="qty-holder">
37
+ <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;</label><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
38
+ </span>
39
+ <label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
40
+ </dt>
41
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
42
+ <div class="input-box">
43
+ <?php if ($this->_showSingle()): ?>
44
+ <?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
45
+ <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/>
46
+ <?php else:?>
47
+ <select id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)">
48
+ <option value=""><?php echo $this->__('Choose a selection...') ?></option>
49
+ <?php foreach ($_selections as $_selection): ?>
50
+ <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option>
51
+ <?php endforeach; ?>
52
+ </select>
53
+ <?php endif; ?>
54
+ </div>
55
+ </dd>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ if(typeof Bundle=='undefined') {
29
+ Bundle = {};
30
+ }
31
+ </script>
32
+
33
+ <div class="entry-edit">
34
+ <div class="entry-edit-head">
35
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('bundle')->__('Shipment') ?></h4>
36
+ </div>
37
+ <fieldset>
38
+ <table cellspacing="0" class="form-list">
39
+ <tr>
40
+ <td class="label"><label for="shipment_type"><?php echo Mage::helper('bundle')->__('Ship Bundle Items') ?></label></td>
41
+ <td class="value"><select <?php if ($this->isReadonly()): ?>disabled="disabled" <?php endif;?>id="shipment_type" name="<?php echo $this->getFieldSuffix() ?>[shipment_type]" class="select">
42
+ <option value="1"><?php echo Mage::helper('bundle')->__('Separately') ?></option>
43
+ <option value="0"<?php if ($this->getProduct()->getShipmentType() == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('bundle')->__('Together') ?></option>
44
+ </select>
45
+ </td>
46
+ </tr>
47
+ </table>
48
+ </fieldset>
49
+ </div>
50
+
51
+ <div class="entry-edit custom-options bundle" id="product_bundle_container">
52
+ <div class="entry-edit-head">
53
+ <h4><?php echo $this->__('Bundle Items') ?></h4>
54
+ <div class="right"><?php echo $this->getAddButtonHtml() ?></div>
55
+ </div>
56
+
57
+ <div id="product_options_container" class="box">
58
+ <div id="product_bundle_container_top"></div>
59
+ <?php echo $this->getOptionsBoxHtml() ?>
60
+ </div>
61
+ </div>
62
+
63
+ <script type="text/javascript">
64
+ // re-bind form elements onchange
65
+ varienWindowOnload(true);
66
+ <?php if ($this->isReadonly()):?>
67
+ $('product_bundle_container').select('input', 'select', 'textarea', 'button').each(function(input){
68
+ input.disabled = true;
69
+ if (input.tagName.toLowerCase() == 'button') {
70
+ input.addClassName('disabled');
71
+ }
72
+ });
73
+ <?php endif; ?>
74
+ Validation.add('validate-greater-zero-based-on-option', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Please enter a number greater 0 in this field.')) ?>', function(v, el) {
75
+ var optionType = $(el).up('div.grid').previous('table.option-header').select('select.select-product-option-type')[0],
76
+ v = Number(v) || 0;
77
+
78
+ if (optionType && (optionType.value == 'checkbox' || optionType.value == 'multi') && v <= 0) {
79
+ return false;
80
+ }
81
+ return true;
82
+ });
83
+ </script>
84
+
85
+ <div><input type="hidden" name="affect_bundle_product_selections" value="1" /></div>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option.phtml ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
29
+ '<div class="option-title"> ' +
30
+ '<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default Title')) ?> <span class="required">*</span></label>' +
31
+ <?php if ($this->isDefaultStore()): ?>
32
+ '<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
33
+ <?php else: ?>
34
+ '<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
35
+ <?php endif; ?>
36
+ '<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
37
+ '</div>' +
38
+ '<table class="option-header" cellpadding="0" cellspacing="0">' +
39
+ '<thead>' +
40
+ '<tr>' +
41
+ <?php if (!$this->isDefaultStore()): ?>
42
+ '<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Store View Title')) ?> <span class="required">*</span></th>' +
43
+ <?php endif; ?>
44
+ '<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Input Type')) ?></th>' +
45
+ '<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
46
+ '<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
47
+ '<th>&nbsp;</th>' +
48
+ '</tr>' +
49
+ '</thead>' +
50
+ '<tbody>' +
51
+ '<tr>' +
52
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{index}}][option_id]" value="{{option_id}}">' +
53
+ '<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
54
+ <?php if (!$this->isDefaultStore()): ?>
55
+ '<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
56
+ <?php endif; ?>
57
+ '<td><?php echo $this->getTypeSelectHtml() ?></td>' +
58
+ '<td><?php echo $this->getRequireSelectHtml() ?></td>' +
59
+ '<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
60
+ '<td>&nbsp;<?php echo $this->jsQuoteEscape($this->getAddSelectionButtonHtml()) ?></td>' +
61
+ '</tr>' +
62
+ '</tbody>' +
63
+ '</table>' +
64
+ '<div id="<?php echo $this->getFieldId() ?>_search_{{index}}">' +
65
+ '</div>' +
66
+ '</div>';
67
+ </script>
68
+
69
+ <?php echo $this->getSelectionHtml() ?>
70
+
71
+ <script type="text/javascript">
72
+
73
+ function changeInputType(oldObject, oType) {
74
+ var newObject = document.createElement('input');
75
+ newObject.type = oType;
76
+ if(oldObject.size) newObject.size = oldObject.size;
77
+ if(oldObject.value) newObject.value = oldObject.value;
78
+ if(oldObject.name) newObject.name = oldObject.name;
79
+ if(oldObject.id) newObject.id = oldObject.id;
80
+ if(oldObject.onclick) newObject.onclick = oldObject.onclick;
81
+ if(oldObject.className) newObject.className = oldObject.className;
82
+ oldObject.parentNode.replaceChild(newObject,oldObject);
83
+ return newObject;
84
+ }
85
+
86
+ Bundle.Option = Class.create();
87
+ Bundle.Option.prototype = {
88
+ idLabel : '<?php echo $this->getFieldId() ?>',
89
+ top : '',
90
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
91
+ templateText : '',
92
+ itemsCount : 0,
93
+ initialize : function(template) {
94
+ this.templateText = template;
95
+ this.top = $('product_bundle_container_top');
96
+ },
97
+
98
+ add : function(data) {
99
+ if(!data){
100
+ data = {};
101
+ this.top = $('product_bundle_container_top');
102
+ } else {
103
+ data.title = data.title.replace('"', "&quot;");
104
+ }
105
+
106
+ data.index = this.itemsCount++;
107
+
108
+ this.template = new Template(this.templateText, this.templateSyntax);
109
+
110
+ Element.insert(this.top, {'after':this.template.evaluate(data)});
111
+
112
+ this.top = $(this.idLabel + '_' + data.index);
113
+
114
+ //set selected type
115
+ if (data.type) {
116
+ $A($(this.idLabel + '_'+data.index+'_type').options).each(function(option){
117
+ if (option.value==data.type) option.selected = true;
118
+ });
119
+ }
120
+
121
+ //set selected is_require
122
+ if (data.required) {
123
+ $A($(this.idLabel + '_'+data.index+'_required').options).each(function(option){
124
+ if (option.value==data.required) option.selected = true;
125
+ });
126
+ }
127
+ // rebind change notifications
128
+ varienWindowOnload(true);
129
+
130
+ return data.index;
131
+ },
132
+
133
+ remove : function(event){
134
+ var element = $(Event.findElement(event, 'div')).parentNode;
135
+ if(element){
136
+ Element.select(element, '.delete').each(function(elem){elem.value='1'});
137
+ Element.select(element, ['input', 'select']).each(function(elem){elem.hide(); elem.className = '';});
138
+ Element.hide(element);
139
+ }
140
+ },
141
+
142
+ changeType : function(event) {
143
+ var element = Event.element(event);
144
+ parts = element.id.split('_');
145
+ i = parts[2];
146
+ if (element.value == 'multi' || element.value == 'checkbox') {
147
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' tr.selection input.default'));
148
+ inputs.each(
149
+ function(elem){
150
+ //elem.type = "checkbox";
151
+ changeInputType(elem, 'checkbox');
152
+ }
153
+ );
154
+ /**
155
+ * Hide not needed elements (user defined qty select box)
156
+ */
157
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' .qty-box'));
158
+ inputs.each(
159
+ function(elem){
160
+ elem.hide();
161
+ }
162
+ );
163
+
164
+ } else {
165
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' tr.selection input.default'));
166
+ have = false;
167
+ for (j=0; j< inputs.length; j++) {
168
+ //inputs[j].type = "radio";
169
+ changeInputType(inputs[j], 'radio');
170
+ if (inputs[j].checked && have) {
171
+ inputs[j].checked = false;
172
+ } else {
173
+ have = true;
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Show user defined select box
179
+ */
180
+ inputs = $A($$('#' + bSelection.idLabel + '_box_' + i + ' .qty-box'));
181
+ inputs.each(
182
+ function(elem){
183
+ elem.show();
184
+ }
185
+ );
186
+ }
187
+ },
188
+
189
+ priceTypeFixed : function() {
190
+ inputs = $A($$('.price-type-box'));
191
+ inputs.each(
192
+ function(elem){
193
+ elem.show();
194
+ }
195
+ );
196
+ },
197
+
198
+ priceTypeDynamic : function() {
199
+ inputs = $A($$('.price-type-box'));
200
+ inputs.each(
201
+ function(elem){
202
+ elem.hide();
203
+ }
204
+ );
205
+ }
206
+ }
207
+
208
+ var optionIndex = 0;
209
+ bOption = new Bundle.Option(optionTemplate);
210
+ //adding data to templates
211
+ <?php foreach ($this->getOptions() as $_option): ?>
212
+ optionIndex = bOption.add(<?php echo $_option->toJson() ?>);
213
+ <?php if ($_option->getSelections()):?>
214
+ <?php foreach ($_option->getSelections() as $_selection): ?>
215
+ <?php $_selection->setName($this->escapeHtml($_selection->getName())); ?>
216
+ bSelection.addRow(optionIndex, <?php echo $_selection->toJson() ?>);
217
+ <?php endforeach; ?>
218
+ <?php endif; ?>
219
+ <?php endforeach; ?>
220
+ /**
221
+ * Adding event on price type select box of product to hide or show prices for selections
222
+ */
223
+ function togglePriceType() {
224
+ if ($('price_type').value == '1') {
225
+ bOption.priceTypeFixed();
226
+ } else {
227
+ bOption.priceTypeDynamic();
228
+ }
229
+ }
230
+
231
+ togglePriceType();
232
+
233
+ Event.observe('price_type', 'change', togglePriceType);
234
+
235
+ </script>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/search.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <div style="float: right;"><?php echo $this->getButtonsHtml() ?></div>
30
+ <h4 class="fieldset-legend <?php echo ($this->getHeaderCssClass()) ? $this->getHeaderCssClass().' icon-head' : '' ?>"><?php echo $this->getHeaderText() ?></h4>
31
+ </div>
32
+ <fieldset>
33
+ <?php echo $this->getChildHtml() ?>
34
+ </fieldset>
35
+ </div>
app/design/adminhtml/default/default/template/bundle/product/edit/bundle/option/selection.phtml ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+
30
+ var bundleTemplateBox = '<table class="border" cellpadding="0" cellspacing="0">' +
31
+ ' <thead>' +
32
+ ' <tr class="headings">' +
33
+ ' <th><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Name')) ?></th>' +
34
+ <?php if ($this->getCanReadPrice() !== false) : ?>
35
+ ' <th class="type-price price-type-box"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Price')) ?></th>' +
36
+ ' <th class="type-type price-type-box"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Price Type')) ?></th>' +
37
+ <?php endif; ?>
38
+ ' <th class="type-price"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default Qty')) ?></th>' +
39
+ ' <th class="type-uqty qty-box"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('User Defined Qty')) ?></th>' +
40
+ ' <th class="type-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
41
+ ' <th style="width:1px"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Default')) ?></th>' +
42
+ ' <th class="last">&nbsp;</th>' +
43
+ ' </tr>' +
44
+ ' </thead> ' +
45
+ ' <tbody>' +
46
+ ' </tbody>' +
47
+ '</table>';
48
+
49
+ var bundleTemplateRow ='<td>' +
50
+ ' <input type="hidden" id="<?php echo $this->getFieldId() ?>_id_{{index}}" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][selection_id]" value="{{selection_id}}">' +
51
+ ' <input type="hidden" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][option_id]" value="{{option_id}}">' +
52
+ ' <input type="hidden" class="product" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][product_id]" value="{{product_id}}">' +
53
+ ' <input type="hidden" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][delete]" value="" class="delete">' +
54
+ ' {{name}}<br />' +
55
+ ' <div class="nobr">' +
56
+ ' <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> {{sku}}' +
57
+ ' </div>' +
58
+ '</td>' +
59
+ <?php if ($this->getCanReadPrice() !== false) : ?>
60
+ '<td class="price-type-box"><input id="<?php echo $this->getFieldId() ?>_{{index}}_price_value" class="input-text required-entry validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][selection_price_value]" value="{{selection_price_value}}"<?php if($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' +
61
+ '<td class="price-type-box"><?php echo $this->getPriceTypeSelectHtml() ?><div><?php echo $this->getCheckboxScopeHtml() ?></div></td>' +
62
+ <?php else : ?>
63
+ '<input type="hidden" id="<?php echo $this->getFieldId(); ?>_{{index}}_price_value" name="<?php echo $this->getFieldName(); ?>[{{parentIndex}}][{{index}}][selection_price_value]" value="0" />' +
64
+ '<input type="hidden" id="<?php echo $this->getFieldId(); ?>_{{index}}_price_type" name="<?php echo $this->getFieldName(); ?>[{{parentIndex}}][{{index}}][selection_price_type]" value="0" />' +
65
+ <?php if ($this->isUsedWebsitePrice()): ?>
66
+ '<input type="hidden" id="<?php echo $this->getFieldId(); ?>_{{index}}_price_scope" name="<?php echo $this->getFieldName(); ?>[{{parentIndex}}][{{index}}][default_price_scope]" value="1" />' +
67
+ <?php endif; ?>
68
+ <?php endif; ?>
69
+ '<td><input class="input-text required-entry validate-greater-zero-based-on-option validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][selection_qty]" value="{{selection_qty}}"></td>' +
70
+ '<td class="qty-box"><?php echo $this->getQtyTypeSelectHtml() ?></td>' +
71
+ '<td><input class="input-text required-entry validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][position]" value="{{position}}"></td>' +
72
+ '<td class="a-center"><input onclick="bSelection.checkGroup(event)" type="{{option_type}}" class="default" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][is_default]" value="1" {{checked}}></td>' +
73
+ '<td class="last"><span title="Delete Row"><?php echo $this->getSelectionDeleteButtonHtml() ?></span></td>';
74
+
75
+ Bundle.Selection = Class.create();
76
+ Bundle.Selection.prototype = {
77
+ idLabel : '<?php echo $this->getFieldId() ?>',
78
+ scopePrice : <?php echo (int)$this->isUsedWebsitePrice() ?>,
79
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
80
+ templateBox : '',
81
+ templateRow : '',
82
+ itemsCount : 0,
83
+ row : null,
84
+ gridSelection : new Hash(),
85
+
86
+ initialize : function() {
87
+ this.templateBox = '<div class="grid tier form-list" id="' + this.idLabel + '_box_{{parentIndex}}">' + bundleTemplateBox + '</div>';
88
+
89
+ this.templateRow = '<tr class="selection" id="' + this.idLabel + '_row_{{index}}">' + bundleTemplateRow + '</tr>';
90
+ },
91
+
92
+ showSearch : function(event) {
93
+ var element = Event.findElement(event, 'div');
94
+ var parts = element.id.split('_');
95
+
96
+ var products = new Array();
97
+
98
+ var inputs = $A($$('#' + element.id + ' tr.selection input.product'));
99
+ for (i=0; i<inputs.length; i++) {
100
+ products.push(inputs[i].value);
101
+ }
102
+
103
+ this.gridSelection.set(parts[2], $H({}));
104
+
105
+ new Ajax.Updater(bOption.idLabel + '_search_' + parts[2], '<?php echo $this->getSelectionSearchUrl() ?>', {
106
+ method: 'post',
107
+ parameters : {'index' : parts[2], 'products[]' : products, 'form_key': FORM_KEY},
108
+ evalScripts : true
109
+ });
110
+
111
+ if (Event.element(event).tagName.toLowerCase() != 'button') {
112
+ var button = Event.element(event).up('button');
113
+ } else {
114
+ var button = Event.element(event);
115
+ }
116
+ button.hide();
117
+ },
118
+
119
+ addRow : function (parentIndex, data) {
120
+ var box = null;
121
+ if (!(box = $(this.idLabel + '_box_' + parentIndex))) {
122
+ this.addBox(parentIndex);
123
+ box = $(this.idLabel + '_box_' + parentIndex);
124
+ } else {
125
+ box.show();
126
+ }
127
+
128
+ var option_type = $(bOption.idLabel + '_' + parentIndex + '_type');
129
+
130
+ if(!data){
131
+ var data = {};
132
+ }
133
+
134
+ if (data.can_read_price != undefined && !data.can_read_price) {
135
+ data.selection_price_value = '';
136
+ } else {
137
+ data.selection_price_value = Number(data.selection_price_value).toFixed(2);
138
+ }
139
+
140
+ data.index = this.itemsCount++;
141
+ data.parentIndex = parentIndex;
142
+
143
+ if (option_type.value == 'multi' || option_type.value == 'checkbox') {
144
+ data.option_type = 'checkbox';
145
+ } else {
146
+ data.option_type = 'radio';
147
+ }
148
+
149
+ if (data.is_default == 1) {
150
+ data.checked = 'checked="checked"';
151
+ }
152
+
153
+ this.template = new Template(this.templateRow, this.templateSyntax);
154
+ var tbody = $$('#' + this.idLabel + '_box_' + parentIndex + ' tbody');
155
+
156
+ Element.insert(tbody[0], {'bottom':this.template.evaluate(data)});
157
+
158
+ if (data.selection_price_type) {
159
+ $A($(this.idLabel + '_'+data.index+'_price_type').options).each(function(option){
160
+ if (option.value==data.selection_price_type) option.selected = true;
161
+ });
162
+ }
163
+
164
+ if (data.selection_price_type) {
165
+ $A($(this.idLabel + '_'+data.index+'_can_change_qty').options).each(function(option){
166
+ if (option.value==data.selection_can_change_qty) option.selected = true;
167
+ });
168
+ }
169
+
170
+ var checkbox = $(this.idLabel + '_'+data.index+'_price_scope');
171
+ if (checkbox && this.scopePrice) {
172
+ if (data.price_scope === undefined) {
173
+ checkbox.up().hide();
174
+ } else if(!data.price_scope) {
175
+ checkbox.checked = true;
176
+ this.addScope(null, checkbox);
177
+ }
178
+ }
179
+
180
+ this.bindScopeCheckbox();
181
+
182
+ if (option_type.value == 'multi' || option_type.value == 'checkbox') {
183
+ /**
184
+ * Hide not needed elements (user defined qty select box)
185
+ */
186
+ inputs = $A($$('#' + this.idLabel + '_box_' + data.parentIndex + ' .qty-box'));
187
+ inputs.each(
188
+ function(elem){
189
+ elem.hide();
190
+ }
191
+ );
192
+ }
193
+
194
+ if (!$('price_type') || $('price_type').value != '1') {
195
+ /**
196
+ * Hide not needed elements (price type select and price input)
197
+ */
198
+ inputs = $A($$('#' + this.idLabel + '_box_' + data.parentIndex + ' .price-type-box'));
199
+ inputs.each(
200
+ function(elem){
201
+ elem.hide();
202
+ }
203
+ );
204
+ }
205
+ },
206
+
207
+ bindScopeCheckbox : function(){
208
+ var checkboxes = $$('.bundle-option-price-scope-checkbox');
209
+ for (var i=0;i<checkboxes.length;i++) {
210
+ if (!$(checkboxes[i]).binded) {
211
+ $(checkboxes[i]).binded = true;
212
+ Event.observe(checkboxes[i], 'click', this.addScope.bind(this));
213
+ }
214
+ }
215
+ },
216
+
217
+ addScope : function(event, element){
218
+ if (element == undefined) {
219
+ element = $(Event.element(event));
220
+ }
221
+ var priceValue = $(element.id.sub('scope', 'value'));
222
+ var priceType = $(element.id.sub('scope', 'type'));
223
+
224
+ if (element.checked) {
225
+ priceValue.disable();
226
+ priceType.disable();
227
+ } else {
228
+ priceValue.enable();
229
+ priceType.enable();
230
+ }
231
+ },
232
+
233
+ addBox : function (parentIndex) {
234
+ var div = $(bOption.idLabel + '_' + parentIndex)
235
+ this.template = new Template(this.templateBox, this.templateSyntax);
236
+ var data = {'parentIndex' : parentIndex};
237
+ Element.insert(div, {'bottom':this.template.evaluate(data)});
238
+ },
239
+
240
+ remove : function(event) {
241
+ var element = Event.findElement(event, 'tr');
242
+ var container = Event.findElement(event, 'div');
243
+
244
+ if (element) {
245
+ Element.select(element, '.delete').each(function(elem){elem.value='1'});
246
+ Element.select(element, ['input', 'select']).each(function(elem){elem.hide()});
247
+ Element.removeClassName(element, 'selection');
248
+ Element.hide(element);
249
+
250
+ if (container) {
251
+ if ($$('#' + container.id + ' tr.selection')) {
252
+ if (!$$('#' + container.id + ' tr.selection').length) {
253
+ container.hide();
254
+ }
255
+ }
256
+ }
257
+ }
258
+ },
259
+
260
+ checkGroup : function(event) {
261
+ var element = Event.element(event);
262
+ if (element.type == 'radio') {
263
+ var box = element.up('div');
264
+
265
+ var inputs = $$('div#' + box.id + ' input.default');
266
+ if (inputs) {
267
+ for (i=0; i< inputs.length; i++) {
268
+ if (inputs[i].name != element.name) {
269
+ inputs[i].checked = false;
270
+ }
271
+ }
272
+ }
273
+ }
274
+ },
275
+
276
+ productGridAddSelected : function(event) {
277
+ var element = Event.findElement(event, 'button');
278
+ var parts = element.id.split('_');
279
+
280
+ $(bOption.idLabel + '_search_' + parts[2]).innerHTML = '';
281
+ $(bOption.idLabel + '_' + parts[2] + '_add_button').show();
282
+
283
+ this.gridSelection.get(parts[2]).each(
284
+ function(pair) {
285
+ var qty = pair.value.get('qty');
286
+ var data = {
287
+ 'name' : pair.value.get('name'),
288
+ 'selection_price_value' : 0,
289
+ 'selection_qty' : (qty == '' ? 1 : qty),
290
+ 'sku' : pair.value.get('sku'),
291
+ 'position' : 0,
292
+ 'product_id' : pair.key,
293
+ 'option_id' : $(bOption.idLabel + '_id_' + parts[2]).value
294
+ };
295
+ bSelection.addRow(parts[2], data);
296
+ }
297
+ );
298
+ },
299
+
300
+ productGridRowInit : function(grid, row){
301
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
302
+ var inputs = $(row).getElementsByClassName('input-text');
303
+ for (var i = 0; i < inputs.length; i++) {
304
+ inputs[i].checkbox = checkbox;
305
+ Event.observe(inputs[i], 'keyup', this.productGridRowInputChange.bind(this));
306
+ Event.observe(inputs[i], 'change', this.productGridRowInputChange.bind(this));
307
+ }
308
+ },
309
+
310
+ productGridCheckboxCheck : function(grid, element, checked) {
311
+ var id = element.up('table').id.split('_')[4];
312
+ if (element.value > 0) {
313
+ if (element.checked) {
314
+ var tr = element.parentNode.parentNode;
315
+ if (!this.gridSelection.get(id)) {
316
+ this.gridSelection.set(id, new Hash());
317
+ }
318
+ this.gridSelection.get(id).set(element.value, $H({}));
319
+ this.gridSelection.get(id).get(element.value).set('name', tr.select('td.name')[0].innerHTML);
320
+ this.gridSelection.get(id).get(element.value).set('qty', tr.select('input.qty')[0].value);
321
+ this.gridSelection.get(id).get(element.value).set('sku', tr.select('td.sku')[0].innerHTML);
322
+ } else {
323
+ this.gridSelection.get(id).unset(element.value);
324
+ }
325
+ }
326
+ },
327
+
328
+ productGridRowClick : function(grid, event) {
329
+ var trElement = Event.findElement(event, 'tr');
330
+ var isInput = Event.element(event).tagName == 'INPUT';
331
+ if (trElement) {
332
+ var checkbox = Element.select(trElement, 'input');
333
+ if (checkbox[0]) {
334
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
335
+ grid.setCheckboxChecked(checkbox[0], checked);
336
+ }
337
+ }
338
+ },
339
+
340
+ productGridRowInputChange : function(event) {
341
+ var element = Event.element(event);
342
+ if (!element.checkbox.checked) {
343
+ return;
344
+ }
345
+ var id = element.up('table').id.split('_')[4];
346
+ this.gridSelection.get(id).get(element.checkbox.value).set('qty', element.value);
347
+ }
348
+ }
349
+
350
+ bSelection = new Bundle.Selection();
351
+ //]]>
352
+ </script>
app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
49
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td>&nbsp;</td>
59
+ <td>&nbsp;</td>
60
+ <td class="last">&nbsp;</td>
61
+ </tr>
62
+ <?php $_prevOptionId = $attributes['option_id'] ?>
63
+ <?php endif; ?>
64
+ <?php endif; ?>
65
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
66
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
67
+ <td><h5 class="title"><?php echo $this->escapeHtml($_item->getName()) ?></h5>
68
+ <div>
69
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
70
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
71
+ </div>
72
+ </td>
73
+ <?php else: ?>
74
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
75
+ <?php endif; ?>
76
+ <td class="a-right">
77
+ <?php if ($this->canShowPriceInfo($_item)): ?>
78
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
79
+ <span class="price-excl-tax">
80
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
81
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
82
+ <?php endif; ?>
83
+
84
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
85
+ <?php
86
+ echo $this->displayPrices(
87
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
88
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
89
+ );
90
+ ?>
91
+ <?php else: ?>
92
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
93
+ <?php endif; ?>
94
+
95
+
96
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
97
+ <br />
98
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
99
+ <small>
100
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
101
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
105
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
106
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
107
+ <?php endforeach; ?>
108
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
109
+ <small>
110
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
111
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
112
+ <?php endforeach; ?>
113
+ </small>
114
+ <?php endif; ?>
115
+
116
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
117
+ <br />
118
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
119
+ <?php
120
+ echo $this->displayPrices(
121
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
122
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
123
+ );
124
+ ?>
125
+ </span>
126
+ <?php endif; ?>
127
+ <?php endif; ?>
128
+ </span>
129
+ <br />
130
+ <?php endif; ?>
131
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
132
+ <span class="price-incl-tax">
133
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
134
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
135
+ <?php endif; ?>
136
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
137
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
138
+
139
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
140
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
141
+ <?php else: ?>
142
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
143
+ <?php endif; ?>
144
+
145
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
146
+ <br />
147
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
148
+ <small>
149
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
150
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
151
+ <?php endforeach; ?>
152
+ </small>
153
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
154
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
155
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
156
+ <?php endforeach; ?>
157
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
158
+ <small>
159
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
160
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
161
+ <?php endforeach; ?>
162
+ </small>
163
+ <?php endif; ?>
164
+
165
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
166
+ <br />
167
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
168
+ <?php endif; ?>
169
+ <?php endif; ?>
170
+ </span>
171
+ <?php endif; ?>
172
+ <?php else: ?>
173
+ &nbsp;
174
+ <?php endif; ?>
175
+ </td>
176
+ <td>
177
+ <?php if ($this->canShowPriceInfo($_item)): ?>
178
+ <table cellspacing="0" class="qty-table">
179
+ <tr>
180
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
181
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
182
+ </tr>
183
+ <?php if ((float) $_item->getOrderItem()->getQtyInvoiced()): ?>
184
+ <tr>
185
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
186
+ <td><strong><?php echo $_item->getOrderItem()->getQtyInvoiced()*1 ?></strong></td>
187
+ </tr>
188
+ <?php endif; ?>
189
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
190
+ <tr>
191
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
192
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
193
+ </tr>
194
+ <?php endif; ?>
195
+ <?php if ((float) $_item->getOrderItem()->getQtyRefunded()): ?>
196
+ <tr>
197
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
198
+ <td><strong><?php echo $_item->getOrderItem()->getQtyRefunded()*1 ?></strong></td>
199
+ </tr>
200
+ <?php endif; ?>
201
+ <?php if ((float) $_item->getOrderItem()->getQtyCanceled()): ?>
202
+ <tr>
203
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
204
+ <td><strong><?php echo $_item->getOrderItem()->getQtyCanceled()*1 ?></strong></td>
205
+ </tr>
206
+ <?php endif; ?>
207
+ </table>
208
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
209
+ <table cellspacing="0" class="qty-table">
210
+ <tr>
211
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
212
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
213
+ </tr>
214
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped()): ?>
215
+ <tr>
216
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
217
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
218
+ </tr>
219
+ <?php endif; ?>
220
+ </table>
221
+ <?php else: ?>
222
+ &nbsp;
223
+ <?php endif; ?>
224
+ </td>
225
+ <?php if ($this->canParentReturnToStock($_item)) : ?>
226
+ <td class="a-center">
227
+ <?php if ($this->canShowPriceInfo($_item)): ?>
228
+ <?php if ($this->canReturnItemToStock($_item)) : ?>
229
+ <input type="checkbox" name="creditmemo[items][<?php echo $_item->getOrderItemId() ?>][back_to_stock]" value="1"<?php if ($_item->getBackToStock()):?> checked="checked"<?php endif;?> />
230
+ <?php endif; ?>
231
+ <?php else: ?>
232
+ &nbsp;
233
+ <?php endif; ?>
234
+ </td>
235
+ <?php endif; ?>
236
+ <td class="a-center">
237
+ <?php if ($this->canShowPriceInfo($_item)): ?>
238
+ <?php if ($this->canEditQty()) : ?>
239
+ <input type="text" class="input-text qty-input" name="creditmemo[items][<?php echo $_item->getOrderItemId() ?>][qty]" value="<?php echo $_item->getQty()*1 ?>" />
240
+ <?php else: ?>
241
+ <?php echo $_item->getQty()*1 ?>
242
+ <?php endif; ?>
243
+ <?php else: ?>
244
+ &nbsp;
245
+ <?php endif; ?>
246
+ </td>
247
+ <td class="a-right">
248
+ <?php if ($this->canShowPriceInfo($_item)): ?>
249
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
250
+ <span class="price-excl-tax">
251
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
252
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
253
+ <?php endif; ?>
254
+
255
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
256
+ <?php
257
+ echo $this->displayPrices(
258
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
259
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
260
+ );
261
+ ?>
262
+ <?php else: ?>
263
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
264
+ <?php endif; ?>
265
+
266
+
267
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
268
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
269
+ <small>
270
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
271
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
272
+ <?php endforeach; ?>
273
+ </small>
274
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
275
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
276
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
277
+ <?php endforeach; ?>
278
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
279
+ <small>
280
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
281
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
282
+ <?php endforeach; ?>
283
+ </small>
284
+ <?php endif; ?>
285
+
286
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
287
+ <br />
288
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
289
+ <?php
290
+ echo $this->displayPrices(
291
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
292
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
293
+ );
294
+ ?>
295
+ </span>
296
+ <?php endif; ?>
297
+ <?php endif; ?>
298
+ </span>
299
+ <br />
300
+ <?php endif; ?>
301
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
302
+ <span class="price-incl-tax">
303
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
304
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
305
+ <?php endif; ?>
306
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
307
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
308
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
309
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
310
+ <?php else: ?>
311
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
312
+ <?php endif; ?>
313
+
314
+
315
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
316
+
317
+ <br />
318
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
319
+ <small>
320
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
321
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
322
+ <?php endforeach; ?>
323
+ </small>
324
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
325
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
326
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
327
+ <?php endforeach; ?>
328
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
329
+ <small>
330
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
331
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
332
+ <?php endforeach; ?>
333
+ </small>
334
+ <?php endif; ?>
335
+
336
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
337
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
338
+ <?php endif; ?>
339
+ <?php endif; ?>
340
+ </span>
341
+ <?php endif; ?>
342
+ </span>
343
+ <?php else: ?>
344
+ &nbsp;
345
+ <?php endif; ?>
346
+ </td>
347
+ <td class="a-right">
348
+ <?php if ($this->canShowPriceInfo($_item)): ?>
349
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
350
+ <?php else: ?>
351
+ &nbsp;
352
+ <?php endif; ?>
353
+ </td>
354
+ <td class="a-right">
355
+ <?php if ($this->canShowPriceInfo($_item)): ?>
356
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
357
+ <?php else: ?>
358
+ &nbsp;
359
+ <?php endif; ?>
360
+ </td>
361
+ <td class="a-right last">
362
+ <?php if ($this->canShowPriceInfo($_item)): ?>
363
+ <?php echo $this->displayPrices(
364
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() - $_item->getBaseDiscountAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(),
365
+ $_item->getRowTotal() + $_item->getTaxAmount() - $_item->getDiscountAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()
366
+ ) ?>
367
+ <?php else: ?>
368
+ &nbsp;
369
+ <?php endif; ?>
370
+ </td>
371
+ </tr>
372
+ <?php endforeach; ?>
373
+ <?php if($_showlastRow): ?>
374
+ <tr class="border">
375
+ <td>
376
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
377
+ <dl class="item-options">
378
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
379
+ <dt><?php echo $option['label'] ?></dt>
380
+ <dd>
381
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
382
+ <?php echo $option['value'];?>
383
+ <?php else: ?>
384
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
385
+ <?php if ($_remainder):?>
386
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
387
+ <script type="text/javascript">
388
+ $('<?php echo $_id ?>').hide();
389
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
390
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
391
+ </script>
392
+ <?php endif;?>
393
+ <?php endif;?>
394
+ </dd>
395
+ <?php endforeach; ?>
396
+ </dl>
397
+ <?php else: ?>
398
+ &nbsp;
399
+ <?php endif; ?>
400
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
401
+ </td>
402
+ <td>&nbsp;</td>
403
+ <td>&nbsp;</td>
404
+ <td>&nbsp;</td>
405
+ <td>&nbsp;</td>
406
+ <td>&nbsp;</td>
407
+ <td>&nbsp;</td>
408
+ <td>&nbsp;</td>
409
+ <td class="last">&nbsp;</td>
410
+ </tr>
411
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
49
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td class="last">&nbsp;</td>
59
+ </tr>
60
+ <?php $_prevOptionId = $attributes['option_id'] ?>
61
+ <?php endif; ?>
62
+ <?php endif; ?>
63
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
64
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
65
+ <td><h5 class="title"><?php echo $this->escapeHtml($_item->getName()) ?></h5>
66
+ <div>
67
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
68
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
69
+ </div>
70
+ </td>
71
+ <?php else: ?>
72
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
73
+ <?php endif; ?>
74
+ <td class="a-right">
75
+ <?php if ($this->canShowPriceInfo($_item)): ?>
76
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
77
+ <span class="price-excl-tax">
78
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
79
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
80
+ <?php endif; ?>
81
+
82
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
83
+ <?php
84
+ echo $this->displayPrices(
85
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
86
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
87
+ );
88
+ ?>
89
+ <?php else: ?>
90
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
91
+ <?php endif; ?>
92
+
93
+
94
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
95
+ <br />
96
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
97
+ <small>
98
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
99
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
100
+ <?php endforeach; ?>
101
+ </small>
102
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
103
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
104
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
105
+ <?php endforeach; ?>
106
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
107
+ <small>
108
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
109
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
110
+ <?php endforeach; ?>
111
+ </small>
112
+ <?php endif; ?>
113
+
114
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
115
+ <br />
116
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
117
+ <?php
118
+ echo $this->displayPrices(
119
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
120
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
121
+ );
122
+ ?>
123
+ </span>
124
+ <?php endif; ?>
125
+ <?php endif; ?>
126
+ </span>
127
+ <br />
128
+ <?php endif; ?>
129
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
130
+ <span class="price-incl-tax">
131
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
132
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
133
+ <?php endif; ?>
134
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
135
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
136
+
137
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
138
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
139
+ <?php else: ?>
140
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
141
+ <?php endif; ?>
142
+
143
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
144
+ <br />
145
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
146
+ <small>
147
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
148
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
149
+ <?php endforeach; ?>
150
+ </small>
151
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
152
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
153
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
154
+ <?php endforeach; ?>
155
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
156
+ <small>
157
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
158
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
159
+ <?php endforeach; ?>
160
+ </small>
161
+ <?php endif; ?>
162
+
163
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
164
+ <br />
165
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
166
+ <?php endif; ?>
167
+ <?php endif; ?>
168
+ </span>
169
+ <?php endif; ?>
170
+ <?php else: ?>
171
+ &nbsp;
172
+ <?php endif; ?>
173
+ </td>
174
+ <td class="a-center">
175
+ <?php if ($this->canShowPriceInfo($_item)): ?>
176
+ <?php echo $_item->getQty()*1 ?>
177
+ <?php else: ?>
178
+ &nbsp;
179
+ <?php endif; ?>
180
+ </td>
181
+ <td class="a-right">
182
+ <?php if ($this->canShowPriceInfo($_item)): ?>
183
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
184
+ <span class="price-excl-tax">
185
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
186
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
187
+ <?php endif; ?>
188
+
189
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
190
+ <?php
191
+ echo $this->displayPrices(
192
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
193
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
194
+ );
195
+ ?>
196
+ <?php else: ?>
197
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
198
+ <?php endif; ?>
199
+
200
+
201
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
202
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
203
+ <small>
204
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
205
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
206
+ <?php endforeach; ?>
207
+ </small>
208
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
209
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
210
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
211
+ <?php endforeach; ?>
212
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
213
+ <small>
214
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
215
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
216
+ <?php endforeach; ?>
217
+ </small>
218
+ <?php endif; ?>
219
+
220
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
221
+ <br />
222
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
223
+ <?php
224
+ echo $this->displayPrices(
225
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
226
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
227
+ );
228
+ ?>
229
+ </span>
230
+ <?php endif; ?>
231
+ <?php endif; ?>
232
+ </span>
233
+ <br />
234
+ <?php endif; ?>
235
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
236
+ <span class="price-incl-tax">
237
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
238
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
239
+ <?php endif; ?>
240
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
241
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
242
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
243
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
244
+ <?php else: ?>
245
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
246
+ <?php endif; ?>
247
+
248
+
249
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
250
+
251
+ <br />
252
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
253
+ <small>
254
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
255
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
256
+ <?php endforeach; ?>
257
+ </small>
258
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
259
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
260
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
261
+ <?php endforeach; ?>
262
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
263
+ <small>
264
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
265
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
266
+ <?php endforeach; ?>
267
+ </small>
268
+ <?php endif; ?>
269
+
270
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
271
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
272
+ <?php endif; ?>
273
+ <?php endif; ?>
274
+ </span>
275
+ <?php endif; ?>
276
+ </span>
277
+ <?php else: ?>
278
+ &nbsp;
279
+ <?php endif; ?>
280
+ </td>
281
+ <td class="a-right">
282
+ <?php if ($this->canShowPriceInfo($_item)): ?>
283
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
284
+ <?php else: ?>
285
+ &nbsp;
286
+ <?php endif; ?>
287
+ </td>
288
+ <td class="a-right">
289
+ <?php if ($this->canShowPriceInfo($_item)): ?>
290
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
291
+ <?php else: ?>
292
+ &nbsp;
293
+ <?php endif; ?>
294
+ </td>
295
+ <td class="a-right last">
296
+ <?php if ($this->canShowPriceInfo($_item)): ?>
297
+ <?php echo $this->displayPrices(
298
+ $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(),
299
+ $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()
300
+ ) ?>
301
+ <?php else: ?>
302
+ &nbsp;
303
+ <?php endif; ?>
304
+ </td>
305
+ </tr>
306
+ <?php endforeach; ?>
307
+ <?php if($_showlastRow): ?>
308
+ <tr class="border">
309
+ <td>
310
+ <?php if ($this->getOrderOptions()): ?>
311
+ <dl class="item-options">
312
+ <?php foreach ($this->getOrderOptions() as $option): ?>
313
+ <dt><?php echo $option['label'] ?></dt>
314
+ <dd>
315
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
316
+ <?php echo $option['value'];?>
317
+ <?php else: ?>
318
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
319
+ <?php if ($_remainder):?>
320
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
321
+ <script type="text/javascript">
322
+ $('<?php echo $_id ?>').hide();
323
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
324
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
325
+ </script>
326
+ <?php endif;?>
327
+ <?php endif;?>
328
+ </dd>
329
+ <?php endforeach; ?>
330
+ </dl>
331
+ <?php endif; ?>
332
+ <?php echo $this->escapeHtml($this->getItem()->getDescription()) ?>
333
+ </td>
334
+ <td>&nbsp;</td>
335
+ <td>&nbsp;</td>
336
+ <td>&nbsp;</td>
337
+ <td>&nbsp;</td>
338
+ <td>&nbsp;</td>
339
+ <td class="last">&nbsp;</td>
340
+ </tr>
341
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
49
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td>&nbsp;</td>
59
+ <td class="last">&nbsp;</td>
60
+ </tr>
61
+ <?php $_prevOptionId = $attributes['option_id'] ?>
62
+ <?php endif; ?>
63
+ <?php endif; ?>
64
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
65
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
66
+ <td><h5 class="title"><?php echo $this->escapeHtml($_item->getName()) ?></h5>
67
+ <div>
68
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
69
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
70
+ </div>
71
+ </td>
72
+ <?php else: ?>
73
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
74
+ <?php endif; ?>
75
+ <td class="a-right">
76
+ <?php if ($this->canShowPriceInfo($_item)): ?>
77
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
78
+ <span class="price-excl-tax">
79
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
80
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
81
+ <?php endif; ?>
82
+
83
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
84
+ <?php
85
+ echo $this->displayPrices(
86
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
87
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
88
+ );
89
+ ?>
90
+ <?php else: ?>
91
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
92
+ <?php endif; ?>
93
+
94
+
95
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
96
+ <br />
97
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
98
+ <small>
99
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
100
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
101
+ <?php endforeach; ?>
102
+ </small>
103
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
104
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
105
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
106
+ <?php endforeach; ?>
107
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
108
+ <small>
109
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
110
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
111
+ <?php endforeach; ?>
112
+ </small>
113
+ <?php endif; ?>
114
+
115
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
116
+ <br />
117
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
118
+ <?php
119
+ echo $this->displayPrices(
120
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
121
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
122
+ );
123
+ ?>
124
+ </span>
125
+ <?php endif; ?>
126
+ <?php endif; ?>
127
+ </span>
128
+ <br />
129
+ <?php endif; ?>
130
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
131
+ <span class="price-incl-tax">
132
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
133
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
134
+ <?php endif; ?>
135
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
136
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
137
+
138
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
139
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
140
+ <?php else: ?>
141
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
142
+ <?php endif; ?>
143
+
144
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
145
+ <br />
146
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
147
+ <small>
148
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
149
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
150
+ <?php endforeach; ?>
151
+ </small>
152
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
153
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
154
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
155
+ <?php endforeach; ?>
156
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
157
+ <small>
158
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
159
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
160
+ <?php endforeach; ?>
161
+ </small>
162
+ <?php endif; ?>
163
+
164
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
165
+ <br />
166
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
167
+ <?php endif; ?>
168
+ <?php endif; ?>
169
+ </span>
170
+ <?php endif; ?>
171
+ <?php else: ?>
172
+ &nbsp;
173
+ <?php endif; ?>
174
+ </td>
175
+ <td>
176
+ <?php if ($this->canShowPriceInfo($_item)): ?>
177
+ <table cellspacing="0" class="qty-table">
178
+ <tr>
179
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
180
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
181
+ </tr>
182
+ <?php if ((float) $_item->getOrderItem()->getQtyInvoiced()): ?>
183
+ <tr>
184
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
185
+ <td><strong><?php echo $_item->getOrderItem()->getQtyInvoiced()*1 ?></strong></td>
186
+ </tr>
187
+ <?php endif; ?>
188
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
189
+ <tr>
190
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
191
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
192
+ </tr>
193
+ <?php endif; ?>
194
+ <?php if ((float) $_item->getOrderItem()->getQtyRefunded()): ?>
195
+ <tr>
196
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
197
+ <td><strong><?php echo $_item->getOrderItem()->getQtyRefunded()*1 ?></strong></td>
198
+ </tr>
199
+ <?php endif; ?>
200
+ <?php if ((float) $_item->getOrderItem()->getQtyCanceled()): ?>
201
+ <tr>
202
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
203
+ <td><strong><?php echo $_item->getOrderItem()->getQtyCanceled()*1 ?></strong></td>
204
+ </tr>
205
+ <?php endif; ?>
206
+ </table>
207
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
208
+ <table cellspacing="0" class="qty-table">
209
+ <tr>
210
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
211
+ <td><strong><?php echo $_item->getOrderItem()->getQtyOrdered()*1 ?></strong></td>
212
+ </tr>
213
+ <?php if ((float) $_item->getOrderItem()->getQtyShipped()): ?>
214
+ <tr>
215
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
216
+ <td><strong><?php echo $_item->getOrderItem()->getQtyShipped()*1 ?></strong></td>
217
+ </tr>
218
+ <?php endif; ?>
219
+ </table>
220
+ <?php else: ?>
221
+ &nbsp;
222
+ <?php endif; ?>
223
+ </td>
224
+ <td class="a-center">
225
+ <?php if ($this->canShowPriceInfo($_item)): ?>
226
+ <?php if ($this->canEditQty()) : ?>
227
+ <input type="text" class="input-text qty-input" name="invoice[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>" />
228
+ <?php else : ?>
229
+ <?php echo $_item->getQty()*1 ?>
230
+ <?php endif; ?>
231
+ <?php else: ?>
232
+ &nbsp;
233
+ <?php endif; ?>
234
+ </td>
235
+ <td class="a-right">
236
+ <?php if ($this->canShowPriceInfo($_item)): ?>
237
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
238
+ <span class="price-excl-tax">
239
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
240
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
241
+ <?php endif; ?>
242
+
243
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
244
+ <?php
245
+ echo $this->displayPrices(
246
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
247
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
248
+ );
249
+ ?>
250
+ <?php else: ?>
251
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
252
+ <?php endif; ?>
253
+
254
+
255
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
256
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
257
+ <small>
258
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
259
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
260
+ <?php endforeach; ?>
261
+ </small>
262
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
263
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
264
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
265
+ <?php endforeach; ?>
266
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
267
+ <small>
268
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
269
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
270
+ <?php endforeach; ?>
271
+ </small>
272
+ <?php endif; ?>
273
+
274
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
275
+ <br />
276
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
277
+ <?php
278
+ echo $this->displayPrices(
279
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
280
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
281
+ );
282
+ ?>
283
+ </span>
284
+ <?php endif; ?>
285
+ <?php endif; ?>
286
+ </span>
287
+ <br />
288
+ <?php endif; ?>
289
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
290
+ <span class="price-incl-tax">
291
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
292
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
293
+ <?php endif; ?>
294
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
295
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
296
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
297
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
298
+ <?php else: ?>
299
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
300
+ <?php endif; ?>
301
+
302
+
303
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
304
+
305
+ <br />
306
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
307
+ <small>
308
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
309
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
310
+ <?php endforeach; ?>
311
+ </small>
312
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
313
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
314
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
315
+ <?php endforeach; ?>
316
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
317
+ <small>
318
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
319
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
320
+ <?php endforeach; ?>
321
+ </small>
322
+ <?php endif; ?>
323
+
324
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
325
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item),$_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
326
+ <?php endif; ?>
327
+ <?php endif; ?>
328
+ </span>
329
+ <?php endif; ?>
330
+ </span>
331
+ <?php else: ?>
332
+ &nbsp;
333
+ <?php endif; ?>
334
+ </td>
335
+ <td class="a-right">
336
+ <?php if ($this->canShowPriceInfo($_item)): ?>
337
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
338
+ <?php else: ?>
339
+ &nbsp;
340
+ <?php endif; ?>
341
+ </td>
342
+ <td class="a-right">
343
+ <?php if ($this->canShowPriceInfo($_item)): ?>
344
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
345
+ <?php else: ?>
346
+ &nbsp;
347
+ <?php endif; ?>
348
+ </td>
349
+ <td class="a-right last">
350
+ <?php if ($this->canShowPriceInfo($_item)): ?>
351
+ <?php echo $this->displayPrices(
352
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() - $_item->getBaseDiscountAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(),
353
+ $_item->getRowTotal() + $_item->getTaxAmount() - $_item->getDiscountAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()
354
+ ) ?>
355
+ <?php else: ?>
356
+ &nbsp;
357
+ <?php endif; ?>
358
+ </td>
359
+ </tr>
360
+ <?php endforeach; ?>
361
+ <?php if($_showlastRow): ?>
362
+ <tr class="border">
363
+ <td>
364
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
365
+ <dl class="item-options">
366
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
367
+ <dt><?php echo $option['label'] ?></dt>
368
+ <dd>
369
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
370
+ <?php echo $option['value'];?>
371
+ <?php else: ?>
372
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
373
+ <?php if ($_remainder):?>
374
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
375
+ <script type="text/javascript">
376
+ $('<?php echo $_id ?>').hide();
377
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
378
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
379
+ </script>
380
+ <?php endif;?>
381
+ <?php endif;?>
382
+ </dd>
383
+ <?php endforeach; ?>
384
+ </dl>
385
+ <?php else: ?>
386
+ &nbsp;
387
+ <?php endif; ?>
388
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
389
+ </td>
390
+ <td>&nbsp;</td>
391
+ <td>&nbsp;</td>
392
+ <td>&nbsp;</td>
393
+ <td>&nbsp;</td>
394
+ <td>&nbsp;</td>
395
+ <td>&nbsp;</td>
396
+ <td class="last">&nbsp;</td>
397
+ </tr>
398
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
49
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td class="last">&nbsp;</td>
59
+ </tr>
60
+ <?php $_prevOptionId = $attributes['option_id'] ?>
61
+ <?php endif; ?>
62
+ <?php endif; ?>
63
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
64
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
65
+ <td><h5 class="title"><?php echo $this->escapeHtml($_item->getName()) ?></h5>
66
+ <div>
67
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
68
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
69
+ </div>
70
+ <?php else: ?>
71
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
72
+ <?php endif; ?>
73
+ <td class="a-right">
74
+ <?php if ($this->canShowPriceInfo($_item)): ?>
75
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
76
+ <span class="price-excl-tax">
77
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
78
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
79
+ <?php endif; ?>
80
+
81
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
82
+ <?php
83
+ echo $this->displayPrices(
84
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
85
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
86
+ );
87
+ ?>
88
+ <?php else: ?>
89
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
90
+ <?php endif; ?>
91
+
92
+
93
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
94
+ <br />
95
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
96
+ <small>
97
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
98
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
99
+ <?php endforeach; ?>
100
+ </small>
101
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
102
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
103
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
104
+ <?php endforeach; ?>
105
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
106
+ <small>
107
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
108
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
109
+ <?php endforeach; ?>
110
+ </small>
111
+ <?php endif; ?>
112
+
113
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
114
+ <br />
115
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
116
+ <?php
117
+ echo $this->displayPrices(
118
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
119
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
120
+ );
121
+ ?>
122
+ </span>
123
+ <?php endif; ?>
124
+ <?php endif; ?>
125
+ </span>
126
+ <br />
127
+ <?php endif; ?>
128
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
129
+ <span class="price-incl-tax">
130
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
131
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
132
+ <?php endif; ?>
133
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
134
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
135
+
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
137
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
138
+ <?php else: ?>
139
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
140
+ <?php endif; ?>
141
+
142
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
143
+ <br />
144
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
145
+ <small>
146
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
147
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
148
+ <?php endforeach; ?>
149
+ </small>
150
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
151
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
152
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
153
+ <?php endforeach; ?>
154
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
155
+ <small>
156
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
157
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
158
+ <?php endforeach; ?>
159
+ </small>
160
+ <?php endif; ?>
161
+
162
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
163
+ <br />
164
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
165
+ <?php endif; ?>
166
+ <?php endif; ?>
167
+ </span>
168
+ <?php endif; ?>
169
+ <?php else: ?>
170
+ &nbsp;
171
+ <?php endif; ?>
172
+ </td>
173
+ <td class="a-center">
174
+ <?php if ($this->canShowPriceInfo($_item)): ?>
175
+ <?php echo $_item->getQty()*1 ?>
176
+ <?php else: ?>
177
+ &nbsp;
178
+ <?php endif; ?>
179
+ </td>
180
+ <td class="a-right">
181
+ <?php if ($this->canShowPriceInfo($_item)): ?>
182
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
183
+ <span class="price-excl-tax">
184
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
185
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
186
+ <?php endif; ?>
187
+
188
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
189
+ <?php
190
+ echo $this->displayPrices(
191
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
192
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
193
+ );
194
+ ?>
195
+ <?php else: ?>
196
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
197
+ <?php endif; ?>
198
+
199
+
200
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
201
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
202
+ <small>
203
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
204
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
205
+ <?php endforeach; ?>
206
+ </small>
207
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
208
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
209
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
210
+ <?php endforeach; ?>
211
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
212
+ <small>
213
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
214
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
215
+ <?php endforeach; ?>
216
+ </small>
217
+ <?php endif; ?>
218
+
219
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
220
+ <br />
221
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
222
+ <?php
223
+ echo $this->displayPrices(
224
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
225
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
226
+ );
227
+ ?>
228
+ </span>
229
+ <?php endif; ?>
230
+ <?php endif; ?>
231
+ </span>
232
+ <br />
233
+ <?php endif; ?>
234
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
235
+ <span class="price-incl-tax">
236
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
237
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
238
+ <?php endif; ?>
239
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
240
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
241
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
242
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
243
+ <?php else: ?>
244
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
245
+ <?php endif; ?>
246
+
247
+
248
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
249
+
250
+ <br />
251
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
252
+ <small>
253
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
254
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
255
+ <?php endforeach; ?>
256
+ </small>
257
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
258
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
259
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
260
+ <?php endforeach; ?>
261
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
262
+ <small>
263
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
264
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
265
+ <?php endforeach; ?>
266
+ </small>
267
+ <?php endif; ?>
268
+
269
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
270
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
271
+ <?php endif; ?>
272
+ <?php endif; ?>
273
+ </span>
274
+ <?php endif; ?>
275
+ </span>
276
+ <?php else: ?>
277
+ &nbsp;
278
+ <?php endif; ?>
279
+ </td>
280
+ <td class="a-right">
281
+ <?php if ($this->canShowPriceInfo($_item)): ?>
282
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
283
+ <?php else: ?>
284
+ &nbsp;
285
+ <?php endif; ?>
286
+ </td>
287
+ <td class="a-right">
288
+ <?php if ($this->canShowPriceInfo($_item)): ?>
289
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
290
+ <?php else: ?>
291
+ &nbsp;
292
+ <?php endif; ?>
293
+ </td>
294
+ <td class="a-right last">
295
+ <?php if ($this->canShowPriceInfo($_item)): ?>
296
+ <?php echo $this->displayPrices(
297
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() - $_item->getBaseDiscountAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(),
298
+ $_item->getRowTotal() + $_item->getTaxAmount() - $_item->getDiscountAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()
299
+ ) ?>
300
+ <?php else: ?>
301
+ &nbsp;
302
+ <?php endif; ?>
303
+ </td>
304
+ </tr>
305
+ <?php endforeach; ?>
306
+ <?php if($_showlastRow): ?>
307
+ <tr class="border">
308
+ <td>
309
+ <?php if ($this->getOrderOptions()): ?>
310
+ <dl class="item-options">
311
+ <?php foreach ($this->getOrderOptions() as $option): ?>
312
+ <dt><?php echo $option['label'] ?></dt>
313
+ <dd>
314
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
315
+ <?php echo $option['value'];?>
316
+ <?php else: ?>
317
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
318
+ <?php if ($_remainder):?>
319
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
320
+ <script type="text/javascript">
321
+ $('<?php echo $_id ?>').hide();
322
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
323
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
324
+ </script>
325
+ <?php endif;?>
326
+ <?php endif;?>
327
+ </dd>
328
+ <?php endforeach; ?>
329
+ </dl>
330
+ <?php endif; ?>
331
+ <?php echo $this->escapeHtml($this->getItem()->getDescription()) ?>
332
+ </td>
333
+ <td>&nbsp;</td>
334
+ <td>&nbsp;</td>
335
+ <td>&nbsp;</td>
336
+ <td>&nbsp;</td>
337
+ <td>&nbsp;</td>
338
+ <td class="last">&nbsp;</td>
339
+ </tr>
340
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = array_merge(array($_item), $_item->getChildrenItems()); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription() || $this->canDisplayGiftmessage()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
49
+ <?php if ($_item->getParentItem()): ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td>&nbsp;</td>
55
+ <td>&nbsp;</td>
56
+ <td>&nbsp;</td>
57
+ <td>&nbsp;</td>
58
+ <td>&nbsp;</td>
59
+ <td>&nbsp;</td>
60
+ <td>&nbsp;</td>
61
+ <td class="last">&nbsp;</td>
62
+ </tr>
63
+ <?php $_prevOptionId = $attributes['option_id'] ?>
64
+ <?php endif; ?>
65
+ <?php endif; ?>
66
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
67
+ <?php if (!$_item->getParentItem()): ?>
68
+ <td>
69
+ <h5 class="title">
70
+ <span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->escapeHtml($_item->getName()) ?></span>
71
+ </h5>
72
+ <div>
73
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
74
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
75
+ </div>
76
+ </td>
77
+ <?php else: ?>
78
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
79
+ <?php endif; ?>
80
+ <td class="a-center">
81
+ <?php if ($this->canShowPriceInfo($_item)): ?>
82
+ <?php echo $_item->getStatus() ?>
83
+ <?php else: ?>
84
+ &nbsp;
85
+ <?php endif; ?>
86
+ </td>
87
+ <td class="a-right">
88
+ <?php if ($this->canShowPriceInfo($_item)): ?>
89
+ <?php echo $this->displayPriceAttribute('original_price') ?>
90
+ <?php else: ?>
91
+ &nbsp;
92
+ <?php endif; ?>
93
+ </td>
94
+ <td class="a-right">
95
+ <?php if ($this->canShowPriceInfo($_item)): ?>
96
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
97
+ <span class="price-excl-tax">
98
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
99
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
100
+ <?php endif; ?>
101
+
102
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
103
+ <?php
104
+ echo $this->displayPrices(
105
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
106
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
107
+ );
108
+ ?>
109
+ <?php else: ?>
110
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
111
+ <?php endif; ?>
112
+
113
+
114
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
115
+ <br />
116
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
117
+ <small>
118
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
119
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
120
+ <?php endforeach; ?>
121
+ </small>
122
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
123
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
124
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
125
+ <?php endforeach; ?>
126
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
127
+ <small>
128
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
129
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
130
+ <?php endforeach; ?>
131
+ </small>
132
+ <?php endif; ?>
133
+
134
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
135
+ <br />
136
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
137
+ <?php
138
+ echo $this->displayPrices(
139
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
140
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
141
+ );
142
+ ?>
143
+ </span>
144
+ <?php endif; ?>
145
+ <?php endif; ?>
146
+ </span>
147
+ <br />
148
+ <?php endif; ?>
149
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
150
+ <span class="price-incl-tax">
151
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
152
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
153
+ <?php endif; ?>
154
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
155
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
156
+
157
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
158
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
159
+ <?php else: ?>
160
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
161
+ <?php endif; ?>
162
+
163
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
164
+ <br />
165
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
166
+ <small>
167
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
168
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
169
+ <?php endforeach; ?>
170
+ </small>
171
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
172
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
173
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
174
+ <?php endforeach; ?>
175
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
176
+ <small>
177
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
178
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
179
+ <?php endforeach; ?>
180
+ </small>
181
+ <?php endif; ?>
182
+
183
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
184
+ <br />
185
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
186
+ <?php endif; ?>
187
+ <?php endif; ?>
188
+ </span>
189
+ <?php endif; ?>
190
+ <?php else: ?>
191
+ &nbsp;
192
+ <?php endif; ?>
193
+ </td>
194
+ <td>
195
+ <?php if ($this->canShowPriceInfo($_item)): ?>
196
+ <table cellspacing="0" class="qty-table">
197
+ <tr>
198
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
199
+ <td><strong><?php echo $_item->getQtyOrdered()*1 ?></strong></td>
200
+ </tr>
201
+ <?php if ((float) $_item->getQtyInvoiced()): ?>
202
+ <tr>
203
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
204
+ <td><strong><?php echo $_item->getQtyInvoiced()*1 ?></strong></td>
205
+ </tr>
206
+ <?php endif; ?>
207
+ <?php if ((float) $_item->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
208
+ <tr>
209
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
210
+ <td><strong><?php echo $_item->getQtyShipped()*1 ?></strong></td>
211
+ </tr>
212
+ <?php endif; ?>
213
+ <?php if ((float) $_item->getQtyRefunded()): ?>
214
+ <tr>
215
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
216
+ <td><strong><?php echo $_item->getQtyRefunded()*1 ?></strong></td>
217
+ </tr>
218
+ <?php endif; ?>
219
+ <?php if ((float) $_item->getQtyCanceled()): ?>
220
+ <tr>
221
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
222
+ <td><strong><?php echo $_item->getQtyCanceled()*1 ?></strong></td>
223
+ </tr>
224
+ <?php endif; ?>
225
+ </table>
226
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
227
+ <table cellspacing="0" class="qty-table">
228
+ <tr>
229
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
230
+ <td><strong><?php echo $_item->getQtyOrdered()*1 ?></strong></td>
231
+ </tr>
232
+ <?php if ((float) $_item->getQtyShipped()): ?>
233
+ <tr>
234
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
235
+ <td><strong><?php echo $_item->getQtyShipped()*1 ?></strong></td>
236
+ </tr>
237
+ <?php endif; ?>
238
+ </table>
239
+ <?php else: ?>
240
+ &nbsp;
241
+ <?php endif; ?>
242
+ </td>
243
+ <td class="a-right">
244
+ <?php if ($this->canShowPriceInfo($_item)): ?>
245
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
246
+ <span class="price-excl-tax">
247
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
248
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
249
+ <?php endif; ?>
250
+
251
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
252
+ <?php
253
+ echo $this->displayPrices(
254
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
255
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
256
+ );
257
+ ?>
258
+ <?php else: ?>
259
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
260
+ <?php endif; ?>
261
+
262
+
263
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
264
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
265
+ <small>
266
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
267
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
268
+ <?php endforeach; ?>
269
+ </small>
270
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
271
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
272
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
273
+ <?php endforeach; ?>
274
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
275
+ <small>
276
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
277
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
278
+ <?php endforeach; ?>
279
+ </small>
280
+ <?php endif; ?>
281
+
282
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
283
+ <br />
284
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
285
+ <?php
286
+ echo $this->displayPrices(
287
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
288
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
289
+ );
290
+ ?>
291
+ </span>
292
+ <?php endif; ?>
293
+ <?php endif; ?>
294
+ </span>
295
+ <br />
296
+ <?php endif; ?>
297
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
298
+ <span class="price-incl-tax">
299
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
300
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
301
+ <?php endif; ?>
302
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
303
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
304
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
305
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
306
+ <?php else: ?>
307
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
308
+ <?php endif; ?>
309
+
310
+
311
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
312
+
313
+ <br />
314
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
315
+ <small>
316
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
317
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
318
+ <?php endforeach; ?>
319
+ </small>
320
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
321
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
322
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
323
+ <?php endforeach; ?>
324
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
325
+ <small>
326
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
327
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
328
+ <?php endforeach; ?>
329
+ </small>
330
+ <?php endif; ?>
331
+
332
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
333
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
334
+ <?php endif; ?>
335
+ <?php endif; ?>
336
+ </span>
337
+ <?php endif; ?>
338
+ <?php else: ?>
339
+ &nbsp;
340
+ <?php endif; ?>
341
+ </td>
342
+ <td class="a-right">
343
+ <?php if ($this->canShowPriceInfo($_item)): ?>
344
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
345
+ <?php else: ?>
346
+ &nbsp;
347
+ <?php endif; ?>
348
+ </td>
349
+
350
+ <td class="a-right">
351
+ <?php if ($this->canShowPriceInfo($_item)): ?>
352
+ <?php echo $this->displayTaxPercent($_item) ?>
353
+ <?php else: ?>
354
+ &nbsp;
355
+ <?php endif; ?>
356
+ </td>
357
+ <td class="a-right">
358
+ <?php if ($this->canShowPriceInfo($_item)): ?>
359
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
360
+ <?php else: ?>
361
+ &nbsp;
362
+ <?php endif; ?>
363
+ </td>
364
+ <td class="a-right last">
365
+ <?php if ($this->canShowPriceInfo($_item)): ?>
366
+ <?php echo $this->displayPrices(
367
+ max(0, $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount()),
368
+ max(0, $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount())
369
+ ); ?>
370
+ <?php else: ?>
371
+ &nbsp;
372
+ <?php endif; ?>
373
+ </td>
374
+ </tr>
375
+ <?php endforeach; ?>
376
+ <?php if($_showlastRow): ?>
377
+ <tr<?php if (!$this->canDisplayGiftmessage()) echo ' class="border"' ?>>
378
+ <td>
379
+ <?php if ($this->getOrderOptions()): ?>
380
+ <dl class="item-options">
381
+ <?php foreach ($this->getOrderOptions() as $option): ?>
382
+ <dt><?php echo $option['label'] ?>:</dt>
383
+ <dd>
384
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
385
+ <?php echo $option['value'];?>
386
+ <?php else: ?>
387
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
388
+ <?php if ($_remainder):?>
389
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
390
+ <script type="text/javascript">
391
+ $('<?php echo $_id ?>').hide();
392
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
393
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
394
+ </script>
395
+ <?php endif;?>
396
+ <?php endif;?>
397
+ </dd>
398
+ <?php endforeach; ?>
399
+ </dl>
400
+ <?php else: ?>
401
+ &nbsp;
402
+ <?php endif; ?>
403
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
404
+ </td>
405
+ <td>&nbsp;</td>
406
+ <td>&nbsp;</td>
407
+ <td>&nbsp;</td>
408
+ <td>&nbsp;</td>
409
+ <td>&nbsp;</td>
410
+ <td>&nbsp;</td>
411
+ <td>&nbsp;</td>
412
+ <td>&nbsp;</td>
413
+ <td class="last">&nbsp;</td>
414
+ </tr>
415
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = $this->getChilds($_item); ?>
35
+ <?php $_count = count ($items) ?>
36
+ <?php $_index = 0 ?>
37
+
38
+ <?php $_prevOptionId = '' ?>
39
+
40
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
41
+ <?php $_showlastRow = true ?>
42
+ <?php else: ?>
43
+ <?php $_showlastRow = false ?>
44
+ <?php endif; ?>
45
+
46
+ <?php foreach ($items as $_item): ?>
47
+ <?php $this->setPriceDataObject($_item) ?>
48
+ <?php if ($_item->getOrderItem()->getParentItem()): ?>
49
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
50
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
51
+ <tr>
52
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
53
+ <td>&nbsp;</td>
54
+ <td class="last">&nbsp;</td>
55
+ </tr>
56
+ <?php $_prevOptionId = $attributes['option_id'] ?>
57
+ <?php endif; ?>
58
+ <?php endif; ?>
59
+ <tr class="<?php echo (++$_index==$_count && !$_showlastRow)?'border':'' ?>">
60
+ <?php if (!$_item->getOrderItem()->getParentItem()): ?>
61
+ <td><h5 class="title"><?php echo $this->escapeHtml($_item->getName()) ?></h5>
62
+ <div>
63
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
64
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
65
+ </div>
66
+ </td>
67
+ <?php else: ?>
68
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
69
+ <?php endif; ?>
70
+ <td>
71
+ <?php if ($this->isShipmentSeparately($_item)): ?>
72
+ <?php echo $this->getColumnHtml($_item, 'qty') ?>
73
+ <?php else: ?>
74
+ &nbsp;
75
+ <?php endif; ?>
76
+ </td>
77
+ <td class="last">
78
+ <?php if ($this->isShipmentSeparately($_item)): ?>
79
+ <input type="text" class="input-text" name="shipment[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>" />
80
+ <?php else: ?>
81
+ &nbsp;
82
+ <?php endif; ?>
83
+ </td>
84
+ </tr>
85
+ <?php endforeach; ?>
86
+ <?php if($_showlastRow): ?>
87
+ <tr class="border">
88
+ <td>
89
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
90
+ <dl class="item-options">
91
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
92
+ <dt><?php echo $option['label'] ?></dt>
93
+ <dd>
94
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
95
+ <?php echo $option['value'];?>
96
+ <?php else: ?>
97
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
98
+ <?php if ($_remainder):?>
99
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
100
+ <script type="text/javascript">
101
+ $('<?php echo $_id ?>').hide();
102
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
103
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
104
+ </script>
105
+ <?php endif;?>
106
+ <?php endif;?>
107
+ </dd>
108
+ <?php endforeach; ?>
109
+ </dl>
110
+ <?php else: ?>
111
+ &nbsp;
112
+ <?php endif; ?>
113
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
114
+ </td>
115
+ <td>&nbsp;</td>
116
+ <td class="last">&nbsp;</td>
117
+ </tr>
118
+ <?php endif; ?>
app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
30
+ */
31
+ ?>
32
+
33
+ <?php $_item = $this->getItem() ?>
34
+ <?php $items = array_merge(array($_item->getOrderItem()), $_item->getOrderItem()->getChildrenItems()) ?>
35
+ <?php $shipItems = $this->getChilds($_item) ?>
36
+ <?php $_count = count ($items) ?>
37
+ <?php $_index = 0 ?>
38
+
39
+ <?php $_prevOptionId = '' ?>
40
+
41
+ <?php if($this->getOrderOptions() || $_item->getDescription()): ?>
42
+ <?php $_showlastRow = true ?>
43
+ <?php else: ?>
44
+ <?php $_showlastRow = false ?>
45
+ <?php endif; ?>
46
+
47
+ <?php foreach ($items as $_item): ?>
48
+ <?php $this->setPriceDataObject($_item) ?>
49
+ <?php if ($_item->getParentItem()): ?>
50
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
51
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
52
+ <tr>
53
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
54
+ <td class="last">&nbsp;</td>
55
+ </tr>
56
+ <?php $_prevOptionId = $attributes['option_id'] ?>
57
+ <?php endif; ?>
58
+ <?php endif; ?>
59
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
60
+ <?php if (!$_item->getParentItem()): ?>
61
+ <td>
62
+ <h5 class="title"><?php echo $this->escapeHtml($_item->getName()) ?></h5>
63
+ <div>
64
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
65
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
66
+ </div>
67
+ </td>
68
+ <?php else: ?>
69
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
70
+ <?php endif; ?>
71
+ <td class="a-center last">
72
+ <?php if (($this->isShipmentSeparately() && $_item->getParentItem()) || (!$this->isShipmentSeparately() && !$_item->getParentItem())): ?>
73
+ <?php if (isset($shipItems[$_item->getId()])): ?>
74
+ <?php echo $shipItems[$_item->getId()]->getQty()*1 ?>
75
+ <?php elseif ($_item->getIsVirtual()): ?>
76
+ <?php echo $this->__('N/A') ?>
77
+ <?php else: ?>
78
+ 0
79
+ <?php endif; ?>
80
+ <?php else: ?>
81
+ &nbsp;
82
+ <?php endif; ?>
83
+ </td>
84
+ </tr>
85
+ <?php endforeach; ?>
86
+ <?php if($_showlastRow): ?>
87
+ <tr class="border">
88
+ <td>
89
+ <?php if ($this->getOrderOptions($_item->getOrderItem())): ?>
90
+ <dl class="item-options">
91
+ <?php foreach ($this->getOrderOptions($_item->getOrderItem()) as $option): ?>
92
+ <dt><?php echo $option['label'] ?></dt>
93
+ <dd>
94
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
95
+ <?php echo $option['value'];?>
96
+ <?php else: ?>
97
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
98
+ <?php if ($_remainder):?>
99
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
100
+ <script type="text/javascript">
101
+ $('<?php echo $_id ?>').hide();
102
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
103
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
104
+ </script>
105
+ <?php endif;?>
106
+ <?php endif;?>
107
+ </dd>
108
+ <?php endforeach; ?>
109
+ </dl>
110
+ <?php endif; ?>
111
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
112
+ </td>
113
+ <td class="last">&nbsp;</td>
114
+ </tr>
115
+ <?php endif; ?>
app/design/adminhtml/default/default/template/captcha/zend.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php $captcha = $this->getCaptchaModel() ?>
28
+ <?php /* @var $this Mage_Core_Block_Captcha_Zend */ ?>
29
+ <div class="clear"></div>
30
+ <div class="captcha">
31
+ <div class="captcha-input input-box input-left">
32
+ <label for="captcha"><?php echo $this->__('Please type the letters from the image:') ?></label><br />
33
+ <input type="text" name="<?php echo Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" id="captcha" class="required-entry input-text validation-failed"/>
34
+ </div>
35
+ <div class="captcha-image input-right">
36
+ <img id="captcha-reload" class="captcha-reload" src="<?php echo $this->getSkinUrl('images/reload.png') ?>" alt="<?php echo $this->__('Reload captcha') ?>"/>
37
+ <img id="<?php echo $this->getFormId() ?>" width="<?php echo $this->getImgWidth() ?>" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>" />
38
+ </div>
39
+ </div>
40
+ <?php if ($captcha->isCaseSensitive()) :?>
41
+ <div class="captcha-note">
42
+ <p><?php echo $this->__('<strong>Attention</strong>: Captcha is case sensitive.') ?></p>
43
+ </div>
44
+ <?php endif; ?>
45
+ <script type="text/javascript">
46
+ //<![CDATA[
47
+ document.observe('dom:loaded', function () {
48
+ var captcha = new Captcha('<?php echo $this->getRefreshUrl() ?>', '<?php echo $this->getFormId() ?>');
49
+
50
+ $('captcha-reload').observe('click', function () {
51
+ captcha.refresh(this);
52
+ });
53
+
54
+ });
55
+ //]]>
56
+ </script>
app/design/adminhtml/default/default/template/catalog/category/checkboxes/tree.phtml ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php $_divId = 'tree-div_' . time() ?>
29
+ <div id="<?php echo $_divId ?>" class="tree"></div>
30
+
31
+ <script type="text/javascript">
32
+ //<![CDATA[
33
+
34
+ // TODO: cleanup this script. It was copypasted from catalog/category/tree
35
+
36
+ var tree;
37
+
38
+ /**
39
+ * Fix ext compatibility with prototype 1.6
40
+ */
41
+ Ext.lib.Event.getTarget = function(e) {
42
+ var ee = e.browserEvent || e;
43
+ return ee.target ? Event.element(ee) : null;
44
+ };
45
+
46
+ Ext.tree.TreePanel.Enhanced = function(el, config)
47
+ {
48
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
49
+ };
50
+
51
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
52
+
53
+ loadTree : function(config, firstLoad)
54
+ {
55
+ var parameters = config['parameters'];
56
+ var data = config['data'];
57
+
58
+ if ((typeof parameters['root_visible']) != 'undefined') {
59
+ this.rootVisible = parameters['root_visible']*1;
60
+ }
61
+
62
+ var root = new Ext.tree.TreeNode(parameters);
63
+
64
+ this.nodeHash = {};
65
+ this.setRootNode(root);
66
+
67
+ if (firstLoad) {
68
+ this.addListener('click', this.categoryClick.createDelegate(this));
69
+ }
70
+
71
+ this.loader.buildCategoryTree(root, data);
72
+ this.el.dom.innerHTML = '';
73
+ // render the tree
74
+ this.render();
75
+ },
76
+
77
+ categoryClick : function(node, e)
78
+ {
79
+ node.getUI().check(!node.getUI().checked());
80
+ }
81
+ });
82
+
83
+ Ext.onReady(function()
84
+ {
85
+ var categoryLoader = new Ext.tree.TreeLoader({
86
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
87
+ });
88
+
89
+ categoryLoader.createNode = function(config) {
90
+ config.uiProvider = Ext.tree.CheckboxNodeUI;
91
+ var node;
92
+ var _node = Object.clone(config);
93
+ if (config.children && !config.children.length) {
94
+ delete(config.children);
95
+ node = new Ext.tree.AsyncTreeNode(config);
96
+ } else {
97
+ node = new Ext.tree.TreeNode(config);
98
+ }
99
+
100
+ return node;
101
+ };
102
+
103
+ categoryLoader.buildCategoryTree = function(parent, config)
104
+ {
105
+ if (!config) return null;
106
+
107
+ if (parent && config && config.length){
108
+ for (var i = 0; i < config.length; i++) {
109
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
110
+ var node;
111
+ var _node = Object.clone(config[i]);
112
+ if (_node.children && !_node.children.length) {
113
+ delete(_node.children);
114
+ node = new Ext.tree.AsyncTreeNode(_node);
115
+ } else {
116
+ node = new Ext.tree.TreeNode(config[i]);
117
+ }
118
+ parent.appendChild(node);
119
+ node.loader = node.getOwnerTree().loader;
120
+ if (_node.children) {
121
+ this.buildCategoryTree(node, _node.children);
122
+ }
123
+ }
124
+ }
125
+ };
126
+
127
+ categoryLoader.buildHash = function(node)
128
+ {
129
+ var hash = {};
130
+
131
+ hash = this.toArray(node.attributes);
132
+
133
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
134
+ hash['children'] = new Array;
135
+
136
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
137
+ if (!hash['children']) {
138
+ hash['children'] = new Array;
139
+ }
140
+ hash['children'].push(this.buildHash(node.childNodes[i]));
141
+ }
142
+ }
143
+
144
+ return hash;
145
+ };
146
+
147
+ categoryLoader.toArray = function(attributes) {
148
+ var data = {};
149
+ for (var key in attributes) {
150
+ var value = attributes[key];
151
+ data[key] = value;
152
+ }
153
+
154
+ return data;
155
+ };
156
+
157
+ categoryLoader.on("beforeload", function(treeLoader, node) {
158
+ treeLoader.baseParams.id = node.attributes.id;
159
+ });
160
+
161
+ categoryLoader.on("load", function(treeLoader, node, config) {
162
+ varienWindowOnload();
163
+ });
164
+
165
+ tree = new Ext.tree.TreePanel.Enhanced('<?php echo $_divId ?>', {
166
+ animate: false,
167
+ loader: categoryLoader,
168
+ enableDD: false,
169
+ containerScroll: true,
170
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
171
+ rootVisible: '<?php echo $this->getRoot()->getIsVisible() ?>',
172
+ useAjax: <?php echo $this->getUseAjax() ?>,
173
+ currentNodeId: <?php echo (int) $this->getCategoryId() ?>,
174
+ addNodeTo: false,
175
+ rootUIProvider: Ext.tree.CheckboxNodeUI
176
+ });
177
+
178
+ tree.on('check', function(node, checked) {
179
+ <?php echo $this->getJsFormObject() ?>.updateElement.value = this.getChecked().join(', ');
180
+ varienElementMethods.setHasChanges(node.getUI().checkbox);
181
+ }, tree);
182
+
183
+ // set the root node
184
+ var parameters = {
185
+ text: '<?php echo htmlentities($this->getRoot()->getName()) ?>',
186
+ draggable: false,
187
+ checked:'<?php echo $this->getRoot()->getChecked() ?>',
188
+ uiProvider: Ext.tree.CheckboxNodeUI,
189
+ allowDrop: <?php if ($this->getRoot()->getIsVisible()): ?>true<?php else : ?>false<?php endif; ?>,
190
+ id: <?php echo (int) $this->getRoot()->getId() ?>,
191
+ expanded: <?php echo (int) $this->getIsWasExpanded() ?>,
192
+ category_id: <?php echo (int) $this->getCategoryId() ?>
193
+ };
194
+
195
+ tree.loadTree({parameters:parameters, data:<?php echo $this->getTreeJson() ?>},true);
196
+
197
+ });
198
+ //]]>
199
+ </script>
app/design/adminhtml/default/default/template/catalog/category/edit.phtml ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * Template for Mage_Adminhtml_Block_Catalog_Category_Cointainer
30
+ */
31
+ ?>
32
+
33
+ <div id="category-edit-container" class="category-content">
34
+ <?php echo $this->getChildHtml('form') ?>
35
+ </div>
36
+ <script type="text/javascript">
37
+ //<![CDATA[
38
+
39
+ function categoryReset(url,useAjax){
40
+ if(useAjax){
41
+ var params = {active_tab_id:false};
42
+ updateContent(url, params);
43
+ }else{
44
+ location.href = url;
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Delete some category
50
+ * This routine get categoryId explicitly, so even if currently selected tree node is out of sync
51
+ * with this form, we surely delete same category in the tree and at backend
52
+ */
53
+ function categoryDelete(url, useAjax, categoryId) {
54
+ if (confirm('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Are you sure you want to delete this category?')) ?>')){
55
+ if (useAjax){
56
+ tree.nodeForDelete = categoryId;
57
+ updateContent(url, {}, true);
58
+ } else {
59
+ location.href = url;
60
+ }
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Update category content area
66
+ */
67
+ function updateContent(url, params, refreshTree) {
68
+ if (!params) {
69
+ params = {};
70
+ }
71
+ if (!params.form_key) {
72
+ params.form_key = FORM_KEY;
73
+ }
74
+
75
+ toolbarToggle.stop();
76
+
77
+ /*if(params.node_name)
78
+ {
79
+ var currentNode = tree.getNodeById(tree.currentNodeId);
80
+ currentNode.setText(params.node_name);
81
+ }*/
82
+
83
+ var categoryContainer = $('category-edit-container');
84
+ var messagesContainer = $('messages');
85
+ var thisObj = this;
86
+ new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
87
+ parameters: params,
88
+ evalScripts: true,
89
+ onComplete: function () {
90
+ /**
91
+ * This func depends on variables, that came in response, and were eval'ed in onSuccess() callback.
92
+ * Since prototype's Element.update() evals javascripts in 10 msec, we should exec our func after it.
93
+ */
94
+ setTimeout(function() {
95
+ try {
96
+ if (refreshTree) {
97
+ thisObj.refreshTreeArea();
98
+ }
99
+ toolbarToggle.start();
100
+ } catch (e) {
101
+ alert(e.message);
102
+ };
103
+ }, 25);
104
+ },
105
+ onSuccess: function(transport) {
106
+ try {
107
+ if (transport.responseText.isJSON()) {
108
+ var response = transport.responseText.evalJSON();
109
+ var needUpdate = true;
110
+ if (response.error) {
111
+ alert(response.message);
112
+ needUpdate = false;
113
+ }
114
+ if(response.ajaxExpired && response.ajaxRedirect) {
115
+ setLocation(response.ajaxRedirect);
116
+ needUpdate = false;
117
+ }
118
+ if (needUpdate){
119
+ if (response.content){
120
+ $(categoryContainer).update(response.content);
121
+ }
122
+ if (response.messages){
123
+ $(messagesContainer).update(response.messages);
124
+ }
125
+ }
126
+ } else {
127
+ $(categoryContainer).update(transport.responseText);
128
+ }
129
+ }
130
+ catch (e) {
131
+ $(categoryContainer).update(transport.responseText);
132
+ }
133
+ }
134
+ });
135
+ }
136
+
137
+ /**
138
+ * Refresh tree nodes after saving or deleting a category
139
+ */
140
+ function refreshTreeArea(transport)
141
+ {
142
+ if (tree && window.editingCategoryBreadcrumbs) {
143
+ // category deleted - delete its node
144
+ if (tree.nodeForDelete) {
145
+ var node = tree.getNodeById(tree.nodeForDelete);
146
+ tree.nodeForDelete = false;
147
+
148
+ if (node) { // Check maybe tree became somehow not synced with ajax and we're trying to delete unknown node
149
+ node.parentNode.removeChild(node);
150
+ tree.currentNodeId = false;
151
+ }
152
+ }
153
+ // category created - add its node
154
+ else if (tree.addNodeTo) {
155
+ var parent = tree.getNodeById(tree.addNodeTo);
156
+ tree.addNodeTo = false;
157
+
158
+ if (parent) { // Check maybe tree became somehow not synced with ajax and we're trying to add to unknown node
159
+ var node = new Ext.tree.AsyncTreeNode(editingCategoryBreadcrumbs[editingCategoryBreadcrumbs.length - 1]);
160
+ node.loaded = true;
161
+ tree.currentNodeId = node.id;
162
+ parent.appendChild(node);
163
+
164
+ if (parent.expanded) {
165
+ tree.selectCurrentNode();
166
+ } else {
167
+ var timer;
168
+ parent.expand();
169
+ var f = function(){
170
+ if(parent.expanded){ // done expanding
171
+ clearInterval(timer);
172
+ tree.selectCurrentNode();
173
+ }
174
+ };
175
+ timer = setInterval(f, 200);
176
+ }
177
+ }
178
+ }
179
+
180
+ // update all affected categories nodes names
181
+ for (var i = 0; i < editingCategoryBreadcrumbs.length; i++) {
182
+ var node = tree.getNodeById(editingCategoryBreadcrumbs[i].id);
183
+ if (node) {
184
+ node.setText(editingCategoryBreadcrumbs[i].text);
185
+ }
186
+ }
187
+ }
188
+ }
189
+
190
+ function displayLoadingMask()
191
+ {
192
+ var loaderArea = $$('#html-body .wrapper')[0]; // Blocks all page
193
+ Position.clone($(loaderArea), $('loading-mask'), {offsetLeft:-2});
194
+ toggleSelectsUnderBlock($('loading-mask'), false);
195
+ Element.show('loading-mask');
196
+ }
197
+ //]]>
198
+ </script>
app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <div class="content-header">
29
+ <h3 class="icon-head head-categories"><?php echo $this->escapeHtml($this->getHeader()) . ($this->getCategoryId() ? ' (' . Mage::helper('catalog')->__('ID: %s', $this->getCategoryId()) . ')' : '') ?></h3>
30
+ <p class="content-buttons form-buttons">
31
+ <?php echo $this->getResetButtonHtml() ?>
32
+ <?php if($this->getCategoryId()): ?>
33
+ <?php echo $this->getDeleteButtonHtml() ?>
34
+ <?php endif; ?>
35
+ <?php echo $this->getAdditionalButtonsHtml(); ?>
36
+ <?php echo $this->getSaveButtonHtml() ?>
37
+ </p>
38
+ </div>
39
+ <?php if($this->hasStoreRootCategory()): ?>
40
+ <?php echo $this->getTabsHtml() ?>
41
+ <?php else: ?>
42
+ <div class="messages warning-msg">
43
+ <?php echo Mage::helper('catalog')->__('Set root category for this store in the <a href="%s">configuration</a>', $this->getStoreConfigurationUrl()) ?>
44
+ </div>
45
+ <?php endif; ?>
46
+ <iframe name="iframeSave" style="display:none; width:100%;" src="<?php echo $this->getJsUrl() ?>blank.html"></iframe>
47
+ <form target="iframeSave" id="category_edit_form" action="<?php echo $this->getSaveUrl() ?>" method="post" enctype="multipart/form-data">
48
+ <div class="no-display">
49
+ <input type="hidden" name="isIframe" value="1" />
50
+ <input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
51
+ <input type="hidden" name="category_products" id="in_category_products" value="" />
52
+ <input type="hidden" name="active_tab_id" id="active_tab_id" value="" />
53
+ </div>
54
+ <div id="category_tab_content"></div>
55
+ </form>
56
+ <script type="text/javascript">
57
+ //<![CDATA[
58
+ categoryForm = new varienForm('category_edit_form');
59
+
60
+ categoryForm.submit= function (url) {
61
+ this.errorSections = $H({});
62
+ this.canShowError = true;
63
+ this.submitUrl = url;
64
+ if (this.validator && this.validator.validate()) {
65
+ if(this.validationUrl){
66
+ this._validate();
67
+ }
68
+ else{
69
+ if (this.isSubmitted) {
70
+ return false;
71
+ }
72
+ this.isSubmitted = true;
73
+ this._submit();
74
+ }
75
+ displayLoadingMask();
76
+ return true;
77
+ }
78
+ return false;
79
+ };
80
+
81
+ categoryForm.refreshPath = function () {
82
+
83
+ categoryId = this.getCategoryId();
84
+
85
+ if (!categoryId) {
86
+ return false;
87
+ }
88
+
89
+ var refreshPathSuccess = function(transport) {
90
+ if (transport.responseText.isJSON()) {
91
+ response = transport.responseText.evalJSON()
92
+ if (response.error) {
93
+ alert(response.message);
94
+ } else {
95
+ if (categoryForm.getCategoryId() == response['id']) {
96
+ categoryForm.setCategoryPath(response['path']);
97
+ }
98
+ }
99
+ }
100
+ };
101
+
102
+ new Ajax.Request(
103
+ '<?php echo $this->getRefreshPathUrl() ?>',
104
+ {
105
+ method: 'POST',
106
+ evalScripts: true,
107
+ onSuccess: refreshPathSuccess
108
+ }
109
+ );
110
+
111
+ };
112
+
113
+ categoryForm.getCategoryId = function () {
114
+ collection = $(this.formId).getInputs('hidden','general[id]');
115
+ if (collection.size() > 0) {
116
+ return collection.first().value;
117
+ }
118
+ return false;
119
+ };
120
+
121
+ categoryForm.setCategoryPath = function (path) {
122
+ collection = $(this.formId).getInputs('hidden','general[path]');
123
+ if (collection.size() > 0) {
124
+ return collection.first().value = path;
125
+ }
126
+ };
127
+
128
+ /**
129
+ * Create/edit some category
130
+ */
131
+ function categorySubmit(url, useAjax) {
132
+ var activeTab = $('active_tab_id');
133
+ if (activeTab) {
134
+ if (activeTab.tabsJsObject && activeTab.tabsJsObject.activeTab) {
135
+ activeTab.value = activeTab.tabsJsObject.activeTab.id;
136
+ }
137
+ }
138
+
139
+ var params = {};
140
+ var fields = $('category_edit_form').getElementsBySelector('input', 'select');
141
+ for(var i=0;i<fields.length;i++){
142
+ if (!fields[i].name) {
143
+ continue;
144
+ }
145
+ params[fields[i].name] = fields[i].getValue();
146
+ }
147
+
148
+ // Get info about what we're submitting - to properly update tree nodes
149
+ var categoryId = params['general[id]'] ? params['general[id]'] : 0;
150
+ var isCreating = categoryId == 0; // Separate variable is needed because '0' in javascript converts to TRUE
151
+ var path = params['general[path]'].split('/');
152
+ var parentId = path.pop();
153
+ if (parentId == categoryId) { // Maybe path includes category id itself
154
+ parentId = path.pop();
155
+ }
156
+
157
+ // Make operations with category tree
158
+ if (isCreating) {
159
+ /* Some specific tasks for creating category */
160
+ if (!tree.currentNodeId) {
161
+ // First submit of form - select some node to be current
162
+ tree.currentNodeId = parentId;
163
+ }
164
+ tree.addNodeTo = parentId;
165
+ } else {
166
+ /* Some specific tasks for editing category */
167
+ // Maybe change category enabled/disabled style
168
+ if (tree && tree.storeId==0) {
169
+ var currentNode = tree.getNodeById(categoryId);
170
+
171
+ if (currentNode) {
172
+ if (parseInt(params['general[is_active]'])) {
173
+ var oldClass = 'no-active-category';
174
+ var newClass = 'active-category';
175
+ } else {
176
+ var oldClass = 'active-category';
177
+ var newClass = 'no-active-category';
178
+ }
179
+
180
+ Element.removeClassName(currentNode.ui.wrap.firstChild, oldClass);
181
+ Element.addClassName(currentNode.ui.wrap.firstChild, newClass);
182
+ }
183
+ }
184
+ }
185
+
186
+ // Submit form
187
+ categoryForm.submit();
188
+ }
189
+
190
+ <?php if(($block = $this->getLayout()->getBlock('category.product.grid')) && ($_gridJsObject=$block->getJsObjectName())): ?>
191
+
192
+ var categoryProducts = $H(<?php echo $this->getProductsJson() ?>);
193
+ $('in_category_products').value = categoryProducts.toQueryString();
194
+
195
+ function registerCategoryProduct(grid, element, checked){
196
+ if(checked){
197
+ if(element.positionElement){
198
+ element.positionElement.disabled = false;
199
+ categoryProducts.set(element.value, element.positionElement.value);
200
+ }
201
+ }
202
+ else{
203
+ if(element.positionElement){
204
+ element.positionElement.disabled = true;
205
+ }
206
+ categoryProducts.unset(element.value);
207
+ }
208
+ $('in_category_products').value = categoryProducts.toQueryString();
209
+ grid.reloadParams = {'selected_products[]':categoryProducts.keys()};
210
+ }
211
+ function categoryProductRowClick(grid, event){
212
+ var trElement = Event.findElement(event, 'tr');
213
+ var isInput = Event.element(event).tagName == 'INPUT';
214
+ if(trElement){
215
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
216
+ if(checkbox[0]){
217
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
218
+ <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
219
+ }
220
+ }
221
+ }
222
+ function positionChange(event){
223
+ var element = Event.element(event);
224
+ if(element && element.checkboxElement && element.checkboxElement.checked){
225
+ categoryProducts.set(element.checkboxElement.value, element.value);
226
+ $('in_category_products').value = categoryProducts.toQueryString();
227
+ }
228
+ }
229
+
230
+ var tabIndex = 1000;
231
+ function categoryProductRowInit(grid, row){
232
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
233
+ var position = $(row).getElementsByClassName('input-text')[0];
234
+ if(checkbox && position){
235
+ checkbox.positionElement = position;
236
+ position.checkboxElement = checkbox;
237
+ position.disabled = !checkbox.checked;
238
+ position.tabIndex = tabIndex++;
239
+ Event.observe(position,'keyup',positionChange);
240
+ }
241
+ }
242
+
243
+
244
+ <?php echo $_gridJsObject ?>.rowClickCallback = categoryProductRowClick;
245
+ <?php echo $_gridJsObject ?>.initRowCallback = categoryProductRowInit;
246
+ <?php echo $_gridJsObject ?>.checkboxCheckCallback = registerCategoryProduct;
247
+ <?php echo $_gridJsObject ?>.rows.each(function(row){categoryProductRowInit(<?php echo $_gridJsObject ?>, row)});
248
+
249
+ <?php endif; ?>
250
+ <?php if($this->isAjax() && ($block = $this->getLayout()->getBlock('tabs')) && ($_tabsJsObject=$block->getJsObjectName())): ?>
251
+ <?php echo $_tabsJsObject ?>.moveTabContentInDest();
252
+ if (<?php echo $_tabsJsObject ?>.activeTab) {
253
+ $('active_tab_id').value = <?php echo $_tabsJsObject ?>.activeTab.id;
254
+ }
255
+ $('active_tab_id').tabsJsObject = <?php echo $_tabsJsObject ?>;
256
+ <?php endif; ?>
257
+ //]]>
258
+ </script>
app/design/adminhtml/default/default/template/catalog/category/tree.phtml ADDED
@@ -0,0 +1,480 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="categories-side-col">
28
+ <div class="content-header">
29
+ <h3 class="icon-head head-categories"><?php echo Mage::helper('catalog')->__('Categories') ?></h3>
30
+ <?php if ($this->getRoot()): ?>
31
+ <?php echo $this->getAddRootButtonHtml() ?><br />
32
+ <?php echo $this->getAddSubButtonHtml() ?>
33
+ <?php endif; ?>
34
+ </div>
35
+ <?php echo $this->getStoreSwitcherHtml();?>
36
+ <div class="tree-actions">
37
+ <?php if($this->getRoot()): ?>
38
+ <?php //echo $this->getCollapseButtonHtml() ?>
39
+ <?php //echo $this->getExpandButtonHtml() ?>
40
+ <a href="#" onclick="tree.collapseTree(); return false;"><?php echo Mage::helper('catalog')->__('Collapse All'); ?></a> <span class="separator">|</span> <a href="#" onclick="tree.expandTree(); return false;"><?php echo Mage::helper('catalog')->__('Expand All'); ?></a>
41
+ <?php endif; ?>
42
+ </div>
43
+ <?php if ($this->getRoot()): ?>
44
+ <div class="tree-holder">
45
+ <div id="tree-div" style="width:100%; overflow:auto;"></div>
46
+ </div>
47
+ </div>
48
+ <script type="text/javascript">
49
+ //<![CDATA[
50
+ var tree;
51
+
52
+ /**
53
+ * Fix ext compatibility with prototype 1.6
54
+ */
55
+ Ext.lib.Event.getTarget = function(e) {
56
+ var ee = e.browserEvent || e;
57
+ return ee.target ? Event.element(ee) : null;
58
+ };
59
+
60
+ Ext.tree.TreePanel.Enhanced = function(el, config)
61
+ {
62
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
63
+ };
64
+
65
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
66
+
67
+ loadTree : function(config, firstLoad)
68
+ {
69
+ var parameters = config['parameters'];
70
+ var data = config['data'];
71
+
72
+ this.storeId = parameters['store_id'];
73
+
74
+ if ( this.storeId != 0 && $('add_root_category_button')) {
75
+ $('add_root_category_button').hide();
76
+ }
77
+
78
+ if ((typeof parameters['root_visible']) != 'undefined') {
79
+ this.rootVisible = parameters['root_visible']*1;
80
+ }
81
+
82
+ var root = new Ext.tree.TreeNode(parameters);
83
+
84
+ this.nodeHash = {};
85
+ this.setRootNode(root);
86
+
87
+ if (firstLoad) {
88
+ this.addListener('click', this.categoryClick);
89
+ this.addListener('beforenodedrop', categoryMove.createDelegate(this));
90
+ }
91
+
92
+ this.loader.buildCategoryTree(root, data);
93
+ this.el.dom.innerHTML = '';
94
+ // render the tree
95
+ this.render();
96
+ if (parameters['expanded']) {
97
+ this.expandAll();
98
+ } else {
99
+ root.expand();
100
+ }
101
+
102
+ var selectedNode = this.getNodeById(parameters['category_id']);
103
+ if (selectedNode) {
104
+ this.currentNodeId = parameters['category_id'];
105
+ }
106
+ this.selectCurrentNode();
107
+ },
108
+
109
+ request : function(url, params)
110
+ {
111
+ if (!params) {
112
+ if (category_info_tabsJsTabs.activeTab) {
113
+ var params = {active_tab_id:category_info_tabsJsTabs.activeTab.id};
114
+ }
115
+ else {
116
+ var params = {};
117
+ }
118
+ }
119
+ if (!params.form_key) {
120
+ params.form_key = FORM_KEY;
121
+ }
122
+ var result = new Ajax.Request(
123
+ url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ),
124
+ {
125
+ parameters: params,
126
+ method: 'post'
127
+ }
128
+ );
129
+
130
+ return result;
131
+ },
132
+
133
+ selectCurrentNode : function()
134
+ {
135
+ if (this.currentNodeId) {
136
+ var selectedNode = this.getNodeById(this.currentNodeId);
137
+ if ((typeof selectedNode.attributes.path)!='undefined') {
138
+ var path = selectedNode.attributes.path;
139
+ if (!this.storeId) {
140
+ path = '0/'+path;
141
+ }
142
+ this.selectPath(path);
143
+ } else {
144
+ this.getSelectionModel().select(selectedNode);
145
+ }
146
+ }
147
+ },
148
+
149
+ collapseTree : function()
150
+ {
151
+ this.collapseAll();
152
+
153
+ this.selectCurrentNode();
154
+
155
+ if (!this.collapsed) {
156
+ this.collapsed = true;
157
+ this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(false) ?>';
158
+ this.request(this.loader.dataUrl, false);
159
+ }
160
+ },
161
+
162
+ expandTree : function()
163
+ {
164
+ this.expandAll();
165
+ if (this.collapsed) {
166
+ this.collapsed = false;
167
+ this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(true) ?>';
168
+ this.request(this.loader.dataUrl, false);
169
+ }
170
+ },
171
+
172
+ categoryClick : function(node, e)
173
+ {
174
+ var baseUrl = '<?php echo $this->getEditUrl() ?>';
175
+ var urlExt = (this.storeId?'store/'+this.storeId+'/':'')+'id/'+node.id+'/';
176
+ var url = parseSidUrl(baseUrl, urlExt);
177
+
178
+ this.currentNodeId = node.id;
179
+ if (!this.useAjax) {
180
+ setLocation(url);
181
+ return;
182
+ }
183
+ if (category_info_tabsJsTabs.activeTab) {
184
+ var params = {active_tab_id:category_info_tabsJsTabs.activeTab.id};
185
+ }
186
+ updateContent(url, params);
187
+ }
188
+ });
189
+
190
+ function reRenderTree(event, switcher)
191
+ {
192
+ // re-render tree by store switcher
193
+ if (tree && event) {
194
+ var obj = event.target;
195
+ var newStoreId = obj.value * 1;
196
+ var storeParam = newStoreId ? 'store/'+newStoreId + '/' : '';
197
+
198
+ if (obj.switchParams) {
199
+ storeParam += obj.switchParams;
200
+ }
201
+ if (switcher.useConfirm) {
202
+ if (!confirm('<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Please confirm site switching. All data that hasn\'t been saved will be lost.')) ?>')){
203
+ obj.value = '<?php echo (int) $this->getStoreId() ?>';
204
+ return false;
205
+ }
206
+ }
207
+
208
+ if ($('add_root_category_button')) {
209
+ if (newStoreId == 0) {
210
+ $('add_root_category_button').show();
211
+ }
212
+ else {
213
+ $('add_root_category_button').hide();
214
+ }
215
+ }
216
+
217
+ // retain current selected category id
218
+ storeParam = storeParam + 'id/' + tree.currentNodeId + '/';
219
+ var url = tree.switchTreeUrl + storeParam;
220
+
221
+ // load from cache
222
+ // load from ajax
223
+ new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
224
+ parameters : {store: newStoreId, form_key: FORM_KEY},
225
+ method : 'post',
226
+ onComplete : function(transport) {
227
+ var response = eval('(' + transport.responseText + ')');
228
+ if (!response['parameters']) {
229
+ return false;
230
+ }
231
+
232
+ _renderNewTree(response, storeParam);
233
+ }
234
+ });
235
+ }
236
+ // render default tree
237
+ else {
238
+ _renderNewTree();
239
+ }
240
+ }
241
+
242
+ function _renderNewTree(config, storeParam)
243
+ {
244
+ if (!config) {
245
+ var config = defaultLoadTreeParams;
246
+ }
247
+ if (tree) {
248
+ tree.purgeListeners();
249
+ tree.el.dom.innerHTML = '';
250
+ }
251
+ tree = new Ext.tree.TreePanel.Enhanced('tree-div', newTreeParams);
252
+ tree.loadTree(config, true);
253
+
254
+ // try to select current category
255
+ var selectedNode = tree.getNodeById(config.parameters.category_id);
256
+ if (selectedNode) {
257
+ tree.currentNodeId = config.parameters.category_id;
258
+ }
259
+ tree.selectCurrentNode();
260
+
261
+ // update content area
262
+ var url = tree.editUrl;
263
+ if (storeParam) {
264
+ url = url + storeParam;
265
+ }
266
+ <?php if ($this->isClearEdit()):?>
267
+ if (selectedNode) {
268
+ url = url + 'id/' + config.parameters.category_id;
269
+ }
270
+ <?php endif;?>
271
+ updateContent(url);
272
+ }
273
+
274
+ Ext.onReady(function()
275
+ {
276
+ categoryLoader = new Ext.tree.TreeLoader({
277
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
278
+ });
279
+
280
+ categoryLoader.createNode = function(config) {
281
+ var node;
282
+ var _node = Object.clone(config);
283
+ if (config.children && !config.children.length) {
284
+ delete(config.children);
285
+ node = new Ext.tree.AsyncTreeNode(config);
286
+ } else {
287
+ node = new Ext.tree.TreeNode(config);
288
+ }
289
+
290
+ return node;
291
+ };
292
+
293
+ categoryLoader.buildCategoryTree = function(parent, config)
294
+ {
295
+ if (!config) return null;
296
+
297
+ if (parent && config && config.length){
298
+ for (var i = 0; i < config.length; i++) {
299
+ var node;
300
+ var _node = Object.clone(config[i]);
301
+ if (_node.children && !_node.children.length) {
302
+ delete(_node.children);
303
+ node = new Ext.tree.AsyncTreeNode(_node);
304
+ } else {
305
+ node = new Ext.tree.TreeNode(config[i]);
306
+ }
307
+ parent.appendChild(node);
308
+ node.loader = node.getOwnerTree().loader;
309
+ if (_node.children) {
310
+ this.buildCategoryTree(node, _node.children);
311
+ }
312
+ }
313
+ }
314
+ };
315
+
316
+ categoryLoader.buildHash = function(node)
317
+ {
318
+ var hash = {};
319
+
320
+ hash = this.toArray(node.attributes);
321
+
322
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
323
+ hash['children'] = new Array;
324
+
325
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
326
+ if (!hash['children']) {
327
+ hash['children'] = new Array;
328
+ }
329
+ hash['children'].push(this.buildHash(node.childNodes[i]));
330
+ }
331
+ }
332
+
333
+ return hash;
334
+ };
335
+
336
+ categoryLoader.toArray = function(attributes) {
337
+ var data = {form_key: FORM_KEY};
338
+ for (var key in attributes) {
339
+ var value = attributes[key];
340
+ data[key] = value;
341
+ }
342
+
343
+ return data;
344
+ };
345
+
346
+ categoryLoader.on("beforeload", function(treeLoader, node) {
347
+ treeLoader.baseParams.id = node.attributes.id;
348
+ treeLoader.baseParams.store = node.attributes.store;
349
+ treeLoader.baseParams.form_key = FORM_KEY;
350
+ });
351
+
352
+ categoryLoader.on("load", function(treeLoader, node, config) {
353
+ varienWindowOnload();
354
+ });
355
+
356
+ if ((typeof varienStoreSwitcher)!='undefined') {
357
+ varienStoreSwitcher.storeSelectorClickCallback = reRenderTree;
358
+ }
359
+
360
+ newTreeParams = {
361
+ animate : false,
362
+ loader : categoryLoader,
363
+ enableDD : true,
364
+ containerScroll : true,
365
+ selModel : new Ext.tree.CheckNodeMultiSelectionModel(),
366
+ rootVisible : '<?php echo $this->getRoot()->getIsVisible() ?>',
367
+ useAjax : <?php echo $this->getUseAjax() ?>,
368
+ switchTreeUrl : '<?php echo $this->getSwitchTreeUrl() ?>',
369
+ editUrl : '<?php echo $this->getEditUrl() ?>',
370
+ currentNodeId : <?php echo (int) $this->getCategoryId() ?>
371
+ };
372
+
373
+ defaultLoadTreeParams = {
374
+ parameters : {
375
+ text : '<?php echo Mage::helper('core')->jsQuoteEscape(htmlentities($this->getRoot()->getName())) ?>',
376
+ draggable : false,
377
+ allowDrop : <?php if ($this->getRoot()->getIsVisible()): ?>true<?php else : ?>false<?php endif; ?>,
378
+ id : <?php echo (int) $this->getRoot()->getId() ?>,
379
+ expanded : <?php echo (int) $this->getIsWasExpanded() ?>,
380
+ store_id : <?php echo (int) $this->getStore()->getId() ?>,
381
+ category_id : <?php echo (int) $this->getCategoryId() ?>
382
+ },
383
+ data : <?php echo $this->getTreeJson() ?>
384
+ };
385
+
386
+ reRenderTree();
387
+ });
388
+
389
+ function addNew(url, isRoot)
390
+ {
391
+ if (isRoot) {
392
+ tree.currentNodeId = tree.root.id;
393
+ }
394
+
395
+ if (/store\/\d+/.test(url)) {
396
+ url = url.replace(/store\/\d+/, "store/" + tree.storeId);
397
+ }
398
+ else {
399
+ url+= "store/" + tree.storeId + "/";
400
+ }
401
+
402
+ url+= 'parent/'+tree.currentNodeId;
403
+ updateContent(url);
404
+ }
405
+
406
+ function categoryMove(obj)
407
+ {
408
+ var data = {id: obj.dropNode.id, form_key: FORM_KEY};
409
+
410
+ data.point = obj.point;
411
+ switch (obj.point) {
412
+ case 'above' :
413
+ data.pid = obj.target.parentNode.id;
414
+ data.paid = obj.dropNode.parentNode.id;
415
+ if (obj.target.previousSibling) {
416
+ data.aid = obj.target.previousSibling.id;
417
+ } else {
418
+ data.aid = 0;
419
+ }
420
+ break;
421
+ case 'below' :
422
+ data.pid = obj.target.parentNode.id;
423
+ data.aid = obj.target.id;
424
+ break;
425
+ case 'append' :
426
+ data.pid = obj.target.id;
427
+ data.paid = obj.dropNode.parentNode.id;
428
+ if (obj.target.lastChild) {
429
+ data.aid = obj.target.lastChild.id;
430
+ } else {
431
+ data.aid = 0;
432
+ }
433
+ break;
434
+ default :
435
+ obj.cancel = true;
436
+ return obj;
437
+ }
438
+
439
+ var success = function(o) {
440
+ try {
441
+ if(o.responseText){
442
+ if(o.responseText==='SUCCESS'){
443
+ categoryForm.refreshPath();
444
+ } else {
445
+ alert(o.responseText);
446
+ location.reload();
447
+ }
448
+ }
449
+ }
450
+ catch(e) {
451
+ }
452
+ };
453
+
454
+ var failure = function(o) {
455
+ try {
456
+ console.log(o.statusText);
457
+ } catch (e2) {
458
+ alert(o.statusText);
459
+ }
460
+ location.reload();
461
+ };
462
+
463
+ var pd = [];
464
+ for(var key in data) {
465
+ pd.push(encodeURIComponent(key), "=", encodeURIComponent(data[key]), "&");
466
+ }
467
+ pd.splice(pd.length-1,1);
468
+ new Ajax.Request(
469
+ '<?php echo $this->getMoveUrl() ?>',
470
+ {
471
+ method: 'POST',
472
+ parameters: pd.join(""),
473
+ onSuccess : success,
474
+ onFailure : failure
475
+ }
476
+ );
477
+ }
478
+ //]]>
479
+ </script>
480
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/category/widget/tree.phtml ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php $_divId = 'tree' . $this->getId() ?>
29
+ <div id="<?php echo $_divId ?>" class="tree"></div>
30
+
31
+ <script type="text/javascript">
32
+ //<![CDATA[
33
+
34
+ var tree<?php echo $this->getId() ?>;
35
+
36
+ var useMassaction = <?php echo $this->getUseMassaction()?1:0; ?>;
37
+
38
+ var isAnchorOnly = <?php echo $this->getIsAnchorOnly()?1:0; ?>;
39
+
40
+ Ext.tree.TreePanel.Enhanced = function(el, config)
41
+ {
42
+ Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);
43
+ };
44
+
45
+ Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {
46
+
47
+ loadTree : function(config, firstLoad)
48
+ {
49
+ var parameters = config['parameters'];
50
+ var data = config['data'];
51
+
52
+ if ((typeof parameters['root_visible']) != 'undefined') {
53
+ this.rootVisible = parameters['root_visible']*1;
54
+ }
55
+
56
+ var root = new Ext.tree.TreeNode(parameters);
57
+
58
+ this.nodeHash = {};
59
+ this.setRootNode(root);
60
+
61
+ if (firstLoad) {
62
+ <?php if ($this->getNodeClickListener()): ?>
63
+ this.addListener('click', <?php echo $this->getNodeClickListener() ?>.createDelegate(this));
64
+ <?php endif; ?>
65
+ }
66
+
67
+ this.loader.buildCategoryTree(root, data);
68
+ this.el.dom.innerHTML = '';
69
+ // render the tree
70
+ this.render();
71
+ }
72
+ });
73
+
74
+ Ext.onReady(function()
75
+ {
76
+ var emptyNodeAdded = <?php echo ($this->getWithEmptyNode() ? 'false' : 'true') ?>;
77
+
78
+ var categoryLoader = new Ext.tree.TreeLoader({
79
+ dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'
80
+ });
81
+
82
+ categoryLoader.buildCategoryTree = function(parent, config)
83
+ {
84
+ if (!config) return null;
85
+
86
+
87
+ if (parent && config && config.length){
88
+ for (var i = 0; i < config.length; i++) {
89
+ var node;
90
+ if (useMassaction && config[i].is_anchor == isAnchorOnly) {
91
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
92
+ }
93
+ var _node = Object.clone(config[i]);
94
+
95
+ // Add empty node to reset category filter
96
+ if(!emptyNodeAdded) {
97
+ var empty = Object.clone(_node);
98
+ empty.text = '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('None')) ?>';
99
+ empty.children = [];
100
+ empty.id = 'none';
101
+ empty.path = '1/none';
102
+ empty.cls = 'leaf';
103
+ parent.appendChild(new Ext.tree.TreeNode(empty));
104
+ emptyNodeAdded = true;
105
+ }
106
+
107
+ if (_node.children && !_node.children.length) {
108
+ delete(_node.children);
109
+ node = new Ext.tree.AsyncTreeNode(_node);
110
+ } else {
111
+ node = new Ext.tree.TreeNode(config[i]);
112
+ }
113
+ parent.appendChild(node);
114
+ node.loader = node.getOwnerTree().loader;
115
+ node.loader = node.getOwnerTree().loader;
116
+ if (_node.children) {
117
+ this.buildCategoryTree(node, _node.children);
118
+ }
119
+ }
120
+ }
121
+ };
122
+
123
+ categoryLoader.createNode = function(config) {
124
+ var node;
125
+ if (useMassaction && config.is_anchor == isAnchorOnly) {
126
+ config.uiProvider = Ext.tree.CheckboxNodeUI;
127
+ }
128
+ var _node = Object.clone(config);
129
+ if (config.children && !config.children.length) {
130
+ delete(config.children);
131
+ node = new Ext.tree.AsyncTreeNode(config);
132
+ } else {
133
+ node = new Ext.tree.TreeNode(config);
134
+ }
135
+ return node;
136
+ };
137
+
138
+ categoryLoader.buildHash = function(node)
139
+ {
140
+ var hash = {};
141
+
142
+ hash = this.toArray(node.attributes);
143
+
144
+ if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {
145
+ hash['children'] = new Array;
146
+
147
+ for (var i = 0, len = node.childNodes.length; i < len; i++) {
148
+ if (!hash['children']) {
149
+ hash['children'] = new Array;
150
+ }
151
+ hash['children'].push(this.buildHash(node.childNodes[i]));
152
+ }
153
+ }
154
+
155
+ return hash;
156
+ };
157
+
158
+ categoryLoader.toArray = function(attributes) {
159
+ var data = {};
160
+ for (var key in attributes) {
161
+ var value = attributes[key];
162
+ data[key] = value;
163
+ }
164
+
165
+ return data;
166
+ };
167
+
168
+ categoryLoader.on("beforeload", function(treeLoader, node) {
169
+ treeLoader.baseParams.id = node.attributes.id;
170
+ });
171
+
172
+ tree<?php echo $this->getId() ?> = new Ext.tree.TreePanel.Enhanced('<?php echo $_divId ?>', {
173
+ animate: false,
174
+ loader: categoryLoader,
175
+ enableDD: false,
176
+ containerScroll: true,
177
+ rootVisible: '<?php echo $this->getRoot()->getIsVisible() ?>',
178
+ useAjax: true,
179
+ currentNodeId: <?php echo (int) $this->getCategoryId() ?>,
180
+ addNodeTo: false
181
+ });
182
+
183
+ if (useMassaction) {
184
+ tree<?php echo $this->getId() ?>.on('check', function(node) {
185
+ $('<?php echo $_divId; ?>').fire('node:changed', {node:node});
186
+ }, tree<?php echo $this->getId() ?>);
187
+ }
188
+
189
+ // set the root node
190
+ var parameters = {
191
+ text: 'Psw',
192
+ draggable: false,
193
+ id: <?php echo (int) $this->getRoot()->getId() ?>,
194
+ expanded: <?php echo (int) $this->getIsWasExpanded() ?>,
195
+ category_id: <?php echo (int) $this->getCategoryId() ?>
196
+ };
197
+
198
+ tree<?php echo $this->getId() ?>.loadTree({parameters:parameters, data:<?php echo $this->getTreeJson() ?>},true);
199
+
200
+ });
201
+ //]]>
202
+ </script>
app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element
30
+ */
31
+ ?>
32
+ <?php $_element = $this->getElement() ?>
33
+ <?php $this->checkFieldDisable() ?>
34
+ <?php
35
+ $elementToggleCode = $_element->getToggleCode() ? $_element->getToggleCode()
36
+ : 'toggleValueElements(this, this.parentNode.parentNode)';
37
+ ?>
38
+
39
+ <?php if ($_element->getType()=='hidden'): ?>
40
+ <tr>
41
+ <td class="hidden" colspan="100"><?php echo trim($_element->getElementHtml()) ?></td>
42
+ </tr>
43
+ <?php else: ?>
44
+ <tr>
45
+ <td class="label"><?php echo trim($this->getElementLabelHtml()) ?></td>
46
+ <td class="value">
47
+ <?php echo trim($this->getElementHtml()) ?>
48
+ <?php if ($_element->getNote()) : ?>
49
+ <p class="note"><?php echo $_element->getNote() ?></p>
50
+ <?php endif; ?>
51
+ </td>
52
+ <td class="scope-label"><span class="nobr"><?php echo $this->getScopeLabel() ?></span></td>
53
+ <?php if ($this->canDisplayUseDefault()): ?>
54
+ <td class="value use-default">
55
+ <input <?php if($_element->getReadonly()):?> disabled="disabled"<?php endif; ?> type="checkbox" name="use_default[]" id="<?php echo $_element->getHtmlId() ?>_default"<?php if ($this->usedDefault()): ?> checked="checked"<?php endif; ?> onclick="<?php echo $elementToggleCode; ?>" value="<?php echo $this->getAttributeCode() ?>"/>
56
+ <label for="<?php echo $_element->getHtmlId() ?>_default" class="normal"><?php echo $this->__('Use Default Value') ?></label>
57
+ </td>
58
+ <?php endif; ?>
59
+ </tr>
60
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/product.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * @see Mage_Adminhtml_Block_Catalog_Product
30
+ */
31
+ ?>
32
+ <div class="content-header">
33
+ <table cellspacing="0">
34
+ <tr>
35
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('catalog')->__('Manage Products') ?></h3></td>
36
+ <td class="a-right">
37
+ <?php echo $this->getButtonsHtml() ?>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ <?php if( !$this->isSingleStoreMode() ): ?>
43
+ <?php echo $this->getChildHtml('store_switcher');?>
44
+ <?php endif;?>
45
+ <div>
46
+ <?php echo $this->getGridHtml() ?>
47
+ </div>
app/design/adminhtml/default/default/template/catalog/product/attribute/js.phtml ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ function saveAndContinueEdit(){
30
+ disableElements('save');
31
+ var activeTab = product_attribute_tabsJsTabs.activeTab.id;
32
+ if (editForm.submit($('edit_form').action+'back/edit/tab/' + activeTab) == false) {
33
+ enableElements('save');
34
+ }
35
+ varienGlobalEvents.attachEventHandler('formValidateAjaxComplete', function (){
36
+ enableElements('save');
37
+ });
38
+ }
39
+
40
+ function saveAttribute(){
41
+ disableElements('save');
42
+ if (editForm.submit() == false){
43
+ enableElements('save');
44
+ }
45
+ varienGlobalEvents.attachEventHandler('formValidateAjaxComplete', function (){
46
+ enableElements('save');
47
+ });
48
+ }
49
+
50
+ function toggleApplyVisibility(select) {
51
+ if ($(select).value == 1) {
52
+ $(select).next('select').removeClassName('no-display');
53
+ $(select).next('select').removeClassName('ignore-validate');
54
+
55
+ } else {
56
+ $(select).next('select').addClassName('no-display');
57
+ $(select).next('select').addClassName('ignore-validate');
58
+ var options = $(select).next('select').options;
59
+ for( var i=0; i < options.length; i++) {
60
+ options[i].selected = false;
61
+ }
62
+ }
63
+ }
64
+
65
+ function checkOptionsPanelVisibility(){
66
+ if($('matage-options-panel')){
67
+ var panel = $('matage-options-panel');
68
+ if($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect')){
69
+ panel.show();
70
+ }
71
+ else {
72
+ panel.hide();
73
+ }
74
+ }
75
+ }
76
+
77
+ function bindAttributeInputType()
78
+ {
79
+ checkOptionsPanelVisibility();
80
+ switchDefaultValueField();
81
+ checkIsConfigurableVisibility();
82
+ if($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect' || $('frontend_input').value=='price')){
83
+ if($('is_filterable') && !$('is_filterable').getAttribute('readonly')){
84
+ $('is_filterable').disabled = false;
85
+ }
86
+ if($('is_filterable_in_search') && !$('is_filterable_in_search').getAttribute('readonly')){
87
+ $('is_filterable_in_search').disabled = false;
88
+ }
89
+ if($('backend_type') && $('backend_type').options){
90
+ for(var i=0;i<$('backend_type').options.length;i++){
91
+ if($('backend_type').options[i].value=='int') $('backend_type').selectedIndex = i;
92
+ }
93
+ }
94
+ }
95
+ else {
96
+ if($('is_filterable')){
97
+ $('is_filterable').selectedIndex=0;
98
+ $('is_filterable').disabled = true;
99
+ }
100
+ if($('is_filterable_in_search')){
101
+ $('is_filterable_in_search').disabled = true;
102
+ }
103
+ }
104
+
105
+ if ($('frontend_input') && ($('frontend_input').value=='multiselect'
106
+ || $('frontend_input').value=='gallery'
107
+ || $('frontend_input').value=='textarea')) {
108
+ if ($('used_for_sort_by')) {
109
+ $('used_for_sort_by').disabled = true;
110
+ }
111
+ }
112
+ else {
113
+ if ($('used_for_sort_by') && !$('used_for_sort_by').getAttribute('readonly')) {
114
+ $('used_for_sort_by').disabled = false;
115
+ }
116
+ }
117
+
118
+ setRowVisibility('is_wysiwyg_enabled', false);
119
+ setRowVisibility('is_html_allowed_on_front', false);
120
+
121
+ switch ($('frontend_input').value) {
122
+ case 'textarea':
123
+ setRowVisibility('is_wysiwyg_enabled', true);
124
+ if($('is_wysiwyg_enabled').value == '0'){
125
+ setRowVisibility('is_html_allowed_on_front', true);
126
+ $('is_html_allowed_on_front').disabled = false;
127
+ }
128
+ $('frontend_class').value = '';
129
+ $('frontend_class').disabled = true;
130
+ break;
131
+ case 'text':
132
+ setRowVisibility('is_html_allowed_on_front', true);
133
+ $('is_html_allowed_on_front').disabled = false;
134
+
135
+ if (!$('frontend_class').getAttribute('readonly')) {
136
+ $('frontend_class').disabled = false;
137
+ }
138
+ break;
139
+ case 'select':
140
+ case 'multiselect':
141
+ setRowVisibility('is_html_allowed_on_front', true);
142
+ $('is_html_allowed_on_front').disabled = false;
143
+ break;
144
+ default:
145
+ $('frontend_class').value = '';
146
+ $('frontend_class').disabled = true;
147
+ }
148
+
149
+ switchIsFilterable();
150
+ }
151
+
152
+ function switchIsFilterable()
153
+ {
154
+ if ($('is_filterable')) {
155
+ if ($('is_filterable').selectedIndex == 0) {
156
+ $('position').disabled = true;
157
+ } else {
158
+ if (!$('position').getAttribute('readonly')){
159
+ $('position').disabled = false;
160
+ }
161
+ }
162
+ }
163
+ }
164
+
165
+ function disableApplyToValue(value)
166
+ {
167
+ var applyToSelect = $('apply_to');
168
+ for (i=0;i<applyToSelect.options.length;i++) {
169
+ if (value == applyToSelect.options[i].value) {
170
+ applyToSelect.options[i].disabled = true;
171
+ applyToSelect.options[i].selected = false;
172
+ }
173
+ }
174
+ }
175
+
176
+ function switchDefaultValueField()
177
+ {
178
+ if (!$('frontend_input')) {
179
+ return;
180
+ }
181
+
182
+ var currentValue = $('frontend_input').value;
183
+
184
+ var defaultValueTextVisibility = false;
185
+ var defaultValueTextareaVisibility = false;
186
+ var defaultValueDateVisibility = false;
187
+ var defaultValueYesnoVisibility = false;
188
+ var scopeVisibility = true;
189
+
190
+ switch (currentValue) {
191
+ case 'select':
192
+ optionDefaultInputType = 'radio';
193
+ break;
194
+
195
+ case 'multiselect':
196
+ optionDefaultInputType = 'checkbox';
197
+ break;
198
+
199
+ case 'date':
200
+ defaultValueDateVisibility = true;
201
+ break;
202
+
203
+ case 'boolean':
204
+ defaultValueYesnoVisibility = true;
205
+ break;
206
+
207
+ case 'textarea':
208
+ defaultValueTextareaVisibility = true;
209
+ break;
210
+
211
+ case 'media_image':
212
+ defaultValueTextVisibility = false;
213
+ break;
214
+ case 'price':
215
+ scopeVisibility = false;
216
+ default:
217
+ defaultValueTextVisibility = true;
218
+ break;
219
+ }
220
+
221
+ var applyToSelect = $('apply_to');
222
+ switch (currentValue) {
223
+ <?php foreach (Mage::helper('catalog')->getAttributeDisabledTypes() as $type=>$disabled): ?>
224
+ case '<?php echo $type; ?>':
225
+ <?php foreach ($disabled as $one): ?>
226
+ disableApplyToValue('<?php echo $one; ?>');
227
+ <?php endforeach; ?>
228
+ break;
229
+ <?php endforeach; ?>
230
+ default:
231
+ for (i=0;i<applyToSelect.options.length;i++) {
232
+ applyToSelect.options[i].disabled = false;
233
+ }
234
+ break;
235
+ }
236
+
237
+ switch (currentValue) {
238
+ case 'media_image':
239
+ $('front_fieldset').previous().hide();
240
+ $('front_fieldset').hide();
241
+
242
+ setRowVisibility('is_required', false);
243
+ setRowVisibility('is_unique', false);
244
+ setRowVisibility('frontend_class', false);
245
+ break;
246
+
247
+ <?php foreach (Mage::helper('catalog')->getAttributeHiddenFields() as $type=>$fields): ?>
248
+ case '<?php echo $type; ?>':
249
+ <?php foreach ($fields as $one): ?>
250
+ <?php if ($one == '_front_fieldset'): ?>
251
+ $('front_fieldset').previous().hide();
252
+ $('front_fieldset').hide();
253
+ <?php elseif ($one == '_default_value'): ?>
254
+ defaultValueTextVisibility =
255
+ defaultValueTextareaVisibility =
256
+ defaultValueDateVisibility =
257
+ defaultValueYesnoVisibility = false;
258
+ <?php elseif ($one == '_scope'): ?>
259
+ scopeVisibility = false;
260
+ <?php else: ?>
261
+ setRowVisibility('<?php echo $one; ?>', false);
262
+ <?php endif; ?>
263
+ <?php endforeach; ?>
264
+ break;
265
+ <?php endforeach; ?>
266
+
267
+ default:
268
+ $('front_fieldset').previous().show();
269
+ $('front_fieldset').show();
270
+ setRowVisibility('is_required', true);
271
+ setRowVisibility('is_unique', true);
272
+ setRowVisibility('frontend_class', true);
273
+ setRowVisibility('is_configurable', true);
274
+ break;
275
+ }
276
+
277
+ setRowVisibility('default_value_text', defaultValueTextVisibility);
278
+ setRowVisibility('default_value_textarea', defaultValueTextareaVisibility);
279
+ setRowVisibility('default_value_date', defaultValueDateVisibility);
280
+ setRowVisibility('default_value_yesno', defaultValueYesnoVisibility);
281
+ setRowVisibility('is_global', scopeVisibility);
282
+
283
+ var elems = document.getElementsByName('default[]');
284
+ for (var i = 0; i < elems.length; i++) {
285
+ elems[i].type = optionDefaultInputType;
286
+ }
287
+ }
288
+
289
+ function setRowVisibility(id, isVisible)
290
+ {
291
+ if ($(id)) {
292
+ var td = $(id).parentNode;
293
+ var tr = $(td.parentNode);
294
+
295
+ if (isVisible) {
296
+ tr.show();
297
+ } else {
298
+ tr.blur();
299
+ tr.hide();
300
+ }
301
+ }
302
+ }
303
+
304
+ function checkIsConfigurableVisibility()
305
+ {
306
+ if (!$('is_configurable') || !$('is_global') || !$('frontend_input')) return;
307
+ if ($F('is_global')==1 && $F('frontend_input')=='select') {
308
+ setRowVisibility('is_configurable', true);
309
+ } else {
310
+ setRowVisibility('is_configurable', false);
311
+ }
312
+ }
313
+
314
+ function updateRequriedOptions()
315
+ {
316
+ if ($F('frontend_input')=='select' && $F('is_required')==1) {
317
+ $('option-count-check').addClassName('required-options-count');
318
+ } else {
319
+ $('option-count-check').removeClassName('required-options-count');
320
+ }
321
+ }
322
+
323
+ if($('frontend_input')){
324
+ Event.observe($('frontend_input'), 'change', updateRequriedOptions);
325
+ Event.observe($('frontend_input'), 'change', bindAttributeInputType);
326
+ Event.observe($('is_global'), 'change', checkIsConfigurableVisibility);
327
+ }
328
+
329
+ if ($('is_filterable')) {
330
+ Event.observe($('is_filterable'), 'change', switchIsFilterable);
331
+ }
332
+
333
+ if ($('is_required')) {
334
+ Event.observe($('is_required'), 'change', updateRequriedOptions);
335
+ }
336
+ bindAttributeInputType();
337
+ //]]>
338
+ </script>
app/design/adminhtml/default/default/template/catalog/product/attribute/new/created.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ var added = false;
29
+ function addAttribute(closeAfter) {
30
+ if(window.opener!=null && !added) {
31
+ window.opener.Product.AttributesBridge.addAttributeRow(<?php echo $this->getAttributesBlockJson() ?>);
32
+ added = true;
33
+ }
34
+
35
+ if(closeAfter)
36
+ {
37
+ closeWindow();
38
+ }
39
+ }
40
+
41
+ function closeWindow()
42
+ {
43
+ if (window.opener) {
44
+ window.opener.focus();
45
+ }
46
+ window.close();
47
+ }
48
+
49
+ addAttribute(false);
50
+ setTimeout(closeWindow, 3000);
51
+ </script>
52
+ <div class="a-center">
53
+ <?php echo $this->getCloseButtonHtml() ?>
54
+ </div>
app/design/adminhtml/default/default/template/catalog/product/attribute/options.phtml ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * Attribute options control
30
+ *
31
+ * @deprecated after 1.7.0.2 The file is moved
32
+ * @see Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
33
+ */
34
+ ?>
35
+ <div>
36
+ <ul class="messages">
37
+ <li class="notice-msg">
38
+ <ul>
39
+ <li><?php echo Mage::helper('catalog')->__('If you do not specify an option value for a specific store view then the default (Admin) value will be used.') ?></li>
40
+ </ul>
41
+ </li>
42
+ </ul>
43
+ </div>
44
+
45
+ <div class="entity-edit">
46
+ <div class="entry-edit-head">
47
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Manage Titles (Size, Color, etc.)') ?></h4>
48
+ </div>
49
+ <div class="box">
50
+ <div class="hor-scroll">
51
+ <table class="dynamic-grid" cellspacing="0" id="attribute-labels-table">
52
+ <tr>
53
+ <?php foreach ($this->getStores() as $_store): ?>
54
+ <th><?php echo $_store->getName() ?></th>
55
+ <?php endforeach; ?>
56
+ </tr>
57
+ <tr>
58
+ <?php $_labels = $this->getLabelValues() ?>
59
+ <?php foreach ($this->getStores() as $_store): ?>
60
+ <td>
61
+ <input class="input-text<?php if($_store->getId()==0): ?> required-option<?php endif; ?>" type="text" name="frontend_label[<?php echo $_store->getId() ?>]" value="<?php echo $this->escapeHtml($_labels[$_store->getId()]) ?>"<?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/>
62
+ </td>
63
+ <?php endforeach; ?>
64
+ </tr>
65
+ </table>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <br/>
70
+ <div class="entity-edit" id="matage-options-panel">
71
+ <div class="entry-edit-head">
72
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Manage Options (values of your attribute)') ?></h4>
73
+ </div>
74
+ <div class="box">
75
+ <div class="hor-scroll">
76
+ <table class="dynamic-grid" cellspacing="0" cellpadding="0">
77
+ <tr id="attribute-options-table">
78
+ <?php foreach ($this->getStores() as $_store): ?>
79
+ <th><?php echo $_store->getName() ?></th>
80
+ <?php endforeach; ?>
81
+ <th><?php echo Mage::helper('catalog')->__('Position') ?></th>
82
+ <th class="nobr a-center"><?php echo Mage::helper('catalog')->__('Is Default') ?></th>
83
+ <th>
84
+ <?php if (!$this->getReadOnly()):?>
85
+ <?php echo $this->getAddNewButtonHtml() ?>
86
+ <?php endif;?>
87
+ </th>
88
+ </tr>
89
+ <tr class="no-display template" id="row-template">
90
+ <?php foreach ($this->getStores() as $_store): ?>
91
+ <td><input name="option[value][{{id}}][<?php echo $_store->getId() ?>]" value="{{store<?php echo $_store->getId() ?>}}" class="input-text<?php if($_store->getId()==0): ?> required-option<?php endif; ?>" type="text" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/></td>
92
+ <?php endforeach; ?>
93
+ <td class="a-center"><input class="input-text" type="text" name="option[order][{{id}}]" value="{{sort_order}}" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/></td>
94
+ <td><input class="input-radio" type="radio" name="default[]" value="{{id}}" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/></td>
95
+ <td class="a-left">
96
+ <input type="hidden" class="delete-flag" name="option[delete][{{id}}]" value="" />
97
+ <?php if (!$this->getReadOnly()):?>
98
+ <?php echo $this->getDeleteButtonHtml() ?>
99
+ <?php endif;?>
100
+ </td>
101
+ </tr>
102
+ </table>
103
+ </div>
104
+ <input type="hidden" id="option-count-check" value="" />
105
+ </div>
106
+ </div>
107
+ <script type="text/javascript">
108
+ //<![CDATA[
109
+ var optionDefaultInputType = 'radio';
110
+
111
+ // IE removes quotes from element.innerHTML whenever it thinks they're not needed, which breaks html.
112
+ var templateText =
113
+ '<tr class="option-row">'+
114
+ <?php foreach ($this->getStores() as $_store): ?>
115
+ '<td><input name="option[value][{{id}}][<?php echo $_store->getId() ?>]" value="{{store<?php echo $_store->getId() ?>}}" class="input-text<?php if($_store->getId()==0): ?> required-option<?php endif; ?>" type="text" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/><\/td>'+
116
+ <?php endforeach; ?>
117
+ '<td><input class="input-text" type="text" name="option[order][{{id}}]" value="{{sort_order}}" <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/><\/td>'+
118
+ '<td class="a-center"><input class="input-radio" type="{{intype}}" name="default[]" value="{{id}}" {{checked}} <?php if ($this->getReadOnly()):?> disabled="disabled"<?php endif;?>/><\/td>'+
119
+ '<td class="a-left" id="delete_button_container_{{id}}">'+
120
+ '<input type="hidden" class="delete-flag" name="option[delete][{{id}}]" value="" />'+
121
+ <?php if (!$this->getReadOnly()):?>
122
+ '<?php echo Mage::helper('core')->jsQuoteEscape($this->getDeleteButtonHtml()) ?>'+
123
+ <?php endif;?>
124
+ '<\/td>'+
125
+ '<\/tr>';
126
+
127
+ var attributeOption = {
128
+ table : $('attribute-options-table'),
129
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
130
+ templateText : templateText,
131
+ itemCount : 0,
132
+ totalItems : 0,
133
+ isReadOnly: <?php echo (int)$this->getReadOnly(); ?>,
134
+ add : function(data) {
135
+ this.template = new Template(this.templateText, this.templateSyntax);
136
+ var isNewOption = false;
137
+ if(!data.id){
138
+ data = {};
139
+ data.id = 'option_'+this.itemCount;
140
+ isNewOption = true;
141
+ }
142
+ if (!data.intype)
143
+ data.intype = optionDefaultInputType;
144
+ Element.insert(this.table, {after: this.template.evaluate(data)});
145
+ if (isNewOption && !this.isReadOnly) {
146
+ this.enableNewOptionDeleteButton(data.id);
147
+ }
148
+ this.bindRemoveButtons();
149
+ this.itemCount++;
150
+ this.totalItems++;
151
+ this.updateItemsCountField();
152
+ },
153
+ remove : function(event){
154
+ var element = $(Event.findElement(event, 'tr')); // !!! Button already
155
+ // have table parent in safari
156
+ // Safari workaround
157
+ element.ancestors().each(function(parentItem){
158
+ if (parentItem.hasClassName('option-row')) {
159
+ element = parentItem;
160
+ throw $break;
161
+ } else if (parentItem.hasClassName('box')) {
162
+ throw $break;
163
+ }
164
+ });
165
+
166
+
167
+ if(element){
168
+ var elementFlags = element.getElementsByClassName('delete-flag');
169
+ if(elementFlags[0]){
170
+ elementFlags[0].value=1;
171
+ }
172
+
173
+ element.addClassName('no-display');
174
+ element.addClassName('template');
175
+ element.hide();
176
+ this.totalItems--;
177
+ this.updateItemsCountField();
178
+ }
179
+ },
180
+ updateItemsCountField: function() {
181
+ if (this.totalItems > 0) {
182
+ $('option-count-check').value = '1';
183
+ } else {
184
+ $('option-count-check').value = '';
185
+ }
186
+ },
187
+ enableNewOptionDeleteButton: function(id) {
188
+ $$('#delete_button_container_' + id + ' button').each(function(button) {
189
+ button.enable();
190
+ button.removeClassName('disabled');
191
+ });
192
+ },
193
+ bindRemoveButtons : function(){
194
+ var buttons = $$('.delete-option');
195
+ for(var i=0;i<buttons.length;i++){
196
+ if(!$(buttons[i]).binded){
197
+ $(buttons[i]).binded = true;
198
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
199
+ }
200
+ }
201
+ }
202
+
203
+ }
204
+ if($('row-template')){
205
+ $('row-template').remove();
206
+ }
207
+ attributeOption.bindRemoveButtons();
208
+
209
+ if($('add_new_option_button')){
210
+ Event.observe('add_new_option_button', 'click', attributeOption.add.bind(attributeOption));
211
+ }
212
+ Validation.addAllThese([
213
+ ['required-option', '<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Failed')) ?>', function(v) {
214
+ return !Validation.get('IsEmpty').test(v);
215
+ }]]);
216
+ Validation.addAllThese([
217
+ ['required-options-count', '<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Options is required')) ?>', function(v) {
218
+ return !Validation.get('IsEmpty').test(v);
219
+ }]]);
220
+ <?php foreach ($this->getOptionValues() as $_value): ?>
221
+ attributeOption.add(<?php echo $_value->toJson() ?>);
222
+ <?php endforeach; ?>
223
+ //]]>
224
+ </script>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/main.phtml ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-product-attribute-sets"><?php echo $this->escapeHtml($this->_getHeader()) ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getBackButtonHtml() ?>
33
+ <?php echo $this->getResetButtonHtml() ?>
34
+ <?php echo $this->getDeleteButtonHtml() ?>
35
+ <?php echo $this->getSaveButtonHtml() ?>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+ </div>
40
+ <table cellspacing="0" width="100%">
41
+ <tr>
42
+ <td width="360" style="border-right:1px solid #ddd; padding:0 23px 23px 0;" class="edit-attribute-set">
43
+ <?php echo $this->getSetFormHtml() ?>
44
+ </td>
45
+ <td width="320" style="border-right:1px solid #ddd; padding:0 23px 23px 23px;">
46
+ <div class="content-header skip-header">
47
+ <table cellspacing="0">
48
+ <tbody>
49
+ <tr>
50
+ <td><h3><?php echo Mage::helper('catalog')->__('Groups') ?></h3></td>
51
+ </tr>
52
+ </tbody>
53
+ </table>
54
+ </div>
55
+
56
+ <?php if (!$this->getIsReadOnly()): ?>
57
+ <p><?php echo $this->getAddGroupButton() ?>&nbsp;<?php echo $this->getDeleteGroupButton() ?></p>
58
+ <p class="note-block"><?php echo Mage::helper('catalog')->__('Double click on a group to rename it') ?></p>
59
+ <?php endif; ?>
60
+
61
+ <?php echo $this->getSetsFilterHtml() ?>
62
+ <?php echo $this->getGroupTreeHtml() ?>
63
+ </td>
64
+ <td style="padding:0 0 23px 23px;">
65
+ <div class="content-header skip-header">
66
+ <table cellspacing="0">
67
+ <tbody>
68
+ <tr>
69
+ <td><h3><?php echo Mage::helper('catalog')->__('Unassigned Attributes') ?></h3></td>
70
+ </tr>
71
+ </tbody>
72
+ </table>
73
+ </div>
74
+ <div id="tree-div2" style="height:400px; margin-top:5px;overflow:auto"></div>
75
+ <script type="text/javascript">
76
+ //<![CDATA[
77
+ var allowDragAndDrop = <?php echo ($this->getIsReadOnly() ? 'false' : 'true'); ?>;
78
+ var canEditGroups = <?php echo ($this->getIsReadOnly() ? 'false' : 'true'); ?>;
79
+
80
+ var TreePanels = function() {
81
+ // shorthand
82
+ var Tree = Ext.tree;
83
+
84
+ return {
85
+ init : function(){
86
+ // yui-ext tree
87
+
88
+ var tree = new Ext.tree.TreePanel('tree-div1', {
89
+ animate:false,
90
+ loader: false,
91
+ enableDD:allowDragAndDrop,
92
+ containerScroll: true,
93
+ rootVisible: false
94
+ });
95
+
96
+ // set the root node
97
+ this.root = new Ext.tree.TreeNode({
98
+ text: 'ROOT',
99
+ allowDrug:false,
100
+ allowDrop:true,
101
+ id:'1'
102
+ });
103
+
104
+ tree.setRootNode(this.root);
105
+ buildCategoryTree(this.root, <?php echo $this->getGroupTreeJson() ?>);
106
+ // render the tree
107
+ tree.render();
108
+ this.root.expand(false, false);
109
+ tree.expandAll();
110
+
111
+ this.ge = new Ext.tree.TreeEditor(tree, {
112
+ allowBlank:false,
113
+ blankText:'<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('A name is required')) ?>',
114
+ selectOnFocus:true,
115
+ cls:'folder'
116
+ });
117
+
118
+ this.root.addListener('beforeinsert', editSet.leftBeforeInsert);
119
+ this.root.addListener('beforeappend', editSet.leftBeforeInsert);
120
+
121
+ //this.ge.addListener('beforerender', editSet.editGroup);
122
+ this.ge.addListener('beforeshow', editSet.editGroup);
123
+ this.ge.addListener('beforecomplete', editSet.beforeRenameGroup);
124
+ //this.ge.addListener('startedit', editSet.editGroup);
125
+
126
+ //-------------------------------------------------------------
127
+
128
+ var tree2 = new Ext.tree.TreePanel('tree-div2', {
129
+ animate:false,
130
+ loader: false,
131
+ enableDD:allowDragAndDrop,
132
+ containerScroll: true,
133
+ rootVisible: false,
134
+ lines:false
135
+ });
136
+
137
+ // set the root node
138
+ this.root2 = new Ext.tree.TreeNode({
139
+ text: 'ROOT',
140
+ draggable:false,
141
+ id:'free'
142
+ });
143
+ tree2.setRootNode(this.root2);
144
+ buildCategoryTree(this.root2, <?php echo $this->getAttributeTreeJson() ?>);
145
+
146
+ this.root2.addListener('beforeinsert', editSet.rightBeforeInsert);
147
+ this.root2.addListener('beforeappend', editSet.rightBeforeAppend);
148
+
149
+ this.root2.addListener('append', editSet.rightAppend);
150
+ this.root2.addListener('remove', editSet.rightRemove);
151
+ // render the tree
152
+ tree2.render();
153
+ this.root2.expand(false, false);
154
+ tree2.expandAll();
155
+ },
156
+
157
+ rebuildTrees : function(){
158
+ editSet.req.attributes = new Array();
159
+ rootNode = TreePanels.root;
160
+ var gIterator = 0;
161
+ for( i in rootNode.childNodes ) {
162
+ if(rootNode.childNodes[i].id) {
163
+ var group = rootNode.childNodes[i];
164
+ editSet.req.groups[gIterator] = new Array(group.id, group.attributes.text.strip(), (gIterator+1));
165
+ var iterator = 0
166
+ for( j in group.childNodes ) {
167
+ iterator ++;
168
+ if( group.childNodes[j].id > 0 ) {
169
+ editSet.req.attributes[group.childNodes[j].id] = new Array(group.childNodes[j].id, group.id, iterator, group.childNodes[j].attributes.entity_id);
170
+ }
171
+ }
172
+ iterator = 0;
173
+ }
174
+ gIterator ++;
175
+ }
176
+
177
+ editSet.req.not_attributes = new Array();
178
+ rootNode = TreePanels.root2;
179
+
180
+ var iterator = 0;
181
+ for( i in rootNode.childNodes ) {
182
+ if(rootNode.childNodes[i].id) {
183
+ if( rootNode.childNodes[i].id > 0 ) {
184
+ editSet.req.not_attributes[iterator] = rootNode.childNodes[i].attributes.entity_id;
185
+ }
186
+ iterator ++;
187
+ }
188
+ }
189
+ }
190
+ };
191
+ }();
192
+
193
+ function buildCategoryTree(parent, config){
194
+ if (!config) return null;
195
+ if (parent && config && config.length){
196
+ for (var i = 0; i < config.length; i++) {
197
+ var node = new Ext.tree.TreeNode(config[i]);
198
+ parent.appendChild(node);
199
+ node.addListener('click', editSet.register);
200
+ node.addListener('beforemove', editSet.groupBeforeMove);
201
+ node.addListener('beforeinsert', editSet.groupBeforeInsert);
202
+ node.addListener('beforeappend', editSet.groupBeforeInsert);
203
+ if( config[i].children ) {
204
+ for( j in config[i].children ) {
205
+ if(config[i].children[j].id) {
206
+ newNode = new Ext.tree.TreeNode(config[i].children[j]);
207
+ node.appendChild(newNode);
208
+ newNode.addListener('click', editSet.unregister);
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
215
+
216
+ var editSet = function() {
217
+ return {
218
+ register : function(node) {
219
+ editSet.currentNode = node;
220
+ },
221
+
222
+ unregister : function() {
223
+ editSet.currentNode = false;
224
+ },
225
+
226
+ submit : function() {
227
+ if( TreePanels.root.firstChild == TreePanels.root.lastChild ) {
228
+ return;
229
+ }
230
+
231
+ if( editSet.SystemNodesExists(editSet.currentNode) ) {
232
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This group contains system attributes. Please move system attributes to another group and try again.')) ?>');
233
+ return;
234
+ }
235
+
236
+ if (editSet.ConfigurableNodeExists(editSet.currentNode)) {
237
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This group contains attributes, used in configurable products. Please move these attributes to another group and try again.')) ?>');
238
+ return;
239
+ }
240
+
241
+ if( editSet.currentNode && editSet.currentNode.attributes.cls == 'folder' ) {
242
+ TreePanels.root.removeChild(editSet.currentNode);
243
+ for( i in editSet.currentNode.childNodes ) {
244
+ if( editSet.currentNode.childNodes[i].id ) {
245
+ child = editSet.currentNode.childNodes[i];
246
+ newNode = new Ext.tree.TreeNode(child.attributes);
247
+
248
+ if( child.attributes.is_user_defined == 1 ) {
249
+ TreePanels.root2.appendChild(newNode);
250
+ }
251
+ }
252
+ }
253
+ editSet.req.removeGroups[editSet.currentNode.id] = editSet.currentNode.id;
254
+ editSet.currentNode = false;
255
+ }
256
+ },
257
+
258
+ SystemNodesExists : function(currentNode) {
259
+ for( i in currentNode.childNodes ) {
260
+ if( currentNode.childNodes[i].id ) {
261
+ child = editSet.currentNode.childNodes[i];
262
+ if( child.attributes.is_user_defined != 1 ) {
263
+ return true;
264
+ }
265
+ }
266
+ }
267
+ },
268
+
269
+ ConfigurableNodeExists : function(currentNode) {
270
+ for (var i in currentNode.childNodes ) {
271
+ if (currentNode.childNodes[i].id) {
272
+ child = editSet.currentNode.childNodes[i];
273
+ if (child.attributes.is_configurable) {
274
+ return true;
275
+ }
276
+ }
277
+ }
278
+ return false;
279
+ },
280
+
281
+ rightAppend : function(node) {
282
+ return;
283
+ },
284
+
285
+ addGroup : function() {
286
+ var group_name = prompt("<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Please enter a new group name')) ?>","");
287
+ group_name = group_name.strip();
288
+ if( group_name == '' ) {
289
+ this.addGroup();
290
+ } else if( group_name != false && group_name != null && group_name != '' ) {
291
+
292
+ if (!editSet.validateGroupName(group_name, 0)) {
293
+ return;
294
+ }
295
+
296
+ var newNode = new Ext.tree.TreeNode({
297
+ text : group_name.escapeHTML(),
298
+ cls : 'folder',
299
+ allowDrop : true,
300
+ allowDrag : true
301
+ });
302
+ TreePanels.root.appendChild(newNode);
303
+ newNode.addListener('beforemove', editSet.groupBeforeMove);
304
+ newNode.addListener('beforeinsert', editSet.groupBeforeInsert);
305
+ newNode.addListener('beforeappend', editSet.groupBeforeInsert);
306
+ newNode.addListener('click', editSet.register);
307
+ }
308
+ },
309
+
310
+ editGroup : function(obj) {
311
+ if( obj.editNode.attributes.cls != 'folder' || !canEditGroups) {
312
+ TreePanels.ge.cancelEdit();
313
+ return false;
314
+ }
315
+ },
316
+
317
+ beforeRenameGroup : function(obj, after, before) {
318
+ return editSet.validateGroupName(after, obj.editNode.id);
319
+ },
320
+
321
+ validateGroupName : function(name, exceptNodeId) {
322
+ name = name.strip();
323
+ if (name === '') {
324
+ return false;
325
+ }
326
+ for (var i=0; i < TreePanels.root.childNodes.length; i++) {
327
+ if (TreePanels.root.childNodes[i].text.toLowerCase() == name.toLowerCase() && TreePanels.root.childNodes[i].id != exceptNodeId) {
328
+ errorText = "<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Attribute group with the \"/name/\" name already exists')) ?>";
329
+ alert(errorText.replace("/name/",name));
330
+ return false;
331
+ }
332
+ }
333
+ return true;
334
+ },
335
+
336
+ save : function() {
337
+ $('messages').update();
338
+ TreePanels.rebuildTrees();
339
+ var _validator = new Validation('set_prop_form', {onSubmit:false});
340
+ if( !_validator.validate() ) {
341
+ return;
342
+ }
343
+ editSet.req.attribute_set_name = $('attribute_set_name').value;
344
+ if (!editSet.req.form_key) {
345
+ editSet.req.form_key = FORM_KEY;
346
+ }
347
+ var req = {data : Ext.util.JSON.encode(editSet.req)};
348
+ var con = new Ext.lib.Ajax.request('POST', '<?php echo $this->getMoveUrl() ?>', {success:editSet.success,failure:editSet.failure}, req);
349
+ },
350
+
351
+ success : function(o) {
352
+ var response = Ext.util.JSON.decode(o.responseText);
353
+ if( response.error ) {
354
+ $('messages').update(response.message);
355
+ } else if( response.ajaxExpired && response.ajaxRedirect ){
356
+ setLocation(response.ajaxRedirect);
357
+ } else if( response.url ){
358
+ setLocation(response.url);
359
+ } else if( response.message ) {
360
+ $('messages').update(response.message);
361
+ }
362
+ },
363
+
364
+ failure : function(o) {
365
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Unable to complete this request.')) ?>');
366
+ },
367
+
368
+ groupBeforeMove : function(tree, nodeThis, oldParent, newParent) {
369
+ if( newParent.attributes.cls == 'folder' && nodeThis.attributes.cls == 'folder' ) {
370
+ return false;
371
+ }
372
+
373
+ if( newParent == TreePanels.root && nodeThis.attributes.cls != 'folder' ) {
374
+ return false;
375
+ }
376
+ },
377
+
378
+ rightBeforeAppend : function(tree, nodeThis, node, newParent) {
379
+ if (node.attributes.is_user_defined == 0) {
380
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('You cannot remove system attribute from this set.')) ?>');
381
+ return false;
382
+ }
383
+ else if (node.attributes.is_configurable == 1) {
384
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>');
385
+ return false;
386
+ }
387
+ else {
388
+ return true;
389
+ }
390
+ },
391
+
392
+ rightBeforeInsert : function(tree, nodeThis, node, newParent) {
393
+ var empty = TreePanels.root2.findChild('id', 'empty');
394
+ if( empty ) {
395
+ return false;
396
+ }
397
+
398
+ if (node.attributes.is_user_defined == 0) {
399
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('You cannot remove system attribute from this set.')) ?>');
400
+ return false;
401
+ }
402
+ else if (node.attributes.is_configurable == 1) {
403
+ alert('<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>');
404
+ return false;
405
+ }
406
+ else {
407
+ return true;
408
+ }
409
+ },
410
+
411
+ groupBeforeInsert : function(tree, nodeThis, node, newParent) {
412
+ if( node.allowChildren ) {
413
+ return false;
414
+ }
415
+ },
416
+
417
+ rightAppend : function(tree, nodeThis, node) {
418
+ var empty = TreePanels.root2.findChild('id', 'empty');
419
+ if( empty && node.id != 'empty' ) {
420
+ TreePanels.root2.removeChild(empty);
421
+ }
422
+ },
423
+
424
+ rightRemove : function(tree, nodeThis, node) {
425
+ if( nodeThis.firstChild == null && node.id != 'empty' ) {
426
+ var newNode = new Ext.tree.TreeNode({
427
+ text : '<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Empty')) ?>',
428
+ id : 'empty',
429
+ cls : 'folder',
430
+ is_user_defined : 1,
431
+ allowDrop : false,
432
+ allowDrag : false
433
+ });
434
+ TreePanels.root2.appendChild(newNode);
435
+ }
436
+ },
437
+
438
+ leftBeforeInsert : function(tree, nodeThis, node, newParent) {
439
+ if( node.allowChildren == false ) {
440
+ return false;
441
+ }
442
+ }
443
+ }
444
+ }();
445
+
446
+ function initVars() {
447
+ editSet.req = {};
448
+ editSet.req.attributes = false;
449
+ editSet.req.groups = new Array();
450
+ editSet.req.not_attributes = false;
451
+ editSet.req.attribute_set_name = false;
452
+ editSet.req.removeGroups = new Array();
453
+ }
454
+
455
+ initVars();
456
+ Ext.EventManager.onDocumentReady(TreePanels.init, TreePanels, true);
457
+ //]]>
458
+ </script>
459
+ </td>
460
+ </tr>
461
+ </table>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/attribute.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ?>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/main/tree/group.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="tree-div1" style="width:320px;height:400px;margin-top:5px;overflow:auto"></div>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/add.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-product-attribute-sets"><?php echo $this->_getHeader() ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getBackButtonHtml() ?>
33
+ <?php echo $this->getSaveButtonHtml() ?>
34
+ </td>
35
+ </tr>
36
+ </table>
37
+ </div>
38
+ <?php echo $this->getFormHtml() ?>
39
+ <script type="text/javascript">
40
+ var addSet = new varienForm('<?php echo $this->getFormId() ?>');
41
+ </script>
app/design/adminhtml/default/default/template/catalog/product/attribute/set/toolbar/main.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-product-attribute-sets"><?php echo $this->_getHeader() ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getNewButtonHtml() ?>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ </div>
app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="popup-window-mask" style="display:none;"></div>
28
+ <div id="product_composite_configure" class="product-configure-popup" style="display:none;">
29
+ <iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe" src="#" style="width:0; height:0; border:0px solid #fff; position:absolute; top:-1000px; left:-1000px" onload="window.productConfigure && productConfigure.onLoadIFrame()"></iframe>
30
+ <form action="" method="post" id="product_composite_configure_form" enctype="multipart/form-data" onsubmit="productConfigure.onConfirmBtn(); return false;" target="product_composite_configure_iframe">
31
+ <div class="entry-edit">
32
+ <div class="entry-edit-head">
33
+ <h4 class="icon-head fieldset-legend"><?php echo Mage::helper('catalog')->__('Configure Product') ?></h4>
34
+ </div>
35
+ <div id="product_composite_configure_messages" style="display: none;" >
36
+ <ul class="messages"><li class="error-msg"></li></ul>
37
+ </div>
38
+ <div id="product_composite_configure_form_fields" class="content"></div>
39
+ <div id="product_composite_configure_form_additional" style="display:none;"></div>
40
+ <div id="product_composite_configure_form_confirmed" style="display:none;"></div>
41
+ <div class="buttons-set a-right">
42
+ <button type="button" class="scalable" onclick="productConfigure.onCancelBtn()" id="product_composite_configure_form_cancel"><span><span><span><?php echo Mage::helper('catalog')->__('Cancel') ?></span></span></span></button>
43
+ <button type="submit" class="scalable"><span><span><span><?php echo Mage::helper('catalog')->__('OK') ?></span></span></span></button>
44
+ </div>
45
+ </div>
46
+ <input type="hidden" name="as_js_varname" value="iFrameResponse" />
47
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey() ?>" />
48
+ </form>
49
+ <div id="product_composite_configure_confirmed" style="display:none;"></div>
50
+
51
+ <script type="text/javascript">
52
+ var productCompositeConfigureForm = new varienForm('product_composite_configure_form');
53
+ </script>
54
+ </div>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Configurable */ ?>
29
+ <?php $_product = $this->getProduct(); ?>
30
+ <?php $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes()); ?>
31
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
32
+ <?php if (($_product->isSaleable() || $_skipSaleableCheck) && count($_attributes)):?>
33
+ <div id="catalog_product_composite_configure_fields_configurable" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
34
+ <h4><?php echo Mage::helper('catalog')->__('Associated Products') ?></h4>
35
+ <div class="product-options">
36
+ <dl>
37
+ <?php foreach($_attributes as $_attribute): ?>
38
+ <dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
39
+ <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
40
+ <div class="input-box">
41
+ <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
42
+ <option><?php echo Mage::helper('catalog')->__('Choose an Option...') ?></option>
43
+ </select>
44
+ </div>
45
+ </dd>
46
+ <?php endforeach; ?>
47
+ </dl>
48
+ </div>
49
+ </div>
50
+ <script type="text/javascript">
51
+ var config = <?php echo $this->getJsonConfig() ?>;
52
+ if (window.productConfigure) {
53
+ config.containerId = window.productConfigure.blockFormFields.id;
54
+ if (window.productConfigure.restorePhase) {
55
+ config.inputsInitialized = true;
56
+ }
57
+ }
58
+ ProductConfigure.spConfig = new Product.Config(config);
59
+ </script>
60
+ <?php endif;?>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/grouped.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Grouped */ ?>
29
+ <?php $_skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck(); ?>
30
+ <div id="catalog_product_composite_configure_fields_grouped" class="grid <?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
31
+ <h4><?php echo Mage::helper('catalog')->__('Associated Products') ?></h4>
32
+ <div class="product-options">
33
+ <?php $_product = $this->getProduct(); ?>
34
+ <?php $this->setPreconfiguredValue(); ?>
35
+ <?php $_associatedProducts = $this->getAssociatedProducts(); ?>
36
+ <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
37
+ <?php if ((!$_product->isAvailable() && !$_skipSaleableCheck) || !$_hasAssociatedProducts): ?>
38
+ <p class="availability out-of-stock"><?php echo Mage::helper('catalog')->__('Availability:') ?> <span><?php echo Mage::helper('catalog')->__('Out of stock') ?></span></p>
39
+ <?php endif; ?>
40
+ <table class="data-table grouped-items-table" id="super-product-table">
41
+ <col />
42
+ <col />
43
+ <col />
44
+ <col />
45
+ <col width="1" />
46
+ <thead>
47
+ <tr "class="headings">
48
+ <th><?php echo Mage::helper('catalog')->__('ID') ?></th>
49
+ <th><?php echo Mage::helper('catalog')->__('SKU') ?></th>
50
+ <th><?php echo Mage::helper('catalog')->__('Product Name') ?></th>
51
+ <?php if ($this->getCanShowProductPrice($_product)): ?>
52
+ <th class="a-right"><?php echo Mage::helper('catalog')->__('Price') ?></th>
53
+ <?php endif; ?>
54
+ <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>
55
+ <th class="a-center"><?php echo Mage::helper('catalog')->__('Qty') ?></th>
56
+ <?php endif; ?>
57
+ </tr>
58
+ </thead>
59
+ <tbody>
60
+ <?php if ($_hasAssociatedProducts): ?>
61
+ <?php $i = 0 ?>
62
+ <?php foreach ($_associatedProducts as $_item): ?>
63
+ <?php $_finalPriceInclTax = $this->helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
64
+ <tr class="<?php echo (++$i % 2) ? 'even' : 'odd' ?>">
65
+ <td><?php echo $_item->getId() ?></td>
66
+ <td><?php echo $this->escapeHtml($_item->getSku()) ?></td>
67
+ <td><?php echo $this->escapeHtml($_item->getName()) ?></td>
68
+ <?php if ($this->getCanShowProductPrice($_product)): ?>
69
+ <td class="a-right">
70
+ <?php if ($this->getCanShowProductPrice($_item)): ?>
71
+ <?php echo $this->getPriceHtml($_item, true) ?>
72
+ <?php endif; ?>
73
+ </td>
74
+ <?php endif; ?>
75
+ <?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>
76
+ <td class="a-center">
77
+ <?php if ($_item->isSaleable() || $_skipSaleableCheck) : ?>
78
+ <input type="text" name="super_group[<?php echo $_item->getId() ?>]" id="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('catalog')->__('Qty')) ?>" class="input-text qty" />
79
+ <input type="hidden" value="1" price="<?php echo $this->getCurrencyPrice($_item->getPrice()) ?>" qtyId="super_group[<?php echo $_item->getId() ?>]" />
80
+ <?php else: ?>
81
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
82
+ <?php endif; ?>
83
+ </td>
84
+ <?php endif; ?>
85
+ </tr>
86
+ <?php endforeach; ?>
87
+ <?php else: ?>
88
+ <tr>
89
+ <td colspan="<?php if ($_product->isSaleable() || $_skipSaleableCheck): ?>4<?php else : ?>3<?php endif; ?>"><?php echo Mage::helper('catalog')->__('No options of this product are available.') ?></td>
90
+ </tr>
91
+ <?php endif; ?>
92
+ </tbody>
93
+ </table>
94
+ </div>
95
+ </div>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Options */ ?>
29
+ <?php $options = Mage::helper('core')->decorateArray($this->getOptions()); ?>
30
+ <?php if (count($options)): ?>
31
+
32
+ <?php echo $this->getChildHtml('options_js') ?>
33
+
34
+ <div id="product_composite_configure_fields_options" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
35
+ <h4><?php echo Mage::helper('catalog')->__('Custom Options') ?></h4>
36
+ <div class="product-options">
37
+ <dl>
38
+ <?php foreach($options as $option): ?>
39
+ <?php echo $this->getOptionHtml($option); ?>
40
+ <?php endforeach;?>
41
+ </dl>
42
+ </div>
43
+ </div>
44
+
45
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/js.phtml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <script type="text/javascript">
29
+ //<![CDATA[
30
+ validateOptionsCallback = function (elmId, result){
31
+ var container = $(elmId).up('ul.options-list');
32
+ if (!container) {
33
+ return;
34
+ }
35
+ if (result == 'failed') {
36
+ container.removeClassName('validation-passed');
37
+ container.addClassName('validation-failed');
38
+ } else {
39
+ container.removeClassName('validation-failed');
40
+ container.addClassName('validation-passed');
41
+ }
42
+ }
43
+
44
+ productConfigure.opConfig = {};
45
+
46
+ var DateOption = Class.create({
47
+
48
+ getDaysInMonth: function(month, year)
49
+ {
50
+ var curDate = new Date();
51
+ if (!month) {
52
+ month = curDate.getMonth();
53
+ }
54
+ if (2 == month && !year) { // leap year assumption for unknown year
55
+ return 29;
56
+ }
57
+ if (!year) {
58
+ year = curDate.getFullYear();
59
+ }
60
+ return 32 - new Date(year, month - 1, 32).getDate();
61
+ },
62
+
63
+ reloadMonth: function(event)
64
+ {
65
+ var selectEl = event.findElement();
66
+ var idParts = selectEl.id.split("_");
67
+ if (idParts.length != 3) {
68
+ return false;
69
+ }
70
+ var optionIdPrefix = idParts[0] + "_" + idParts[1];
71
+ var month = parseInt($(optionIdPrefix + "_month").value);
72
+ var year = parseInt($(optionIdPrefix + "_year").value);
73
+ var dayEl = $(optionIdPrefix + "_day");
74
+
75
+ var days = this.getDaysInMonth(month, year);
76
+
77
+ //remove days
78
+ for (var i = dayEl.options.length - 1; i >= 0; i--) {
79
+ if (dayEl.options[i].value > days) {
80
+ dayEl.remove(dayEl.options[i].index);
81
+ }
82
+ }
83
+
84
+ // add days
85
+ var lastDay = parseInt(dayEl.options[dayEl.options.length-1].value);
86
+ for (i = lastDay + 1; i <= days; i++) {
87
+ this.addOption(dayEl, i, i);
88
+ }
89
+ },
90
+
91
+ addOption: function(select, text, value)
92
+ {
93
+ var option = document.createElement('OPTION');
94
+ option.value = value;
95
+ option.text = text;
96
+
97
+ if (select.options.add) {
98
+ select.options.add(option);
99
+ } else {
100
+ select.appendChild(option);
101
+ }
102
+ }
103
+ });
104
+ productConfigure.opConfig.dateOption = new DateOption();
105
+ //]]>
106
+ </script>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/date.phtml ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Date */ ?>
28
+ <?php $_option = $this->getOption(); ?>
29
+ <?php $_optionId = $_option->getId(); ?>
30
+ <dt class="label"><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
31
+ <?php echo $this->getFormatedPrice() ?></dt>
32
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
33
+
34
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE_TIME
35
+ || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE): ?>
36
+
37
+ <?php echo $this->getDateHtml() ?>
38
+
39
+ <?php if (!$this->useCalendar()): ?>
40
+ <script type="text/javascript">
41
+ //<![CDATA[
42
+ var dateOption = productConfigure.opConfig.dateOption;
43
+ Event.observe('options_<?php echo $_optionId ?>_month', 'change', dateOption.reloadMonth.bind(dateOption));
44
+ Event.observe('options_<?php echo $_optionId ?>_year', 'change', dateOption.reloadMonth.bind(dateOption));
45
+ //]]>
46
+ </script>
47
+ <?php endif; ?>
48
+
49
+ <?php endif; ?>
50
+
51
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_DATE_TIME
52
+ || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_TIME): ?>
53
+ <span class="time-picker"><?php echo $this->getTimeHtml() ?></span>
54
+ <?php endif; ?>
55
+
56
+ <input type="hidden" name="validate_datetime_<?php echo $_optionId ?>" class="validate-datetime-<?php echo $_optionId ?>" value="" />
57
+ <script type="text/javascript">
58
+ //<![CDATA[
59
+ <?php if ($_option->getIsRequire()): ?>
60
+ Validation.addAllThese(
61
+ [
62
+ ['validate-datetime-<?php echo $_optionId ?>', '<?php echo $this->jsQuoteEscape( Mage::helper('catalog')->__('This is a required option') )?>', function(v) {
63
+ var dateTimeParts = $$('.datetime-picker[id^="options_<?php echo $_optionId ?>"]');
64
+ for (var i=0; i < dateTimeParts.length; i++) {
65
+ if (dateTimeParts[i].value == "") return false;
66
+ }
67
+ return true;
68
+ }]
69
+ ]
70
+ );
71
+ <?php else: ?>
72
+ Validation.add(
73
+ 'validate-datetime-<?php echo $_optionId ?>',
74
+ '<?php echo $this->jsQuoteEscape( Mage::helper('catalog')->__('Field is not complete') )?>',
75
+ function(v) {
76
+ var dateTimeParts = $$('.datetime-picker[id^="options_<?php echo $_optionId ?>"]');
77
+ var hasWithValue = false, hasWithNoValue = false;
78
+ var pattern = /day_part$/i;
79
+ for (var i=0; i < dateTimeParts.length; i++) {
80
+ if (! pattern.test(dateTimeParts[i].id)) {
81
+ if (dateTimeParts[i].value === "") {
82
+ hasWithValue = true;
83
+ } else {
84
+ hasWithNoValue = true;
85
+ }
86
+ }
87
+ }
88
+ return hasWithValue ^ hasWithNoValue;
89
+ }
90
+ );
91
+ <?php endif; ?>
92
+ //]]>
93
+ </script>
94
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/default.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Options */ ?>
28
+ <?php $option = $this->getOption(); ?>
29
+ <dt>
30
+ <label><?php echo $this->escapeHtml($option->getTitle()) ?></label>
31
+ </dt>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php $_option = $this->getOption(); ?>
28
+ <?php $_fileInfo = $this->getFileInfo(); ?>
29
+ <?php $_fileExists = $_fileInfo->hasData() ? true : false; ?>
30
+ <?php $_fileName = 'options_' . $_option->getId() . '_file'; ?>
31
+ <?php $_fieldNameAction = $_fileName . '_action'; ?>
32
+ <?php $_fieldValueAction = $_fileExists ? 'save_old' : 'save_new'; ?>
33
+ <?php $_fileNamed = $_fileName . '_name'; ?>
34
+ <?php $_rand = rand(); ?>
35
+
36
+ <script type="text/javascript">
37
+ //<![CDATA[
38
+ opFile<?php echo $_rand; ?> = {
39
+ initializeFile: function(inputBox) {
40
+ this.inputFile = inputBox.select('input[name="<?php echo $_fileName; ?>"]')[0];
41
+ this.inputFileAction = inputBox.select('input[name="<?php echo $_fieldNameAction; ?>"]')[0];
42
+ this.fileNameBox = inputBox.up('dd').select('.<?php echo $_fileNamed ?>')[0];
43
+ },
44
+
45
+ toggleFileChange: function(inputBox) {
46
+ this.initializeFile(inputBox);
47
+ inputBox.toggle();
48
+ this.fileChangeFlag = this.fileChangeFlag ? false : true;
49
+ if (!this.fileDeleteFlag) {
50
+ if (this.fileChangeFlag) {
51
+ this.inputFileAction.value = 'save_new';
52
+ this.inputFile.disabled = false;
53
+ } else {
54
+ this.inputFileAction.value = 'save_old';
55
+ this.inputFile.disabled = true;
56
+ }
57
+ }
58
+ },
59
+
60
+ toggleFileDelete: function(fileDeleteFlag, inputBox) {
61
+ this.initializeFile(inputBox);
62
+ this.fileDeleteFlag = fileDeleteFlag.checked ? true : false;
63
+ if (this.fileDeleteFlag) {
64
+ this.inputFileAction.value = '';
65
+ this.inputFile.disabled = true;
66
+ this.fileNameBox.setStyle({'text-decoration': 'line-through'});
67
+ } else {
68
+ this.inputFileAction.value = this.fileChangeFlag ? 'save_new' : 'save_old';
69
+ this.inputFile.disabled = (this.fileChangeFlag == 'save_old');
70
+ this.fileNameBox.setStyle({'text-decoration': 'none'});
71
+ }
72
+ }
73
+ };
74
+ //]]>
75
+ </script>
76
+
77
+ <dt><label <?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
78
+ <?php echo $this->getFormatedPrice() ?></dt>
79
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
80
+ <?php if ($_fileExists): ?>
81
+ <span class="<?php echo $_fileNamed ?>"><?php echo $_fileInfo->getTitle(); ?></span>
82
+ <a href="javascript:void(0)" class="label" onclick="opFile<?php echo $_rand; ?>.toggleFileChange($(this).next('.input-box'))">
83
+ <?php echo Mage::helper('catalog')->__('Change') ?>
84
+ </a>&nbsp;
85
+ <?php if (!$_option->getIsRequire()): ?>
86
+ <input type="checkbox" onclick="opFile<?php echo $_rand; ?>.toggleFileDelete($(this), $(this).next('.input-box'))" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>"/>
87
+ <span class="label"><?php echo Mage::helper('catalog')->__('Delete') ?></span>
88
+ <?php endif; ?>
89
+ <?php endif; ?>
90
+ <div class="input-box" <?php echo $_fileExists ? 'style="display:none"' : '' ?>>
91
+ <input type="file" name="<?php echo $_fileName; ?>" class="product-custom-option<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?>" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>" <?php echo $_fileExists ? 'disabled="disabled"' : '' ?>/>
92
+ <input type="hidden" name="<?php echo $_fieldNameAction; ?>" value="<?php echo $_fieldValueAction; ?>" />
93
+ <?php if ($_option->getFileExtension()): ?>
94
+ <p class="no-margin"><?php echo Mage::helper('catalog')->__('Allowed file extensions to upload')?>: <strong><?php echo $_option->getFileExtension() ?></strong></p>
95
+ <?php endif; ?>
96
+ <?php if ($_option->getImageSizeX() > 0): ?>
97
+ <p class="no-margin"><?php echo Mage::helper('catalog')->__('Maximum image width')?>: <strong><?php echo $_option->getImageSizeX() ?> <?php echo Mage::helper('catalog')->__('px.')?></strong></p>
98
+ <?php endif; ?>
99
+ <?php if ($_option->getImageSizeY() > 0): ?>
100
+ <p class="no-margin"><?php echo Mage::helper('catalog')->__('Maximum image height')?>: <strong><?php echo $_option->getImageSizeY() ?> <?php echo Mage::helper('catalog')->__('px.')?></strong></p>
101
+ <?php endif; ?>
102
+ </div>
103
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/select.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Select */ ?>
28
+ <?php $_option = $this->getOption(); ?>
29
+ <dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
30
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
31
+ <div class="input-box">
32
+ <?php echo $this->getValuesHtml() ?>
33
+ <?php if ($_option->getIsRequire()): ?>
34
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX): ?>
35
+ <span id="options-<?php echo $_option->getId() ?>-container"></span>
36
+ <?php endif; ?>
37
+ <?php endif;?>
38
+ </div>
39
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/text.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Text */ ?>
28
+ <?php $_option = $this->getOption(); ?>
29
+ <dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
30
+ <?php echo $this->getFormatedPrice() ?></dt>
31
+ <dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
32
+ <div class="input-box">
33
+ <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_FIELD): ?>
34
+ <input type="text" id="options_<?php echo $_option->getId() ?>_text" class="input-text<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-' . $_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" value="<?php echo $this->escapeHtml($this->getDefaultValue()) ?>" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>" />
35
+ <?php elseif ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_AREA): ?>
36
+ <textarea id="options_<?php echo $_option->getId() ?>_text" class="<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-' . $_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" rows="5" cols="25" price="<?php echo $this->getCurrencyPrice($_option->getPrice(true)) ?>"><?php echo $this->escapeHtml($this->getDefaultValue()) ?></textarea>
37
+ <?php endif; ?>
38
+ <?php if ($_option->getMaxCharacters()): ?>
39
+ <p class="note"><?php echo Mage::helper('catalog')->__('Maximum number of characters:')?> <strong><?php echo $_option->getMaxCharacters() ?></strong></p>
40
+ <?php endif; ?>
41
+ </div>
42
+ </dd>
app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/qty.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php /* @var $this Mage_Adminhtml_Block_Catalog_Product_Composite_Fieldset_Qty */ ?>
29
+
30
+ <div id="product_composite_configure_fields_qty" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>">
31
+ <div class="product-options">
32
+ <dl>
33
+ <dt><label><?php echo Mage::helper('catalog')->__('Quantity') ?></label> <input id="product_composite_configure_input_qty" class="input-text" type="text" name="qty" value="<?php echo $this->getQtyValue() * 1 ?>"></dt>
34
+ </dl>
35
+ </div>
36
+ </div>
app/design/adminhtml/default/default/template/catalog/product/created.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ var added = false;
29
+ function addProduct(closeAfter) {
30
+ if(window.opener!=null && !added) {
31
+ <?php if($this->isEdit()): ?>
32
+ window.opener.superProduct.updateProduct(<?php echo $this->getProductId() ?>, <?php echo $this->getAttributesJson(); ?>);
33
+ <?php else: ?>
34
+ window.opener.superProduct.addNewProduct(<?php echo $this->getProductId() ?>, <?php echo $this->getAttributesJson(); ?>);
35
+ window.opener.superProduct.showNoticeMessage();
36
+ <?php endif; ?>
37
+ added = true;
38
+ }
39
+
40
+ if(closeAfter)
41
+ {
42
+ closeWindow();
43
+ }
44
+ }
45
+
46
+ function closeWindow()
47
+ {
48
+ if (window.opener) {
49
+ window.opener.focus();
50
+ }
51
+ window.close();
52
+ }
53
+
54
+ addProduct(false);
55
+ setTimeout(closeWindow, 3000);
56
+ </script>
57
+ <div class="a-center">
58
+ <?php echo $this->getCloseButtonHtml() ?>
59
+ </div>
app/design/adminhtml/default/default/template/catalog/product/edit.phtml ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * Template for Mage_Adminhtml_Block_Catalog_Product_Edit
30
+ */
31
+ ?>
32
+
33
+
34
+
35
+ <div class="content-header">
36
+ <h3 class="icon-head head-products"><?php echo $this->getHeader() ?></h3>
37
+ <p class="content-buttons form-buttons"><?php echo $this->getBackButtonHtml() ?>
38
+ <?php echo $this->getCancelButtonHtml() ?>
39
+ <?php if($this->getProductId()): ?>
40
+ <?php echo $this->getDeleteButtonHtml() ?>
41
+ <?php if($this->getProductSetId() && $this->getIsConfigured()): ?>
42
+ <?php echo $this->getDuplicateButtonHtml() ?>
43
+ <?php endif; ?>
44
+ <?php endif; ?>
45
+ <?php if($this->getProductSetId() && $this->getIsConfigured()): ?>
46
+ <?php echo $this->getSaveButtonHtml() ?>
47
+ <?php echo $this->getSaveAndEditButtonHtml() ?>
48
+ <?php endif; ?>
49
+ </p>
50
+ </div>
51
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="product_edit_form" enctype="multipart/form-data">
52
+ <?php echo $this->getBlockHtml('formkey')?>
53
+ <div style="display:none"></div>
54
+ </form>
55
+ <script type="text/javascript">
56
+ //<![CDATA[
57
+ var productTemplateSyntax = /(^|.|\r|\n)({{(\w+)}})/;
58
+ var productForm = new varienForm('product_edit_form', '<?php echo $this->getValidationUrl() ?>');
59
+ productForm._processValidationResult = function(transport) {
60
+ var response = transport.responseText.evalJSON();
61
+ if (response.error){
62
+ if (response.attribute && $(response.attribute)) {
63
+ $(response.attribute).setHasError(true, productForm);
64
+ Validation.ajaxError($(response.attribute), response.message);
65
+ if (!Prototype.Browser.IE){
66
+ $(response.attribute).focus();
67
+ }
68
+ }
69
+ else if ($('messages')) {
70
+ $('messages').innerHTML = '<ul class="messages"><li class="error-msg"><ul><li>' + response.message + '</li></ul></li></ul>';
71
+ }
72
+ }
73
+ else{
74
+ productForm._submit();
75
+ }
76
+ };
77
+ function saveAndContinueEdit(urlTemplate) {
78
+ var template = new Template(urlTemplate, productTemplateSyntax);
79
+ var url = template.evaluate({tab_id:product_info_tabsJsTabs.activeTab.id});
80
+ productForm.submit(url);
81
+ }
82
+ function setSettings(urlTemplate, setElement, typeElement) {
83
+ var template = new Template(urlTemplate, productTemplateSyntax);
84
+ setLocation(template.evaluate({attribute_set:$F(setElement),type:$F(typeElement)}));
85
+ }
86
+
87
+ function setSuperSettings(urlTemplate, attributesClass, validateField) {
88
+ var attributesFields = $$('.' + attributesClass);
89
+ var attributes = Form.serializeElements(attributesFields, true).attribute;
90
+ if(typeof attributes == 'string') {
91
+ attributes = [attributes];
92
+ }
93
+
94
+ if(!attributes) {
95
+ $(validateField).value = 'no-attributes';
96
+ } else {
97
+ $(validateField).value = 'has-attributes';
98
+ }
99
+
100
+ if (productForm.validator.validate()) {
101
+ var template = new Template(urlTemplate, productTemplateSyntax);
102
+ var url = template.evaluate({
103
+ attributes: encode_base64(attributes.join(',')).replace(new RegExp('/','g'),'%2F').replace(new RegExp('=','g'),'%3D')
104
+ });
105
+ setLocation(url);
106
+ }
107
+ }
108
+
109
+ function checkMaxLength(Object, MaxLen)
110
+ {
111
+ if (Object.value.length > MaxLen-1) {
112
+ Object.value = Object.value.substr(0, MaxLen);
113
+ }
114
+ return 1;
115
+ }
116
+
117
+ Event.observe(window, 'load', function() {
118
+ var objName = '<?php echo $this->getSelectedTabId() ?>';
119
+ if (objName) {
120
+ obj = $(objName);
121
+ //IE fix (bubbling event model)
122
+ product_info_tabsJsTabs.setSkipDisplayFirstTab();
123
+ product_info_tabsJsTabs.showTabContent(obj);
124
+ }
125
+ Product.AttributesBridge.setTabsObject(product_info_tabsJsTabs);
126
+ });
127
+
128
+ Validation.addAllThese([
129
+ ['validate-super-product-attributes', '<?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Please select one or more attributes.')) ?>', function(v) {
130
+ return (v != "no-attributes");
131
+ }]]);
132
+ //]]>
133
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/action/attribute.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td><h3><?php echo Mage::helper('catalog')->__('Update attributes') ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php echo $this->getBackButtonHtml() ?>
33
+ <?php echo $this->getCancelButtonHtml() ?>
34
+ <?php echo $this->getSaveButtonHtml() ?>
35
+ </td>
36
+ </tr>
37
+ </table>
38
+ </div>
39
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="attributes_edit_form" enctype="multipart/form-data">
40
+ <?php echo $this->getBlockHtml('formkey')?>
41
+ </form>
42
+ <script type="text/javascript">
43
+ var attributesForm = new varienForm('attributes_edit_form', '<?php echo $this->getValidationUrl() ?>');
44
+ attributesForm._processValidationResult = function(transport) {
45
+ var response = transport.responseText.evalJSON();
46
+
47
+ if (response.error){
48
+ if (response.attribute && $(response.attribute)) {
49
+ $(response.attribute).setHasError(true, attributesForm);
50
+ Validation.ajaxError($(response.attribute), response.message);
51
+ if (!Prototype.Browser.IE){
52
+ $(response.attribute).focus();
53
+ }
54
+ } else if ($('messages')) {
55
+ $('messages').innerHTML = '<ul class="messages"><li class="error-msg"><ul><li>' + response.message + '</li></ul></li></ul>';
56
+ }
57
+ } else {
58
+ attributesForm._submit();
59
+ }
60
+ };
61
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/action/inventory.phtml ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ function toggleValueElementsWithCheckbox(checkbox) {
30
+ var td = $(checkbox.parentNode);
31
+ var checkboxes = td.getElementsBySelector('input[type="checkbox"]');
32
+ var inputs = td.getElementsBySelector('input[type!="checkbox"]', 'select', 'textarea');
33
+ if (checkboxes.size()>1) {
34
+ inputs.each(function(input){
35
+ input.disabled = (!checkbox.checked || checkboxes[0].checked);
36
+ checkboxes[0].disabled = !checkbox.checked;
37
+ });
38
+ } else {
39
+ inputs.each(function(input){
40
+ input.disabled = !checkbox.checked;
41
+ });
42
+ }
43
+ }
44
+ //]]>
45
+ </script>
46
+
47
+ <div class="entry-edit">
48
+ <div class="entry-edit-head">
49
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Inventory') ?></h4>
50
+ </div>
51
+ <fieldset>
52
+ <legend><?php echo Mage::helper('catalog')->__('Inventory') ?></legend>
53
+ <table cellspacing="0" class="form-list" id="table_cataloginventory">
54
+ <tr>
55
+ <td class="label"><label for="inventory_manage_stock"><?php echo Mage::helper('catalog')->__('Manage Stock') ?></label></td>
56
+ <td class="value"><select id="inventory_manage_stock" name="<?php echo $this->getFieldSuffix() ?>[manage_stock]" class="select" disabled="disabled">
57
+ <option value="1"><?php echo Mage::helper('catalog')->__('Yes') ?></option>
58
+ <option value="0"<?php if ($this->getConfigFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('No') ?></option>
59
+ </select>
60
+ <input name="<?php echo $this->getFieldSuffix() ?>[use_config_manage_stock]" type="checkbox" id="inventory_use_config_manage_stock" onclick="toggleValueElements(this, this.parentNode, $('inventory_manage_stock_checkbox'));" value="1" checked="checked" disabled="disabled" />
61
+ <label for="inventory_use_config_manage_stock" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
62
+ <input type="checkbox" id="inventory_manage_stock_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
63
+ <label for="inventory_manage_stock_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
64
+ </td>
65
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
66
+ </tr>
67
+ <tr>
68
+ <td class="label"><label for="inventory_qty"><?php echo Mage::helper('catalog')->__('Qty') ?><span class="required">*</span></label></td>
69
+ <td class="value">
70
+ <input type="text" class="input-text required-entry validate-number" id="inventory_qty" name="<?php echo $this->getFieldSuffix() ?>[qty]" value="<?php echo $this->getDefaultConfigValue('qty')*1 ?>" disabled="disabled" />
71
+ <input type="checkbox" id="inventory_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
72
+ <label for="inventory_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
73
+ </td>
74
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
75
+ </tr>
76
+ <tr>
77
+ <td class="label"><label for="inventory_min_qty"><?php echo Mage::helper('catalog')->__('Minimum Qty for Item\'s Status to be Out of Stock') ?></label></td>
78
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_min_qty" name="<?php echo $this->getFieldSuffix() ?>[min_qty]" value="<?php echo $this->getDefaultConfigValue('min_qty')*1 ?>" disabled="disabled" />
79
+ <input type="checkbox" id="inventory_use_config_min_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_min_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_min_qty_checkbox'));" checked="checked" disabled="disabled" />
80
+ <label for="inventory_use_config_min_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
81
+ <input type="checkbox" id="inventory_min_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
82
+ <label for="inventory_min_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
83
+ </td>
84
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
85
+ </tr>
86
+ <tr>
87
+ <td class="label"><label for="inventory_min_sale_qty"><?php echo Mage::helper('catalog')->__('Minimum Qty Allowed in Shopping Cart') ?></label></td>
88
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[min_sale_qty]" value="<?php echo $this->getDefaultConfigValue('min_sale_qty')*1 ?>" disabled="disabled" />
89
+ <input type="checkbox" id="inventory_use_config_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_min_sale_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_min_sale_qty_checkbox'));" checked="checked" disabled="disabled" />
90
+ <label for="inventory_use_config_min_sale_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
91
+ <input type="checkbox" id="inventory_min_sale_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
92
+ <label for="inventory_min_sale_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
93
+ </td>
94
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
95
+ </tr>
96
+ <tr>
97
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Maximum Qty Allowed in Shopping Cart') ?></label></td>
98
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_max_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[max_sale_qty]" value="<?php echo $this->getDefaultConfigValue('max_sale_qty')*1 ?>" disabled="disabled" />
99
+ <input type="checkbox" id="inventory_use_config_max_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_max_sale_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_max_sale_checkbox'));" checked="checked" disabled="disabled" />
100
+ <label for="inventory_use_config_max_sale_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
101
+ <input type="checkbox" id="inventory_max_sale_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
102
+ <label for="inventory_max_sale_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
103
+ </td>
104
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
105
+ </tr>
106
+ <tr>
107
+ <td class="label"><label for="inventory_is_qty_decimal"><?php echo Mage::helper('catalog')->__('Qty Uses Decimals') ?></label></td>
108
+ <td class="value"><select id="inventory_is_qty_decimal" name="<?php echo $this->getFieldSuffix() ?>[is_qty_decimal]" class="select" disabled="disabled">
109
+ <option value="0"><?php echo Mage::helper('catalog')->__('No') ?></option>
110
+ <option value="1"<?php if ($this->getDefaultConfigValue('is_qty_decimal')==1): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('Yes') ?></option>
111
+ </select>
112
+ <input type="checkbox" id="inventory_is_qty_decimal_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
113
+ <label for="inventory_is_qty_decimal_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
114
+ </td>
115
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
116
+ </tr>
117
+ <tr>
118
+ <td class="label"><label for="inventory_backorders"><?php echo Mage::helper('catalog')->__('Backorders') ?></label></td>
119
+ <td class="value"><select id="inventory_backorders" name="<?php echo $this->getFieldSuffix() ?>[backorders]" class="select" disabled="disabled">
120
+ <?php foreach ($this->getBackordersOption() as $option): ?>
121
+ <?php $_selected = ($option['value'] == $this->getDefaultConfigValue('backorders')) ? ' selected="selected"' : '' ?>
122
+ <option value="<?php echo $option['value'] ?>"<?php echo $_selected ?>><?php echo $option['label'] ?></option>
123
+ <?php endforeach; ?>
124
+ </select>
125
+ <input type="checkbox" id="inventory_use_config_backorders" name="<?php echo $this->getFieldSuffix() ?>[use_config_backorders]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_backorders_checkbox'));" checked="checked" disabled="disabled" />
126
+ <label for="inventory_use_config_backorders" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
127
+ <input type="checkbox" id="inventory_backorders_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
128
+ <label for="inventory_backorders_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
129
+ </td>
130
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
131
+ </tr>
132
+ <tr>
133
+ <td class="label"><label for="inventory_notify_stock_qty"><?php echo Mage::helper('catalog')->__('Notify for Quantity Below') ?></label></td>
134
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_notify_stock_qty" name="<?php echo $this->getFieldSuffix() ?>[notify_stock_qty]" value="<?php echo $this->getDefaultConfigValue('notify_stock_qty')*1 ?>" disabled="disabled" />
135
+ <input type="checkbox" id="inventory_use_config_notify_stock_qty" name="<?php echo $this->getFieldSuffix() ?>[use_config_notify_stock_qty]" value="1" onclick="toggleValueElements(this, this.parentNode, $('inventory_notify_stock_qty_checkbox'));" checked="checked" disabled="disabled" />
136
+ <label for="inventory_use_config_notify_stock_qty" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
137
+ <input type="checkbox" id="inventory_notify_stock_qty_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
138
+ <label for="inventory_notify_stock_qty_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
139
+ </td>
140
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
141
+ </tr>
142
+
143
+ <tr>
144
+ <td class="label"><label for="inventory_enable_qty_increments"><?php echo Mage::helper('catalog')->__('Enable Qty Increments') ?></label></td>
145
+ <td class="value"><select id="inventory_enable_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[enable_qty_increments]" class="select" disabled="disabled">
146
+ <option value="1"><?php echo Mage::helper('catalog')->__('Yes') ?></option>
147
+ <option value="0"<?php if ($this->getDefaultConfigValue('enable_qty_increments') == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('catalog')->__('No') ?></option>
148
+ </select>
149
+ <input type="checkbox" id="inventory_use_config_enable_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[use_config_enable_qty_increments]" value="1" onclick="toggleValueElements(this, this.parentNode, [$('inventory_enable_qty_increments_checkbox')]);" checked="checked" disabled="disabled" />
150
+ <label for="inventory_use_config_enable_qty_increments" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
151
+ <input type="checkbox" id="inventory_enable_qty_increments_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
152
+ <label for="inventory_enable_qty_increments_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
153
+ </td>
154
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
155
+ </tr>
156
+ <tr>
157
+ <td class="label"><label for="inventory_qty_increments"><?php echo Mage::helper('catalog')->__('Qty Increments') ?></label></td>
158
+ <td class="value">
159
+ <input type="text" class="input-text validate-number" id="inventory_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[qty_increments]" value="<?php echo $this->getDefaultConfigValue('qty_increments')*1 ?>" disabled="disabled" />
160
+ <input type="checkbox" id="inventory_use_config_qty_increments" name="<?php echo $this->getFieldSuffix() ?>[use_config_qty_increments]" value="1" onclick="toggleValueElements(this, this.parentNode, [$('inventory_qty_increments_checkbox')]);" checked="checked" disabled="disabled" />
161
+ <label for="inventory_use_config_qty_increments" class="normal"><?php echo Mage::helper('catalog')->__('Use Config Settings') ?></label>
162
+ <input type="checkbox" id="inventory_qty_increments_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
163
+ <label for="inventory_qty_increments_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
164
+ </td>
165
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
166
+ </tr>
167
+
168
+ <tr>
169
+ <td class="label"><label for="inventory_stock_availability"><?php echo Mage::helper('catalog')->__('Stock Availability') ?></label></td>
170
+ <td class="value"><select id="inventory_stock_availability" name="<?php echo $this->getFieldSuffix() ?>[is_in_stock]" class="select" disabled="disabled">
171
+ <option value="1"><?php echo Mage::helper('catalog')->__('In Stock') ?></option>
172
+ <option value="0"<?php if ($this->getDefaultConfigValue('is_in_stock')==0): ?> selected<?php endif; ?>><?php echo Mage::helper('catalog')->__('Out of Stock') ?></option>
173
+ </select>
174
+ <input type="checkbox" id="inventory_stock_availability_checkbox" onclick="toggleValueElementsWithCheckbox(this)" />
175
+ <label for="inventory_stock_availability_checkbox" class="normal"><?php echo Mage::helper('catalog')->__('Change') ?></label>
176
+ </td>
177
+ <td class="value scope-label"><?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?></td>
178
+ </tr>
179
+ </table>
180
+ </fieldset>
181
+ </div>
app/design/adminhtml/default/default/template/catalog/product/edit/action/websites.phtml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Add Product To Websites') ?></h4>
30
+ </div>
31
+ <fieldset id="grop_fields">
32
+ <?php foreach ($this->getWebsiteCollection() as $_website): ?>
33
+ <div>
34
+ <div class="website-name">
35
+ <input name="add_website_ids[]" value="<?php echo $_website->getId() ?>" <?php if($this->getWebsitesReadonly()): ?>disabled="disabled"<?php endif;?> class="checkbox website-checkbox" id="add_product_website_<?php echo $_website->getId() ?>" type="checkbox" />
36
+ <big><strong><label for="add_product_website_<?php echo $_website->getId() ?>"><?php echo $this->escapeHtml($_website->getName()) ?></label></strong></big>
37
+ </div>
38
+ <div class="webiste-groups" id="add_product_website_<?php echo $_website->getId() ?>_data">
39
+ <?php foreach ($this->getGroupCollection($_website) as $_group): ?>
40
+ <h4><?php echo $this->escapeHtml($_group->getName()) ?></h4>
41
+ <div class="group-stores">
42
+ <table>
43
+ <?php foreach ($this->getStoreCollection($_group) as $_store): ?>
44
+ <tr>
45
+ <td><?php echo $this->escapeHtml($_store->getName()) ?></td>
46
+ <td>&nbsp;</td>
47
+ </tr>
48
+ <?php endforeach; ?>
49
+ </table>
50
+ </div>
51
+ <?php endforeach; ?>
52
+ </div>
53
+ </div>
54
+ <?php endforeach; ?>
55
+ </fieldset>
56
+ </div>
57
+
58
+ <div class="entry-edit">
59
+ <div class="entry-edit-head">
60
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Remove Product From Websites') ?></h4>
61
+ </div>
62
+ <fieldset id="grop_fields">
63
+ <ul class="messages">
64
+ <li class="notice-msg">
65
+ <ul>
66
+ <li><?php echo Mage::helper('catalog')->__("Items that you do not want to show in the catalog or search results should have status 'Disabled' in the desired store.") ?></li>
67
+ </ul>
68
+ </li>
69
+ </ul>
70
+ <?php foreach ($this->getWebsiteCollection() as $_website): ?>
71
+ <div>
72
+ <div class="website-name">
73
+ <input name="remove_website_ids[]" value="<?php echo $_website->getId() ?>" <?php if($this->getWebsitesReadonly()): ?>disabled="disabled"<?php endif;?> class="checkbox website-checkbox" id="remove_product_website_<?php echo $_website->getId() ?>" type="checkbox"/>
74
+ <big><strong><label for="remove_product_website_<?php echo $_website->getId() ?>"><?php echo $this->escapeHtml($_website->getName()) ?></label></strong></big>
75
+ </div>
76
+ <div class="webiste-groups" id="remove_product_website_<?php echo $_website->getId() ?>_data">
77
+ <?php foreach ($this->getGroupCollection($_website) as $_group): ?>
78
+ <h4><?php echo $this->escapeHtml($_group->getName()) ?></h4>
79
+ <div class="group-stores">
80
+ <table>
81
+ <?php foreach ($this->getStoreCollection($_group) as $_store): ?>
82
+ <tr>
83
+ <td><?php echo $this->escapeHtml($_store->getName()) ?></td>
84
+ <td>&nbsp;</td>
85
+ </tr>
86
+ <?php endforeach; ?>
87
+ </table>
88
+ </div>
89
+ <?php endforeach; ?>
90
+ </div>
91
+ </div>
92
+ <?php endforeach; ?>
93
+ </fieldset>
94
+ </div>
95
+ <script type="text/javascript">
96
+ //<![CDATA[
97
+ var productWebsiteCheckboxes = $$('.website-checkbox');
98
+
99
+ for(var i=0;i<productWebsiteCheckboxes.length;i++){
100
+ Event.observe(productWebsiteCheckboxes[i], 'click', toggleStoreFromChoosers);
101
+ }
102
+
103
+ function toggleStoreFromChoosers(event){
104
+ var element = Event.element(event);
105
+ var selects = $(element.id+'_data').getElementsBySelector('select');
106
+ var selectBlocks = $(element.id+'_data').getElementsByClassName('website-'+element.value+'-select');
107
+ for (var i=0; i<selects.length; i++) {
108
+ selects[i].disabled=!element.checked;
109
+ }
110
+ for (var i=0; i<selectBlocks.length; i++) {
111
+ if (element.checked) {
112
+ selectBlocks[i].show();
113
+ }
114
+ else {
115
+ selectBlocks[i].hide();
116
+ }
117
+ }
118
+ }
119
+ //]]>
120
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="entry-edit">
28
+ <div class="entry-edit-head">
29
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Product Categories') ?></h4>
30
+ </div>
31
+ <fieldset id="grop_fields">
32
+ <input type="hidden" name="category_ids" id="product_categories" value="<?php echo $this->getIdsString() ?>">
33
+ <div id="product-categories" class="tree"></div>
34
+ </fieldset>
35
+ </div>
36
+ <?php if($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>
37
+ <script type="text/javascript">
38
+ Ext.EventManager.onDocumentReady(function() {
39
+ var categoryLoader = new Ext.tree.TreeLoader({
40
+ dataUrl: '<?php echo $this->getLoadTreeUrl()?>'
41
+ });
42
+
43
+ categoryLoader.createNode = function(config) {
44
+ config.uiProvider = Ext.tree.CheckboxNodeUI;
45
+ var node;
46
+ if (config.children && !config.children.length) {
47
+ delete(config.children);
48
+ node = new Ext.tree.AsyncTreeNode(config);
49
+
50
+ } else {
51
+ node = new Ext.tree.TreeNode(config);
52
+ }
53
+ return node;
54
+ };
55
+
56
+ categoryLoader.on("beforeload", function(treeLoader, node) {
57
+ treeLoader.baseParams.category = node.attributes.id;
58
+ });
59
+
60
+ categoryLoader.on("load", function(treeLoader, node, config) {
61
+ varienWindowOnload();
62
+ });
63
+
64
+ var tree = new Ext.tree.TreePanel('product-categories', {
65
+ animate:true,
66
+ loader: categoryLoader,
67
+ enableDD:false,
68
+ containerScroll: true,
69
+ rootUIProvider: Ext.tree.CheckboxNodeUI,
70
+ selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
71
+ rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'
72
+ });
73
+
74
+ tree.on('check', function(node) {
75
+ if(node.attributes.checked) {
76
+ categoryAdd(node.id);
77
+ } else {
78
+ categoryRemove(node.id);
79
+ }
80
+ varienElementMethods.setHasChanges(node.getUI().checkbox);
81
+ }, tree);
82
+
83
+ // set the root node
84
+ var root = new Ext.tree.TreeNode({
85
+ text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->getName()) ?>',
86
+ draggable:false,
87
+ checked:'<?php echo $this->getRootNode()->getChecked() ?>',
88
+ id:'<?php echo $this->getRootNode()->getId() ?>',
89
+ disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,
90
+ uiProvider: Ext.tree.CheckboxNodeUI
91
+ });
92
+
93
+ tree.setRootNode(root);
94
+ bildCategoryTree(root, <?php echo $this->getTreeJson() ?>);
95
+ tree.addListener('click', categoryClick.createDelegate(this));
96
+
97
+ // render the tree
98
+ tree.render();
99
+ root.expand();
100
+ //tree.expandAll();
101
+ });
102
+
103
+ function bildCategoryTree(parent, config){
104
+ if (!config) return null;
105
+
106
+ if (parent && config && config.length){
107
+ for (var i = 0; i < config.length; i++){
108
+ config[i].uiProvider = Ext.tree.CheckboxNodeUI;
109
+ var node;
110
+ var _node = Object.clone(config[i]);
111
+ if (_node.children && !_node.children.length) {
112
+ delete(_node.children);
113
+ node = new Ext.tree.AsyncTreeNode(_node);
114
+
115
+ } else {
116
+ node = new Ext.tree.TreeNode(config[i]);
117
+ }
118
+ parent.appendChild(node);
119
+ node.loader = node.getOwnerTree().loader;
120
+ if(config[i].children){
121
+ bildCategoryTree(node, config[i].children);
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ function categoryClick(node, e){
128
+ if (node.disabled) {
129
+ return;
130
+ }
131
+ node.getUI().check(!node.getUI().checked());
132
+ varienElementMethods.setHasChanges(Event.element(e), e);
133
+ };
134
+ function categoryAdd(id) {
135
+ var ids = $('product_categories').value.split(',');
136
+ ids.push(id);
137
+ $('product_categories').value = ids.join(',');
138
+ }
139
+ function categoryRemove(id) {
140
+ var ids = $('product_categories').value.split(',');
141
+ // bug #7654 fixed
142
+ while (-1 != ids.indexOf(id)) {
143
+ ids.splice(ids.indexOf(id), 1);
144
+ }
145
+ $('product_categories').value = ids.join(',');
146
+ }
147
+ </script>
148
+ <?php endif; ?>
app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class="entry-edit custom-options product-custom-options">
28
+ <div id="dynamic-price-warrning" style="display:none">
29
+ <ul class="messages">
30
+ <li class="error-msg">
31
+ <ul>
32
+ <li><?php echo $this->__('Bundle with dynamic pricing cannot include custom defined options. Options will not be saved.') ?></li>
33
+ </ul>
34
+ </li>
35
+ </ul>
36
+ </div>
37
+ <div class="entry-edit-head">
38
+ <h4><?php echo Mage::helper('catalog')->__('Custom Options') ?></h4>
39
+ <div class="right"><?php echo $this->getAddButtonHtml() ?></div>
40
+ </div>
41
+
42
+ <div id="product_options_container" class="box">
43
+ <div id="product_options_container_top"></div>
44
+ <?php echo $this->getOptionsBoxHtml() ?>
45
+ </div>
46
+ </div>
47
+
48
+ <script type="text/javascript">
49
+ // re-bind form elements onchange
50
+ varienWindowOnload(true);
51
+ //show error message
52
+ if ($('price_type')) {
53
+ if ($('price_type').value == '0' && $('dynamic-price-warrning')) {
54
+ $('dynamic-price-warrning').show();
55
+ }
56
+ }
57
+ </script>
app/design/adminhtml/default/default/template/catalog/product/edit/options/option.phtml ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php echo $this->getTemplatesHtml() ?>
28
+
29
+ <script type="text/javascript">
30
+ //<![CDATA[
31
+ var firstStepTemplate = '<div class="option-box" id="option_{{id}}">'+
32
+ '<table id="<?php echo $this->getFieldId() ?>_{{id}}" class="option-header" cellpadding="0" cellspacing="0">'+
33
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_is_delete" name="<?php echo $this->getFieldName() ?>[{{id}}][is_delete]" value="" />'+
34
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_previous_type" name="<?php echo $this->getFieldName() ?>[{{id}}][previous_type]" value="{{type}}" />'+
35
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_previous_group" name="<?php echo $this->getFieldName() ?>[{{id}}][previous_group]" value="" />'+
36
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_id" name="<?php echo $this->getFieldName() ?>[{{id}}][id]" value="{{id}}" />'+
37
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_option_id" name="<?php echo $this->getFieldName() ?>[{{id}}][option_id]" value="{{option_id}}" />'+
38
+ '<thead>'+
39
+ '<tr>'+
40
+ '<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Title')) ?> <span class="required">*</span></th>'+
41
+ '<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Input Type')) ?> <span class="required">*</span></th>'+
42
+ '<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Is Required')) ?></th>'+
43
+ '<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Sort Order')) ?></th>'+
44
+ '<th class="a-right"><?php echo $this->jsQuoteEscape($this->jsQuoteEscape($this->getDeleteButtonHtml())) ?></th>'+
45
+ '</tr>'+
46
+ '</thead>'+
47
+ '<tr>'+
48
+ '<td><input type="text" class="required-entry input-text" id="<?php echo $this->getFieldId() ?>_{{id}}_title" name="<?php echo $this->getFieldName() ?>[{{id}}][title]" value="{{title}}">{{checkboxScopeTitle}}</td>'+
49
+ '<td><?php echo $this->getTypeSelectHtml() ?></td>'+
50
+ '<td class="opt-req"><?php echo $this->getRequireSelectHtml() ?></td>'+
51
+ '<td><input type="text" class="validate-zero-or-greater input-text" name="<?php echo $this->getFieldName() ?>[{{id}}][sort_order]" value="{{sort_order}}"></td>'+
52
+ '<td>&nbsp;</td>'+
53
+ '</tr></table></div>';
54
+
55
+ var productOption = {
56
+ div : $('product_options_container_top'),
57
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
58
+ templateText : firstStepTemplate,
59
+ itemCount : 1,
60
+ add : function(data) {
61
+ this.template = new Template(this.templateText, this.templateSyntax);
62
+
63
+ if(!data.id){
64
+ data = {};
65
+ data.id = this.itemCount;
66
+ data.type = '';
67
+ data.option_id = 0;
68
+ } else {
69
+ this.itemCount = data.item_count;
70
+ }
71
+
72
+ Element.insert(this.div, {'after':this.template.evaluate(data)});
73
+
74
+ //set selected type
75
+ if (data.type) {
76
+ $A($('<?php echo $this->getFieldId() ?>_'+data.id+'_type').options).each(function(option){
77
+ if (option.value==data.type) option.selected = true;
78
+ });
79
+ }
80
+
81
+ //set selected is_require
82
+ if (data.is_require) {
83
+ $A($('<?php echo $this->getFieldId() ?>_'+data.id+'_is_require').options).each(function(option){
84
+ if (option.value==data.is_require) option.selected = true;
85
+ });
86
+ }
87
+
88
+ if (data.checkboxScopeTitle) {
89
+ //set disabled
90
+ if ($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_title') && data.scopeTitleDisabled) {
91
+ $('<?php echo $this->getFieldId() ?>_'+data.option_id+'_title').disable();
92
+ }
93
+ }
94
+
95
+ this.itemCount++;
96
+ this.bindRemoveButtons();
97
+ productOptionType.bindSelectInputType();
98
+ },
99
+ remove : function(event){
100
+ var element = $(Event.findElement(event, 'div'));
101
+ if(element){
102
+ $('product_'+element.readAttribute('id')+'_'+'is_delete').value = '1';
103
+ element.addClassName('no-display');
104
+ element.addClassName('ignore-validate');
105
+ element.hide();
106
+ }
107
+ },
108
+ bindRemoveButtons : function(){
109
+ var buttons = $$('div.product-custom-options .delete-product-option');
110
+ for(var i=0;i<buttons.length;i++){
111
+ if(!$(buttons[i]).binded){
112
+ $(buttons[i]).binded = true;
113
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
114
+ }
115
+ }
116
+ var inputs = $$('div.product-custom-options button', 'div.product-custom-options input', 'div.product-custom-options select', 'div.product-custom-options textarea');
117
+ <?php if ($this->isReadonly()):?>
118
+ for (var i=0, l = inputs.length; i < l; i ++) {
119
+ inputs[i].disabled = true;
120
+ if (inputs[i].tagName.toLowerCase()=='button') {
121
+ inputs[i].addClassName('disabled');
122
+ }
123
+ }
124
+ <?php else: ?>
125
+ inputs.each(function(el) { Event.observe(el, 'change', el.setHasChanges.bind(el)); } )
126
+ <?php endif;?>
127
+ }
128
+ }
129
+
130
+
131
+ var productOptionType = {
132
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
133
+ loadStepTwo : function(event){
134
+ var element = $(Event.findElement(event, 'select'));
135
+
136
+ var group = '';
137
+ var previousGroupElm = $(element.readAttribute('id').sub('_type', '_previous_group'));
138
+
139
+ switch(element.getValue()){
140
+ case 'field':
141
+ case 'area':
142
+ template = OptionTemplateText;
143
+ group = 'text';
144
+ break;
145
+ case 'file':
146
+ template = OptionTemplateFile;
147
+ group = 'file';
148
+ break;
149
+ case 'drop_down':
150
+ case 'radio':
151
+ case 'checkbox':
152
+ case 'multiple':
153
+ template = OptionTemplateSelect;
154
+ group = 'select';
155
+ break;
156
+ case 'date':
157
+ case 'date_time':
158
+ case 'time':
159
+ template = OptionTemplateDate;
160
+ group = 'date';
161
+ break;
162
+ default:
163
+ template = '';
164
+ group = 'unknown';
165
+ break;
166
+ }
167
+
168
+ if (previousGroupElm.getValue() != group) {
169
+ if ($(element.readAttribute('id')+'_'+previousGroupElm.getValue())) {
170
+ formElm = $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).descendants();
171
+ formElm.each(function(elm){
172
+ if (elm.tagName == 'input' || elm.tagName == 'select') {
173
+ elm.name = '__delete__'+elm.readAttribute('name');
174
+ }
175
+ });
176
+
177
+ $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).addClassName('no-display');
178
+ $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).addClassName('ignore-validate');
179
+ $(element.readAttribute('id')+'_'+previousGroupElm.getValue()).hide();
180
+ }
181
+
182
+ previousGroupElm.value = group;
183
+
184
+ if ($(element.readAttribute('id')+'_'+group)) {
185
+ formElm = $(element.readAttribute('id')+'_'+group).descendants();
186
+ formElm.each(function(elm){
187
+ if (elm.match('input') || elm.match('select')) {
188
+ elm.name = elm.readAttribute('name').sub('__delete__', '');
189
+ }
190
+ });
191
+ $(element.readAttribute('id')+'_'+group).removeClassName('no-display');
192
+ $(element.readAttribute('id')+'_'+group).removeClassName('ignore-validate');
193
+ $(element.readAttribute('id')+'_'+group).show();
194
+
195
+ } else {
196
+ template = '<div id="'+element.readAttribute('id')+'_'+group+'" class="grid tier form-list">'+template+'</div><div id="'+element.readAttribute('id')+'_'+group+'_advice"></div';
197
+ this.secondTemplate = new Template(template, this.templateSyntax);
198
+
199
+ data = {};
200
+ if (!data.option_id) {
201
+ data = {};
202
+ data.option_id = $(element.readAttribute('id').sub('_type', '_id')).getValue();
203
+ }
204
+
205
+ Element.insert(element.readAttribute('id').sub('_type', ''), {'after':this.secondTemplate.evaluate(data)});
206
+
207
+ switch(element.getValue()){
208
+ case 'drop_down':
209
+ case 'radio':
210
+ case 'checkbox':
211
+ case 'multiple':
212
+ selectOptionType.bindAddButton();
213
+ break;
214
+ }
215
+ }
216
+ }
217
+ },
218
+ addDataToValues : function(data){
219
+
220
+ switch(data.type){
221
+ case 'field':
222
+ case 'area':
223
+ template = OptionTemplateText;
224
+ group = 'text';
225
+ break;
226
+ case 'file':
227
+ template = OptionTemplateFile;
228
+ group = 'file';
229
+ break;
230
+ case 'drop_down':
231
+ case 'radio':
232
+ case 'checkbox':
233
+ case 'multiple':
234
+ template = OptionTemplateSelect;
235
+ group = 'select';
236
+ break;
237
+ case 'date':
238
+ case 'date_time':
239
+ case 'time':
240
+ template = OptionTemplateDate;
241
+ group = 'date';
242
+ break;
243
+ }
244
+
245
+ $('<?php echo $this->getFieldId() ?>_'+data.id+'_previous_group').value = group;
246
+
247
+ template = '<div id="<?php echo $this->getFieldId() ?>_{{id}}_type_'+group+'" class="grid tier form-list">'+template+'</div><div id="<?php echo $this->getFieldId() ?>_{{id}}_type_'+group+'_advice"></div>';
248
+
249
+ this.secondTemplate = new Template(template, this.templateSyntax);
250
+
251
+ Element.insert($('<?php echo $this->getFieldId() ?>_'+data.option_id), {'after':this.secondTemplate.evaluate(data)});
252
+
253
+ if (data.checkboxScopePrice) {
254
+ //set disabled
255
+ if ($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price') && data.scopePriceDisabled) {
256
+ $('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price').disable();
257
+ $('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price_type').disable();
258
+ }
259
+ }
260
+
261
+ switch(data.type){
262
+ case 'drop_down':
263
+ case 'radio':
264
+ case 'checkbox':
265
+ case 'multiple':
266
+ data.optionValues.each(function(value) {
267
+ selectOptionType.add(value);
268
+ });
269
+ selectOptionType.bindAddButton();
270
+ break;
271
+ }
272
+
273
+ if (data.price_type) {
274
+ $A($('<?php echo $this->getFieldId() ?>_'+data.option_id+'_price_type').options).each(function(option){
275
+ if (option.value==data.price_type) option.selected = true;
276
+ });
277
+ }
278
+
279
+ },
280
+ bindSelectInputType : function(){
281
+ var types = $$('.select-product-option-type');
282
+ for(var i=0;i<types.length;i++){
283
+ if(!$(types[i]).binded){
284
+ $(types[i]).binded = true;
285
+ Event.observe(types[i], 'change', function(event){
286
+ productOptionType.loadStepTwo(event);
287
+ });
288
+ }
289
+ }
290
+ }
291
+ }
292
+
293
+ var productOptionScope = {
294
+ addScope : function(event){
295
+ var element = $(Event.element(event));
296
+ fieldToDisable = $(element.readAttribute('id').sub('_use_default', ''));
297
+
298
+ if (fieldToDisable.disabled) {
299
+ if (fieldToDisable.hasClassName('product-option-price')) {//need change to cheking value of element
300
+ $(fieldToDisable.readAttribute('id')+'_type').enable();
301
+ }
302
+ fieldToDisable.enable();
303
+ } else {
304
+ if (fieldToDisable.hasClassName('product-option-price')) {//need change to cheking value of element
305
+ $(fieldToDisable.readAttribute('id')+'_type').disable();
306
+ }
307
+ fieldToDisable.disable();
308
+ }
309
+ },
310
+ bindScopeCheckbox : function(){
311
+ var checkboxes = $$('.product-option-scope-checkbox');
312
+ for (var i=0;i<checkboxes.length;i++) {
313
+ if (!$(checkboxes[i]).binded) {
314
+ $(checkboxes[i]).binded = true;
315
+ Event.observe(checkboxes[i], 'click', this.addScope.bind(this));
316
+ }
317
+ }
318
+ }
319
+ }
320
+
321
+ if($('option_panel')){
322
+ $('option_panel').remove();
323
+ }
324
+
325
+ productOption.bindRemoveButtons();
326
+
327
+ if($('<?php echo $this->getAddButtonId() ?>')){
328
+ Event.observe('<?php echo $this->getAddButtonId() ?>', 'click', productOption.add.bind(productOption));
329
+ }
330
+
331
+ //validation for selected input type
332
+ Validation.addAllThese([
333
+ ['required-option-select', <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Select type of option')) ?>, function(v, elm) {
334
+ if (elm.getValue() == '') {
335
+ return false;
336
+ }
337
+ return true;
338
+ }]]);
339
+
340
+ //adding data to templates
341
+ <?php foreach ($this->getOptionValues() as $_value): ?>
342
+ productOption.add(<?php echo $_value->toJson() ?>);
343
+ productOptionType.addDataToValues(<?php echo $_value->toJson() ?>);
344
+ <?php endforeach; ?>
345
+
346
+ //bind scope checkboxes
347
+ productOptionScope.bindScopeCheckbox();
348
+ //]]>
349
+ </script>
350
+
351
+ <div><?php if (!$this->isReadonly()):?><input type="hidden" name="affect_product_custom_options" value="1" /><?php endif;?></div>
app/design/adminhtml/default/default/template/catalog/product/edit/options/type/date.phtml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <script type="text/javascript">
28
+
29
+ OptionTemplateDate = '<table class="border" cellpadding="0" cellspacing="0">'+
30
+ '<tr class="headings">'+
31
+ <?php if ($this->getCanReadPrice() !== false) : ?>
32
+ '<th class="type-price"><?php echo Mage::helper('core')->jsQuoteEscape(Mage::hel