Amosoft_Dropship - Version 1.0.0

Version Notes

It is a stable version

Download this release

Release Info

Developer Ray Zhang
Extension Amosoft_Dropship
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (353) hide show
  1. app/code/local/Amosoft/Dropship/Block/Adminhtml/Amosoft.php +19 -0
  2. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory.php +19 -0
  3. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Tab/Addvendorfield.php +99 -0
  4. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Tab/Amosoftvendor.php +83 -0
  5. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Tab/Vendortabhistory.php +30 -0
  6. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Vendortab.php +37 -0
  7. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Vendortabhistory.php +37 -0
  8. app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Grid.php +137 -0
  9. app/code/local/Amosoft/Dropship/Block/Adminhtml/Notification.php +107 -0
  10. app/code/local/Amosoft/Dropship/Block/Adminhtml/Ranking.php +62 -0
  11. app/code/local/Amosoft/Dropship/Block/Adminhtml/Ranking/Grid.php +87 -0
  12. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sales/Order/View/Items.php +23 -0
  13. app/code/local/Amosoft/Dropship/Block/Adminhtml/Showhistory.php +39 -0
  14. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing.php +27 -0
  15. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit.php +67 -0
  16. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit/Form.php +26 -0
  17. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit/Tab/Form.php +69 -0
  18. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit/Tabs.php +32 -0
  19. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Grid.php +211 -0
  20. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/Renderer/Action.php +30 -0
  21. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/View.php +47 -0
  22. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/View/Form.php +30 -0
  23. app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/View/Tabs.php +30 -0
  24. app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Crontime.php +59 -0
  25. app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Fieldset/Hint.php +44 -0
  26. app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Helplink.php +18 -0
  27. app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Singuplink.php +18 -0
  28. app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Submitbutton.php +25 -0
  29. app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Time.php +76 -0
  30. app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload.php +110 -0
  31. app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload/Bulkassign.php +182 -0
  32. app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload/Edit/Button.php +22 -0
  33. app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload/Edit/Form.php +63 -0
  34. app/code/local/Amosoft/Dropship/Block/Adminhtml/Vendorproductuploadhistory.php +142 -0
  35. app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Nameaction.php +29 -0
  36. app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Orderaction.php +27 -0
  37. app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Skuaction.php +34 -0
  38. app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Textaction.php +38 -0
  39. app/code/local/Amosoft/Dropship/Helper/Data.php +488 -0
  40. app/code/local/Amosoft/Dropship/Model/Amosoft.php +233 -0
  41. app/code/local/Amosoft/Dropship/Model/Api2/Createroleandrule.php +248 -0
  42. app/code/local/Amosoft/Dropship/Model/Api2/Inventory.php +19 -0
  43. app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest.php +53 -0
  44. app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest/Admin/V1.php +37 -0
  45. app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest/Customer/V1.php +65 -0
  46. app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest/Guest/V1.php +12 -0
  47. app/code/local/Amosoft/Dropship/Model/Api2/Product.php +18 -0
  48. app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest.php +53 -0
  49. app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest/Admin/V1.php +44 -0
  50. app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest/Customer/V1.php +65 -0
  51. app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest/Guest/V1.php +12 -0
  52. app/code/local/Amosoft/Dropship/Model/Carrier/Flatrateperproduct.php +65 -0
  53. app/code/local/Amosoft/Dropship/Model/Csvparser.php +265 -0
  54. app/code/local/Amosoft/Dropship/Model/Inventory.php +468 -0
  55. app/code/local/Amosoft/Dropship/Model/Inventorylog.php +17 -0
  56. app/code/local/Amosoft/Dropship/Model/Observer.php +508 -0
  57. app/code/local/Amosoft/Dropship/Model/Order/Api.php +312 -0
  58. app/code/local/Amosoft/Dropship/Model/Order/Dropship/Api.php +352 -0
  59. app/code/local/Amosoft/Dropship/Model/Order/Invoice.php +31 -0
  60. app/code/local/Amosoft/Dropship/Model/Orderitems.php +186 -0
  61. app/code/local/Amosoft/Dropship/Model/Ordersourcing.php +90 -0
  62. app/code/local/Amosoft/Dropship/Model/Productimport.php +596 -0
  63. app/code/local/Amosoft/Dropship/Model/Ranking.php +64 -0
  64. app/code/local/Amosoft/Dropship/Model/Rankinglog.php +18 -0
  65. app/code/local/Amosoft/Dropship/Model/Resource/Inventory.php +16 -0
  66. app/code/local/Amosoft/Dropship/Model/Resource/Inventory/Collection.php +20 -0
  67. app/code/local/Amosoft/Dropship/Model/Resource/Inventorylog.php +16 -0
  68. app/code/local/Amosoft/Dropship/Model/Resource/Inventorylog/Collection.php +20 -0
  69. app/code/local/Amosoft/Dropship/Model/Resource/Orderitems.php +58 -0
  70. app/code/local/Amosoft/Dropship/Model/Resource/Orderitems/Collection.php +20 -0
  71. app/code/local/Amosoft/Dropship/Model/Resource/Ordersourcing.php +52 -0
  72. app/code/local/Amosoft/Dropship/Model/Resource/Ordersourcing/Collection.php +20 -0
  73. app/code/local/Amosoft/Dropship/Model/Resource/Ranking.php +16 -0
  74. app/code/local/Amosoft/Dropship/Model/Resource/Ranking/Collection.php +20 -0
  75. app/code/local/Amosoft/Dropship/Model/Resource/Rankinglog.php +16 -0
  76. app/code/local/Amosoft/Dropship/Model/Resource/Rankinglog/Collection.php +20 -0
  77. app/code/local/Amosoft/Dropship/Model/Resource/Setup.php +72 -0
  78. app/code/local/Amosoft/Dropship/Model/Resource/Uploadvendor.php +16 -0
  79. app/code/local/Amosoft/Dropship/Model/Resource/Uploadvendor/Collection.php +20 -0
  80. app/code/local/Amosoft/Dropship/Model/Resource/Vendorimportlog.php +38 -0
  81. app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Oudatedinventory/Email.php +61 -0
  82. app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Sourcing/Cronbackorder.php +63 -0
  83. app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Sourcing/Cronsourcing.php +61 -0
  84. app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Uploadvendor/Cron.php +61 -0
  85. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Attributecodes.php +37 -0
  86. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Category.php +32 -0
  87. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Ediqualifier.php +65 -0
  88. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Optionvalues.php +62 -0
  89. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Ranktype.php +21 -0
  90. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Store.php +31 -0
  91. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Time.php +33 -0
  92. app/code/local/Amosoft/Dropship/Model/System/Config/Source/Vendorlist.php +94 -0
  93. app/code/local/Amosoft/Dropship/Model/Uploadvendor.php +1540 -0
  94. app/code/local/Amosoft/Dropship/Model/Versions/Api.php +23 -0
  95. app/code/local/Amosoft/Dropship/Model/Versions/Api/V2.php +11 -0
  96. app/code/local/Amosoft/Dropship/controllers/Adminhtml/AmosoftController.php +264 -0
  97. app/code/local/Amosoft/Dropship/controllers/Adminhtml/InventoryController.php +81 -0
  98. app/code/local/Amosoft/Dropship/controllers/Adminhtml/RankingController.php +210 -0
  99. app/code/local/Amosoft/Dropship/controllers/Adminhtml/SourcingController.php +182 -0
  100. app/code/local/Amosoft/Dropship/controllers/Adminhtml/UploadController.php +389 -0
  101. app/code/local/Amosoft/Dropship/data/dropship_setup/data-install-1.0.3.php +55 -0
  102. app/code/local/Amosoft/Dropship/data/dropship_setup/data-upgrade-1.0.3-1.0.4.php +104 -0
  103. app/code/local/Amosoft/Dropship/data/dropship_setup/data-upgrade-1.0.4-1.0.5.php +49 -0
  104. app/code/local/Amosoft/Dropship/data/dropship_setup/data-upgrade-1.0.5-1.0.6.php +25 -0
  105. app/code/local/Amosoft/Dropship/etc/adminhtml.xml +99 -0
  106. app/code/local/Amosoft/Dropship/etc/api.xml +442 -0
  107. app/code/local/Amosoft/Dropship/etc/api2.xml +167 -0
  108. app/code/local/Amosoft/Dropship/etc/config.xml +310 -0
  109. app/code/local/Amosoft/Dropship/etc/jstranslator.xml +17 -0
  110. app/code/local/Amosoft/Dropship/etc/system.xml +247 -0
  111. app/code/local/Amosoft/Dropship/etc/wsdl.xml +184 -0
  112. app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-install-1.0.3.php +105 -0
  113. app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.4-1.0.5.php +50 -0
  114. app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.5-1.0.6.php +28 -0
  115. app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.6-1.0.7.php +54 -0
  116. app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.7-1.0.8.php +12 -0
  117. app/design/adminhtml/default/default/layout/amosoftdropship.xml +185 -0
  118. app/design/adminhtml/default/default/template/amosoft/add_help_js.phtml +26 -0
  119. app/design/adminhtml/default/default/template/amosoft/addvendorfields.phtml +142 -0
  120. app/design/adminhtml/default/default/template/amosoft/bundle/renderer.phtml +441 -0
  121. app/design/adminhtml/default/default/template/amosoft/custom-msg.phtml +1 -0
  122. app/design/adminhtml/default/default/template/amosoft/downloadable/downloadable.phtml +301 -0
  123. app/design/adminhtml/default/default/template/amosoft/html/pager.phtml +124 -0
  124. app/design/adminhtml/default/default/template/amosoft/import/form/after.phtml +14 -0
  125. app/design/adminhtml/default/default/template/amosoft/import/form/before.phtml +126 -0
  126. app/design/adminhtml/default/default/template/amosoft/import/frame/result.phtml +31 -0
  127. app/design/adminhtml/default/default/template/amosoft/inline-edit.phtml +89 -0
  128. app/design/adminhtml/default/default/template/amosoft/item_order_history.phtml +37 -0
  129. app/design/adminhtml/default/default/template/amosoft/popup.phtml +62 -0
  130. app/design/adminhtml/default/default/template/amosoft/process-profile.phtml +290 -0
  131. app/design/adminhtml/default/default/template/amosoft/result.phtml +80 -0
  132. app/design/adminhtml/default/default/template/amosoft/sales/default.phtml +312 -0
  133. app/design/adminhtml/default/default/template/amosoft/sales/items.phtml +69 -0
  134. app/design/adminhtml/default/default/template/amosoft/system/config/fieldset/hint.phtml +132 -0
  135. app/design/adminhtml/default/default/template/amosoft/system/config/submitbutton.phtml +99 -0
  136. app/design/adminhtml/default/default/template/amosoft/upload_vendor_product.phtml +66 -0
  137. app/design/adminhtml/default/default/template/amosoft/vendor_ranking.phtml +455 -0
  138. app/design/adminhtml/default/default/template/amosoft/vendor_upload_product_history.phtml +63 -0
  139. app/design/adminhtml/default/default/template/amosoft/vendorproducttab.phtml +62 -0
  140. app/design/adminhtml/default/default/template/amosoft/vendorproducttabhistory.phtml +37 -0
  141. app/design/adminhtml/default/default/template/amosoft/window.phtml +107 -0
  142. app/etc/modules/Amosoft_Dropship.xml +10 -0
  143. js/amosoft/extjs/bootstrap.js +58 -0
  144. js/amosoft/extjs/css/example.css +83 -0
  145. js/amosoft/extjs/css/ext-all.css +1 -0
  146. js/amosoft/extjs/css/images/boundlist/trigger-arrow.png +0 -0
  147. js/amosoft/extjs/css/images/box/corners-blue.gif +0 -0
  148. js/amosoft/extjs/css/images/box/corners.gif +0 -0
  149. js/amosoft/extjs/css/images/box/l-blue.gif +0 -0
  150. js/amosoft/extjs/css/images/box/l.gif +0 -0
  151. js/amosoft/extjs/css/images/box/r-blue.gif +0 -0
  152. js/amosoft/extjs/css/images/box/r.gif +0 -0
  153. js/amosoft/extjs/css/images/box/tb-blue.gif +0 -0
  154. js/amosoft/extjs/css/images/box/tb.gif +0 -0
  155. js/amosoft/extjs/css/images/button/arrow.gif +0 -0
  156. js/amosoft/extjs/css/images/button/btn.gif +0 -0
  157. js/amosoft/extjs/css/images/button/group-cs.gif +0 -0
  158. js/amosoft/extjs/css/images/button/group-lr.gif +0 -0
  159. js/amosoft/extjs/css/images/button/group-tb.gif +0 -0
  160. js/amosoft/extjs/css/images/button/s-arrow-b-noline.gif +0 -0
  161. js/amosoft/extjs/css/images/button/s-arrow-b.gif +0 -0
  162. js/amosoft/extjs/css/images/button/s-arrow-bo.gif +0 -0
  163. js/amosoft/extjs/css/images/button/s-arrow-light.gif +0 -0
  164. js/amosoft/extjs/css/images/button/s-arrow-noline.gif +0 -0
  165. js/amosoft/extjs/css/images/button/s-arrow-o.gif +0 -0
  166. js/amosoft/extjs/css/images/button/s-arrow.gif +0 -0
  167. js/amosoft/extjs/css/images/datepicker/datepicker-footer-bg.gif +0 -0
  168. js/amosoft/extjs/css/images/datepicker/datepicker-footer-bg.png +0 -0
  169. js/amosoft/extjs/css/images/datepicker/datepicker-header-bg.gif +0 -0
  170. js/amosoft/extjs/css/images/datepicker/datepicker-header-bg.png +0 -0
  171. js/amosoft/extjs/css/images/dd/drop-add.gif +0 -0
  172. js/amosoft/extjs/css/images/dd/drop-no.gif +0 -0
  173. js/amosoft/extjs/css/images/dd/drop-yes.gif +0 -0
  174. js/amosoft/extjs/css/images/editor/tb-sprite.gif +0 -0
  175. js/amosoft/extjs/css/images/form/checkbox.gif +0 -0
  176. js/amosoft/extjs/css/images/form/clear-trigger.gif +0 -0
  177. js/amosoft/extjs/css/images/form/date-trigger.gif +0 -0
  178. js/amosoft/extjs/css/images/form/error-tip-corners.gif +0 -0
  179. js/amosoft/extjs/css/images/form/exclamation.gif +0 -0
  180. js/amosoft/extjs/css/images/form/radio.gif +0 -0
  181. js/amosoft/extjs/css/images/form/search-trigger.gif +0 -0
  182. js/amosoft/extjs/css/images/form/spinner-small.gif +0 -0
  183. js/amosoft/extjs/css/images/form/spinner.gif +0 -0
  184. js/amosoft/extjs/css/images/form/text-bg.gif +0 -0
  185. js/amosoft/extjs/css/images/form/trigger-square.gif +0 -0
  186. js/amosoft/extjs/css/images/form/trigger-tpl.gif +0 -0
  187. js/amosoft/extjs/css/images/form/trigger.gif +0 -0
  188. js/amosoft/extjs/css/images/grid/arrow-left-white.gif +0 -0
  189. js/amosoft/extjs/css/images/grid/arrow-right-white.gif +0 -0
  190. js/amosoft/extjs/css/images/grid/cell-special-bg.gif +0 -0
  191. js/amosoft/extjs/css/images/grid/cell-special-bg.png +0 -0
  192. js/amosoft/extjs/css/images/grid/cell-special-selected-bg.gif +0 -0
  193. js/amosoft/extjs/css/images/grid/cell-special-selected-bg.png +0 -0
  194. js/amosoft/extjs/css/images/grid/checked.gif +0 -0
  195. js/amosoft/extjs/css/images/grid/col-move-bottom.gif +0 -0
  196. js/amosoft/extjs/css/images/grid/col-move-top.gif +0 -0
  197. js/amosoft/extjs/css/images/grid/column-header-bg.gif +0 -0
  198. js/amosoft/extjs/css/images/grid/column-header-bg.png +0 -0
  199. js/amosoft/extjs/css/images/grid/column-header-over-bg.gif +0 -0
  200. js/amosoft/extjs/css/images/grid/column-header-over-bg.png +0 -0
  201. js/amosoft/extjs/css/images/grid/columns.gif +0 -0
  202. js/amosoft/extjs/css/images/grid/dd-insert-arrow-left.gif +0 -0
  203. js/amosoft/extjs/css/images/grid/dd-insert-arrow-left.png +0 -0
  204. js/amosoft/extjs/css/images/grid/dd-insert-arrow-right.gif +0 -0
  205. js/amosoft/extjs/css/images/grid/dd-insert-arrow-right.png +0 -0
  206. js/amosoft/extjs/css/images/grid/dirty.gif +0 -0
  207. js/amosoft/extjs/css/images/grid/done.gif +0 -0
  208. js/amosoft/extjs/css/images/grid/drop-no.gif +0 -0
  209. js/amosoft/extjs/css/images/grid/drop-yes.gif +0 -0
  210. js/amosoft/extjs/css/images/grid/footer-bg.gif +0 -0
  211. js/amosoft/extjs/css/images/grid/grid-blue-hd.gif +0 -0
  212. js/amosoft/extjs/css/images/grid/grid-blue-split.gif +0 -0
  213. js/amosoft/extjs/css/images/grid/grid-hrow.gif +0 -0
  214. js/amosoft/extjs/css/images/grid/grid-loading.gif +0 -0
  215. js/amosoft/extjs/css/images/grid/grid-split.gif +0 -0
  216. js/amosoft/extjs/css/images/grid/grid-vista-hd.gif +0 -0
  217. js/amosoft/extjs/css/images/grid/grid3-hd-btn.gif +0 -0
  218. js/amosoft/extjs/css/images/grid/grid3-hrow-over.gif +0 -0
  219. js/amosoft/extjs/css/images/grid/grid3-hrow.gif +0 -0
  220. js/amosoft/extjs/css/images/grid/grid3-rowheader.gif +0 -0
  221. js/amosoft/extjs/css/images/grid/group-by.gif +0 -0
  222. js/amosoft/extjs/css/images/grid/group-collapse.gif +0 -0
  223. js/amosoft/extjs/css/images/grid/group-expand-sprite.gif +0 -0
  224. js/amosoft/extjs/css/images/grid/group-expand.gif +0 -0
  225. js/amosoft/extjs/css/images/grid/hd-pop.gif +0 -0
  226. js/amosoft/extjs/css/images/grid/hmenu-asc.gif +0 -0
  227. js/amosoft/extjs/css/images/grid/hmenu-desc.gif +0 -0
  228. js/amosoft/extjs/css/images/grid/hmenu-lock.gif +0 -0
  229. js/amosoft/extjs/css/images/grid/hmenu-lock.png +0 -0
  230. js/amosoft/extjs/css/images/grid/hmenu-unlock.gif +0 -0
  231. js/amosoft/extjs/css/images/grid/hmenu-unlock.png +0 -0
  232. js/amosoft/extjs/css/images/grid/invalid_line.gif +0 -0
  233. js/amosoft/extjs/css/images/grid/loading.gif +0 -0
  234. js/amosoft/extjs/css/images/grid/mso-hd.gif +0 -0
  235. js/amosoft/extjs/css/images/grid/nowait.gif +0 -0
  236. js/amosoft/extjs/css/images/grid/page-first-disabled.gif +0 -0
  237. js/amosoft/extjs/css/images/grid/page-first.gif +0 -0
  238. js/amosoft/extjs/css/images/grid/page-last-disabled.gif +0 -0
  239. js/amosoft/extjs/css/images/grid/page-last.gif +0 -0
  240. js/amosoft/extjs/css/images/grid/page-next-disabled.gif +0 -0
  241. js/amosoft/extjs/css/images/grid/page-next.gif +0 -0
  242. js/amosoft/extjs/css/images/grid/page-prev-disabled.gif +0 -0
  243. js/amosoft/extjs/css/images/grid/page-prev.gif +0 -0
  244. js/amosoft/extjs/css/images/grid/pick-button.gif +0 -0
  245. js/amosoft/extjs/css/images/grid/property-cell-bg.gif +0 -0
  246. js/amosoft/extjs/css/images/grid/property-cell-selected-bg.gif +0 -0
  247. js/amosoft/extjs/css/images/grid/refresh-disabled.gif +0 -0
  248. js/amosoft/extjs/css/images/grid/refresh.gif +0 -0
  249. js/amosoft/extjs/css/images/grid/row-check-sprite.gif +0 -0
  250. js/amosoft/extjs/css/images/grid/row-expand-sprite.gif +0 -0
  251. js/amosoft/extjs/css/images/grid/row-over.gif +0 -0
  252. js/amosoft/extjs/css/images/grid/row-sel.gif +0 -0
  253. js/amosoft/extjs/css/images/grid/sort-hd.gif +0 -0
  254. js/amosoft/extjs/css/images/grid/sort_asc.gif +0 -0
  255. js/amosoft/extjs/css/images/grid/sort_desc.gif +0 -0
  256. js/amosoft/extjs/css/images/grid/unchecked.gif +0 -0
  257. js/amosoft/extjs/css/images/grid/wait.gif +0 -0
  258. js/amosoft/extjs/css/images/layout/mini-bottom.gif +0 -0
  259. js/amosoft/extjs/css/images/layout/mini-left.gif +0 -0
  260. js/amosoft/extjs/css/images/layout/mini-right.gif +0 -0
  261. js/amosoft/extjs/css/images/layout/mini-top.gif +0 -0
  262. js/amosoft/extjs/css/images/menu/checked.gif +0 -0
  263. js/amosoft/extjs/css/images/menu/group-checked.gif +0 -0
  264. js/amosoft/extjs/css/images/menu/item-over.gif +0 -0
  265. js/amosoft/extjs/css/images/menu/menu-item-active-bg.gif +0 -0
  266. js/amosoft/extjs/css/images/menu/menu-item-active-corners.gif +0 -0
  267. js/amosoft/extjs/css/images/menu/menu-item-active-sides.gif +0 -0
  268. js/amosoft/extjs/css/images/menu/menu-parent.gif +0 -0
  269. js/amosoft/extjs/css/images/menu/menu.gif +0 -0
  270. js/amosoft/extjs/css/images/menu/unchecked.gif +0 -0
  271. js/amosoft/extjs/css/images/progress/progress-default-bg.gif +0 -0
  272. js/amosoft/extjs/css/images/shared/blue-loading.gif +0 -0
  273. js/amosoft/extjs/css/images/shared/calendar.gif +0 -0
  274. js/amosoft/extjs/css/images/shared/glass-bg.gif +0 -0
  275. js/amosoft/extjs/css/images/shared/hd-sprite.gif +0 -0
  276. js/amosoft/extjs/css/images/shared/icon-error.gif +0 -0
  277. js/amosoft/extjs/css/images/shared/icon-info.gif +0 -0
  278. js/amosoft/extjs/css/images/shared/icon-question.gif +0 -0
  279. js/amosoft/extjs/css/images/shared/icon-warning.gif +0 -0
  280. js/amosoft/extjs/css/images/shared/large-loading.gif +0 -0
  281. js/amosoft/extjs/css/images/shared/left-btn.gif +0 -0
  282. js/amosoft/extjs/css/images/shared/loading-balls.gif +0 -0
  283. js/amosoft/extjs/css/images/shared/right-btn.gif +0 -0
  284. js/amosoft/extjs/css/images/shared/shadow-c.png +0 -0
  285. js/amosoft/extjs/css/images/shared/shadow-lr.png +0 -0
  286. js/amosoft/extjs/css/images/shared/shadow.png +0 -0
  287. js/amosoft/extjs/css/images/shared/warning.gif +0 -0
  288. js/amosoft/extjs/css/images/sizer/e-handle-dark.gif +0 -0
  289. js/amosoft/extjs/css/images/sizer/e-handle.gif +0 -0
  290. js/amosoft/extjs/css/images/sizer/ne-handle-dark.gif +0 -0
  291. js/amosoft/extjs/css/images/sizer/ne-handle.gif +0 -0
  292. js/amosoft/extjs/css/images/sizer/nw-handle-dark.gif +0 -0
  293. js/amosoft/extjs/css/images/sizer/nw-handle.gif +0 -0
  294. js/amosoft/extjs/css/images/sizer/s-handle-dark.gif +0 -0
  295. js/amosoft/extjs/css/images/sizer/s-handle.gif +0 -0
  296. js/amosoft/extjs/css/images/sizer/se-handle-dark.gif +0 -0
  297. js/amosoft/extjs/css/images/sizer/se-handle.gif +0 -0
  298. js/amosoft/extjs/css/images/sizer/square.gif +0 -0
  299. js/amosoft/extjs/css/images/sizer/sw-handle-dark.gif +0 -0
  300. js/amosoft/extjs/css/images/sizer/sw-handle.gif +0 -0
  301. js/amosoft/extjs/css/images/slider/slider-bg.gif +0 -0
  302. js/amosoft/extjs/css/images/slider/slider-bg.png +0 -0
  303. js/amosoft/extjs/css/images/slider/slider-thumb.gif +0 -0
  304. js/amosoft/extjs/css/images/slider/slider-thumb.png +0 -0
  305. js/amosoft/extjs/css/images/slider/slider-v-bg.gif +0 -0
  306. js/amosoft/extjs/css/images/slider/slider-v-bg.png +0 -0
  307. js/amosoft/extjs/css/images/slider/slider-v-thumb.gif +0 -0
  308. js/amosoft/extjs/css/images/slider/slider-v-thumb.png +0 -0
  309. js/amosoft/extjs/css/images/tab-bar/scroll-left.gif +0 -0
  310. js/amosoft/extjs/css/images/tab-bar/scroll-right.gif +0 -0
  311. js/amosoft/extjs/css/images/tab-bar/tab-bar-default-bg.gif +0 -0
  312. js/amosoft/extjs/css/images/tip/tip-corners.gif +0 -0
  313. js/amosoft/extjs/css/images/tip/tip-sides.gif +0 -0
  314. js/amosoft/extjs/css/images/toolbar/more.gif +0 -0
  315. js/amosoft/extjs/css/images/toolbar/scroll-left.gif +0 -0
  316. js/amosoft/extjs/css/images/toolbar/scroll-right.gif +0 -0
  317. js/amosoft/extjs/css/images/toolbar/toolbar-default-bg.gif +0 -0
  318. js/amosoft/extjs/css/images/tools/tool-sprite-tpl.gif +0 -0
  319. js/amosoft/extjs/css/images/tools/tool-sprites.gif +0 -0
  320. js/amosoft/extjs/css/images/tools/tools-sprites-trans.gif +0 -0
  321. js/amosoft/extjs/css/images/tree/arrows.gif +0 -0
  322. js/amosoft/extjs/css/images/tree/drop-above.gif +0 -0
  323. js/amosoft/extjs/css/images/tree/drop-add.gif +0 -0
  324. js/amosoft/extjs/css/images/tree/drop-append.gif +0 -0
  325. js/amosoft/extjs/css/images/tree/drop-below.gif +0 -0
  326. js/amosoft/extjs/css/images/tree/drop-between.gif +0 -0
  327. js/amosoft/extjs/css/images/tree/drop-no.gif +0 -0
  328. js/amosoft/extjs/css/images/tree/drop-over.gif +0 -0
  329. js/amosoft/extjs/css/images/tree/drop-under.gif +0 -0
  330. js/amosoft/extjs/css/images/tree/drop-yes.gif +0 -0
  331. js/amosoft/extjs/css/images/tree/elbow-end-minus-nl.gif +0 -0
  332. js/amosoft/extjs/css/images/tree/elbow-end-minus.gif +0 -0
  333. js/amosoft/extjs/css/images/tree/elbow-end-plus-nl.gif +0 -0
  334. js/amosoft/extjs/css/images/tree/elbow-end-plus.gif +0 -0
  335. js/amosoft/extjs/css/images/tree/elbow-end.gif +0 -0
  336. js/amosoft/extjs/css/images/tree/elbow-line.gif +0 -0
  337. js/amosoft/extjs/css/images/tree/elbow-minus-nl.gif +0 -0
  338. js/amosoft/extjs/css/images/tree/elbow-minus.gif +0 -0
  339. js/amosoft/extjs/css/images/tree/elbow-plus-nl.gif +0 -0
  340. js/amosoft/extjs/css/images/tree/elbow-plus.gif +0 -0
  341. js/amosoft/extjs/css/images/tree/elbow.gif +0 -0
  342. js/amosoft/extjs/css/images/tree/folder-open.gif +0 -0
  343. js/amosoft/extjs/css/images/tree/folder.gif +0 -0
  344. js/amosoft/extjs/css/images/tree/leaf.gif +0 -0
  345. js/amosoft/extjs/css/images/tree/loading.gif +0 -0
  346. js/amosoft/extjs/css/images/tree/s.gif +0 -0
  347. js/amosoft/extjs/css/images/util/splitter/mini-bottom.gif +0 -0
  348. js/amosoft/extjs/css/images/util/splitter/mini-left.gif +0 -0
  349. js/amosoft/extjs/css/images/util/splitter/mini-right.gif +0 -0
  350. js/amosoft/extjs/css/images/util/splitter/mini-top.gif +0 -0
  351. js/amosoft/extjs/dnd_grid_to_grid.js +120 -0
  352. js/amosoft/extjs/examples.js +110 -0
  353. js/amosoft/extjs/ext-all.js +21 -0
app/code/local/Amosoft/Dropship/Block/Adminhtml/Amosoft.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Amosoft extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+ public function __construct()
12
+ {
13
+ $this->_controller = 'adminhtml_amosoft';
14
+ $this->_blockGroup = 'dropship';
15
+ $this->_headerText = Mage::helper('dropship')->__('Vendor/Supplier Manager');
16
+ $this->_addButtonLabel = Mage::helper('dropship')->__('Add Vendor/Supplier');
17
+ parent::__construct();
18
+ }
19
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Inventory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+ public function __construct()
12
+ {
13
+ $this->_controller = 'adminhtml_inventory';
14
+ $this->_blockGroup = 'dropship';
15
+ $this->_headerText = Mage::helper('dropship')->__('Vendor/Supplier Details');
16
+ parent::__construct();
17
+ $this->removeButton('add');
18
+ }
19
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Tab/Addvendorfield.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield extends Mage_Adminhtml_Block_Widget
11
+ {
12
+ protected $_product;
13
+
14
+ protected $_productInstance;
15
+
16
+ protected $_values;
17
+
18
+ protected $_itemCount = 1;
19
+
20
+ /**
21
+ * Class constructor
22
+ */
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->setTemplate('amosoft/addvendorfields.phtml');
27
+ }
28
+
29
+ public function getItemCount()
30
+ {
31
+ return $this->_itemCount;
32
+ }
33
+
34
+ public function setItemCount($itemCount)
35
+ {
36
+ $this->_itemCount = max($this->_itemCount, $itemCount);
37
+ return $this;
38
+ }
39
+
40
+ /**
41
+ * Retrieve options field name prefix
42
+ *
43
+ * @return string
44
+ */
45
+ public function getFieldName()
46
+ {
47
+ return 'product[vendor_new]';
48
+ }
49
+
50
+ /**
51
+ * Retrieve options field id prefix
52
+ *
53
+ * @return string
54
+ */
55
+ public function getFieldId()
56
+ {
57
+ return 'product_vendor';
58
+ }
59
+
60
+ public function getVendorSelectHtml()
61
+ {
62
+ $productsku = Mage::getModel('catalog/product')->load(Mage::app()->getRequest()->getParam('id'))->getSku();
63
+
64
+ $select = $this->getLayout()->createBlock('adminhtml/html_select')
65
+ ->setData(array(
66
+ 'id' => $this->getFieldId().'_{{id}}_amosoft_vendor_code',
67
+ 'class' => 'select select-product-option-type required-option-select'
68
+ ))
69
+ ->setName($this->getFieldName().'[{{id}}][amosoft_vendor_code]')
70
+ ->setOptions(Mage::getSingleton('dropship/system_config_source_vendorlist')->vendorList('',$productsku));
71
+
72
+ return $select->getHtml();
73
+ }
74
+ protected function _prepareLayout()
75
+ {
76
+ $this->setChild('delete_button_vendor',
77
+ $this->getLayout()->createBlock('adminhtml/widget_button')
78
+ ->setData(array(
79
+ 'label' => Mage::helper('dropship')->__('Delete Option'),
80
+ 'class' => 'delete delete-product-option-vendor '
81
+ ))
82
+ );
83
+ return parent::_prepareLayout();
84
+ }
85
+
86
+ public function getAddButtonId()
87
+ {
88
+ $buttonId = $this->getLayout()
89
+ ->getBlock('vendors_product_tab')
90
+ ->getChild('vendor_add_button')->getId();
91
+ return $buttonId;
92
+ }
93
+
94
+ public function getDeleteButtonHtml()
95
+ {
96
+ return $this->getChildHtml('delete_button_vendor');
97
+ }
98
+
99
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Tab/Amosoftvendor.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Inventory_Edit_Tab_Amosoftvendor extends Mage_Adminhtml_Block_Widget
11
+ {
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ }
16
+
17
+
18
+ protected function _prepareLayout()
19
+ {
20
+ $this->setChild('vendor_add_button',
21
+ $this->getLayout()->createBlock('adminhtml/widget_button')
22
+ ->setData(array(
23
+ 'label' => Mage::helper('dropship')->__('Add New Supplier'),
24
+ 'class' => 'add',
25
+ 'id' => 'add_new_defined_option_vendor'
26
+ ))
27
+ );
28
+
29
+ $this->setChild('update_delete_button_vendor',
30
+ $this->getLayout()->createBlock('adminhtml/widget_button')
31
+ ->setData(array(
32
+ 'label' => Mage::helper('dropship')->__('Delete Option'),
33
+ 'class' => 'delete delete-product-option-vendor '
34
+ ))
35
+ );
36
+
37
+ $this->setChild('vendor_options_box',
38
+ $this->getLayout()->createBlock('dropship/adminhtml_inventory_edit_tab_addvendorfield')
39
+ );
40
+
41
+ return parent::_prepareLayout();
42
+ }
43
+
44
+ public function getAddButtonHtml()
45
+ {
46
+ return $this->getChildHtml('vendor_add_button');
47
+ }
48
+
49
+ public function getOptionsBoxHtml()
50
+ {
51
+ return $this->getChildHtml('vendor_options_box');
52
+ }
53
+
54
+ public function getAssignedData(){
55
+
56
+ $rankingTableName = Mage::getSingleton('core/resource')->getTableName('dropship/ranking');
57
+ $collection = Mage::getModel('dropship/inventory')->getCollection()
58
+ ->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
59
+ $collection->getSelect()->joinLeft(array('ranking' => $rankingTableName), 'main_table.amosoft_vendor_code=ranking.amosoft_vendor_code', array('vendor_name' => 'amosoft_vendor_name'));
60
+ return $collection;
61
+ }
62
+
63
+ public function getFieldName()
64
+ {
65
+ return 'product[vendor_update]';
66
+ }
67
+
68
+ /**
69
+ * Retrieve options field id prefix
70
+ *
71
+ * @return string
72
+ */
73
+ public function getFieldId()
74
+ {
75
+ return 'product_vendor';
76
+ }
77
+
78
+ public function getUpdateDeleteButtonHtml(){
79
+
80
+ return $this->getChildHtml('update_delete_button_vendor');
81
+ }
82
+
83
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Tab/Vendortabhistory.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistory extends Mage_Adminhtml_Block_Widget
11
+ {
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ }
16
+
17
+
18
+ protected function _prepareLayout()
19
+ {
20
+ return parent::_prepareLayout();
21
+ }
22
+
23
+ public function getInventoryLog(){
24
+
25
+ $collection = Mage::getModel('dropship/inventorylog')->getCollection()->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
26
+ $collection->getSelect()->order('updated_at desc');
27
+
28
+ return $collection;
29
+ }
30
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Vendortab.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Inventory_Edit_Vendortab extends Mage_Adminhtml_Block_Widget
11
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
12
+ {
13
+ public function canShowTab()
14
+ {
15
+ return true;
16
+ }
17
+ public function getTabLabel()
18
+ {
19
+ return $this->__('dropship Vendor');
20
+ }
21
+ public function getTabTitle()
22
+ {
23
+ return $this->__('dropship Vendor');
24
+ }
25
+ public function isHidden()
26
+ {
27
+ return false;
28
+ }
29
+ public function getTabUrl()
30
+ {
31
+ return $this->getUrl('amosoft/adminhtml_inventory/vendors', array('_current' => true));
32
+ }
33
+ public function getTabClass()
34
+ {
35
+ return 'ajax';
36
+ }
37
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Edit/Vendortabhistory.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Inventory_Edit_Vendortabhistory extends Mage_Adminhtml_Block_Widget
11
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
12
+ {
13
+ public function canShowTab()
14
+ {
15
+ return true;
16
+ }
17
+ public function getTabLabel()
18
+ {
19
+ return $this->__('dropship Vendor History');
20
+ }
21
+ public function getTabTitle()
22
+ {
23
+ return $this->__('Vendor History');
24
+ }
25
+ public function isHidden()
26
+ {
27
+ return false;
28
+ }
29
+ public function getTabUrl()
30
+ {
31
+ return $this->getUrl('amosoft/adminhtml_inventory/vendorshistory', array('_current' => true));
32
+ }
33
+ public function getTabClass()
34
+ {
35
+ return 'ajax';
36
+ }
37
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Inventory/Grid.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Inventory_Grid extends Mage_Adminhtml_Block_Widget_Grid
11
+ {
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->setId('amosoftgrid');
16
+ $this->setDefaultSort('updated_at');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setUseAjax(true);
19
+ $this->setSaveParametersInSession(true);
20
+ }
21
+
22
+ protected function _prepareCollection()
23
+ {
24
+ $entityTypeId = Mage::getModel('eav/config')->getEntityType('catalog_product')->getEntityTypeId();
25
+ $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
26
+ $collection = Mage::getModel('dropship/inventory')->getCollection();
27
+ $collection->getSelect()->join(array('amosoftRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship/ranking')),'amosoftRanking.amosoft_vendor_code = main_table.amosoft_vendor_code', array('amosoft_vendor_name'));
28
+ $collection->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.product_sku',array('magento_pro_id'=>'entity_id'));
29
+ $collection->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
30
+ $collection->getSelect()->where('prod.entity_id IS NOT NULL');
31
+ $this->setCollection($collection);
32
+ return parent::_prepareCollection();
33
+ }
34
+
35
+ protected function _getStore()
36
+ {
37
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
38
+ return Mage::app()->getStore($storeId);
39
+ }
40
+
41
+ protected function _prepareColumns()
42
+ {
43
+ $this->addColumn('amosoft_vendor_name', array(
44
+ 'header' => Mage::helper('dropship')->__('Vendor'),
45
+ 'align' =>'right',
46
+ 'width' => '50px',
47
+ 'filter_index' => 'amosoftRanking.amosoft_vendor_name',
48
+ 'index' => 'amosoft_vendor_name',
49
+ ));
50
+
51
+ $this->addColumn('stock', array(
52
+ 'header' => Mage::helper('dropship')->__('Vendor Inventory'),
53
+ 'index' => 'stock',
54
+ 'type' => 'number'
55
+ ));
56
+ $store = $this->_getStore();
57
+ $this->addColumn('cost', array(
58
+ 'header' => Mage::helper('dropship')->__('Cost'),
59
+ 'index' => 'cost',
60
+ 'type' => 'price',
61
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
62
+ ));
63
+
64
+ $store = $this->_getStore();
65
+ $this->addColumn('shipping_cost', array(
66
+ 'header' => Mage::helper('dropship')->__('Shipping Cost'),
67
+ 'index' => 'shipping_cost',
68
+ 'type' => 'price',
69
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
70
+ ));
71
+
72
+ $this->addColumn('product_name', array(
73
+ 'header' => Mage::helper('dropship')->__('Product Name'),
74
+ 'align' =>'left',
75
+ 'width' => '80px',
76
+ 'index' => 'product_name',
77
+ 'filter_index'=>'cpev.value',
78
+ ));
79
+ $this->addColumn('product_sku', array(
80
+ 'header' => Mage::helper('dropship')->__('Product Sku'),
81
+ 'align' =>'left',
82
+ 'width' => '80px',
83
+ 'index' => 'product_sku',
84
+ 'renderer' => 'Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Skuaction'
85
+ ));
86
+
87
+ $this->addColumn('amosoft_vendor_sku', array(
88
+ 'header' => Mage::helper('dropship')->__('Vendor Sku'),
89
+ 'align' =>'left',
90
+ 'width' => '80px',
91
+ 'index' => 'amosoft_vendor_sku',
92
+ 'renderer' => 'Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Skuaction'
93
+ ));
94
+ $this->addColumn('updated_at', array(
95
+ 'header' => Mage::helper('dropship')->__('Last Sync'),
96
+ 'index' => 'updated_at',
97
+ 'width' => '80px',
98
+ 'default' => '--',
99
+ 'type' => 'datetime',
100
+ 'filter_index'=> 'main_table.updated_at'
101
+ ));
102
+
103
+ // below code added for Jira ticket 734
104
+ $this->addColumn('action',
105
+ array(
106
+ 'header' => Mage::helper('dropship')->__('Action'),
107
+ 'width' => '100',
108
+ 'type' => 'action',
109
+ 'getter' => 'getMagentoProId',
110
+ 'actions' => array(
111
+ array(
112
+ 'caption' => Mage::helper('dropship')->__('Edit'),
113
+ 'url' => array('base'=> 'adminhtml/catalog_product/edit/back/edit/tab/product_info_tabs_vendor_tab'),
114
+ 'field' => 'id'
115
+ )
116
+ ),
117
+ 'filter' => false,
118
+ 'sortable' => false,
119
+ 'index' => 'stores',
120
+ 'is_system' => true,
121
+ ));
122
+ $this->addExportType('*/*/exportCsv', Mage::helper('dropship')->__('CSV'));
123
+ $this->addExportType('*/*/exportXml', Mage::helper('dropship')->__('XML'));
124
+
125
+ return parent::_prepareColumns();
126
+ }
127
+
128
+ public function getRowUrl($row)
129
+ {
130
+ //return $this->getUrl('*/*/edit', array('vendor_id' => $row->getVendorId()));
131
+ }
132
+ public function getGridUrl()
133
+ {
134
+ return $this->getUrl('*/*/grid', array('_current'=>true));
135
+ }
136
+
137
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Notification.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Notification extends Mage_Adminhtml_Block_Notification_Window
10
+ {
11
+ protected function _construct(){
12
+ parent::_construct();
13
+ $this->setHeaderText($this->escapeHtml($this->__('Amosoft Message')));
14
+ $this->setCloseText($this->escapeHtml($this->__('close')));
15
+ $this->setReadDetailsText($this->escapeHtml($this->__('Read details')));
16
+ $this->setNoticeText($this->escapeHtml($this->__('NOTICE')));
17
+ $this->setMinorText($this->escapeHtml($this->__('MINOR')));
18
+ $this->setMajorText($this->escapeHtml($this->__('MAJOR')));
19
+ $this->setCriticalText($this->escapeHtml($this->__('CRITICAL')));
20
+
21
+ }
22
+
23
+ public function getNoticeMessageText(){
24
+
25
+ $result = array();
26
+ //soap Details
27
+ $result['username'] = 'amosoft';
28
+ $apiResult = Mage::getModel('dropship/amosoft')->createApiRoleAndUser(array('api_user_name'=>'amosoft','email'=>'noreply@amosoft.com'));
29
+ $result['api_password'] = $apiResult['password'];
30
+ $result['user_id'] = $apiResult['user_id'];
31
+
32
+ //rest deatils
33
+ //code comment as Rest may be a part of future release
34
+ /* $arrRest = Mage::getModel('dropship/api2_createroleandrule')->initiliazeRest();
35
+ $result['consumer_key'] = $arrRest['consumer_key'];
36
+ $result['consumer_secret'] = $arrRest['consumer_secret'];
37
+ $result['token'] = $arrRest['token'];
38
+ $result['secret'] =$arrRest['secret']; */
39
+ $coreConfigData = array(
40
+
41
+ array(
42
+ 'scope' => 'default',
43
+ 'scope_id' => '0',
44
+ 'path' => 'amosoft_integration/integration/soapuser',
45
+ 'value' => $result['username'],
46
+
47
+ )
48
+ /*,
49
+
50
+ array(
51
+ 'scope' => 'default',
52
+ 'scope_id' => '0',
53
+ 'path' => 'amosoft_integration/integration/cunsumer_key',
54
+ 'value' => $result['consumer_key'],
55
+
56
+ )
57
+ ,
58
+ array(
59
+ 'scope' => 'default',
60
+ 'scope_id' => '0',
61
+ 'path' => 'amosoft_integration/integration/consumer_secret',
62
+ 'value' => $result['consumer_secret'],
63
+
64
+ ), array(
65
+ 'scope' => 'default',
66
+ 'scope_id' => '0',
67
+ 'path' => 'amosoft_integration/integration/access_token',
68
+ 'value' => $result['token'],
69
+
70
+ ),
71
+ array(
72
+ 'scope' => 'default',
73
+ 'scope_id' => '0',
74
+ 'path' => 'amosoft_integration/integration/access_secret',
75
+ 'value' => $result['secret'],
76
+
77
+ ) */
78
+ );
79
+
80
+ foreach ($coreConfigData as $data) {
81
+ $this->setConfigValue($data);
82
+ }
83
+ return $result;
84
+
85
+ }
86
+
87
+ public function setConfigValue($data)
88
+ {
89
+ Mage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();
90
+ }
91
+
92
+ public function canShow()
93
+ {
94
+ if (Mage::getStoreConfig('amosoft_integration/integration/notificationstatus') == 0) {
95
+ $this->setConfigValue(array(
96
+ 'scope' => 'default',
97
+ 'scope_id' => '0',
98
+ 'path' => 'amosoft_integration/integration/notificationstatus',
99
+ 'value' => '1',
100
+
101
+ ));
102
+ return true;
103
+ }
104
+ return false;
105
+
106
+ }
107
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Ranking.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Ranking extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+ public function __construct()
12
+ {
13
+ $this->_controller = 'adminhtml_ranking';
14
+ $this->_blockGroup = 'dropship';
15
+ $this->_headerText = Mage::helper('dropship')->__('Vendor/Supplier Management');
16
+ $this->_addButtonLabel = Mage::helper('dropship')->__('Add Vendor Ranking');
17
+
18
+
19
+ $this->addButton('show_history',array(
20
+ 'label' => 'Show History',
21
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/showhistory') .'\')',
22
+ 'class' => 'save amosoft-button',
23
+ ));
24
+ $this->addButton('save_ranking_table',array(
25
+ 'label' => 'save ranking table',
26
+ 'onclick' => 'saveRankingTable()',
27
+ 'class' => 'save amosoft-button',
28
+ ));
29
+
30
+ $this->addButton('save_ranking',array(
31
+ 'label' => 'Save Ranking',
32
+ 'class' => 'save amosoft-button',
33
+ 'onclick' => 'saveRankingTable()',
34
+
35
+ ));
36
+ parent::__construct();
37
+ $this->setTemplate('amosoft/vendor_ranking.phtml');
38
+ $this->removeButton('add');
39
+ $this->removeButton('save_ranking_table');
40
+
41
+ }
42
+ public function getVendorCollection($type = 'no'){
43
+
44
+ $arrVendor = array();
45
+ $tempReslt = Mage::getModel('dropship/ranking')->getVendorCollection($type);
46
+ $result['gridData'] = Mage::helper('core')->jsonEncode($tempReslt);
47
+ if(!empty($tempReslt)){
48
+ foreach($tempReslt as $value){
49
+ $arrVendor[] = array('name'=>$value['name'],'code'=>$value['code']);
50
+ }
51
+ }
52
+ $result['arrayData'] = Mage::helper('core')->jsonEncode($arrVendor);
53
+ return $result;
54
+ }
55
+ public function getAttributeCode()
56
+ {
57
+ $helper = Mage::helper('dropship');
58
+ $attributeCode = array(array('link'=>'','name'=>$helper::AMOSOFT_PRODUCT_LINK_NONE),array('link'=>$helper::AMOSOFT_PRODUCT_LINK_CODE_UPC,'name'=>$helper::AMOSOFT_PRODUCT_LINK_UPC),array('link'=>$helper::AMOSOFT_PRODUCT_LINK_CODE_MNP,'name'=>$helper::AMOSOFT_PRODUCT_LINK_MNP),array('link'=>$helper::AMOSOFT_PRODUCT_LINK_CODE_SKU,'name'=>$helper::AMOSOFT_PRODUCT_LINK_SKU));
59
+ return Mage::helper('core')->jsonEncode($attributeCode);
60
+ }
61
+
62
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Ranking/Grid.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtml_Block_Widget_Grid
11
+ {
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->setId('amosoftgrid');
16
+ $this->setDefaultSort('ranking');
17
+ $this->setDefaultDir('ASC');
18
+ $this->setUseAjax(true);
19
+ $this->setSaveParametersInSession(true);
20
+ }
21
+
22
+ protected function _prepareCollection()
23
+ {
24
+ $collection = Mage::getModel('dropship/ranking')->getCollection();
25
+ $this->setCollection($collection);
26
+ return parent::_prepareCollection();
27
+ }
28
+
29
+ protected function _prepareColumns()
30
+ {
31
+
32
+ $this->addColumn('amosoft_vendor_code', array(
33
+ 'header' => Mage::helper('dropship')->__('Vendor Code'),
34
+ 'align' =>'right',
35
+ 'width' => '50px',
36
+ 'index' => 'amosoft_vendor_code',
37
+ ));
38
+ $this->addColumn('ranking', array(
39
+ 'header' => Mage::helper('dropship')->__('Position'),
40
+ 'align' =>'right',
41
+ 'width' => '50px',
42
+ 'type' => 'input',
43
+ 'index' => 'ranking',
44
+ 'inline_css' => 'vendor_ranking required-entry validate-digits validate-greater-than-zero',
45
+ ));
46
+ $this->addColumn('action',
47
+ array(
48
+ 'header' => Mage::helper('dropship')->__('Action'),
49
+ 'width' => '100',
50
+ 'type' => 'textaction',
51
+ 'getter' => 'getId',
52
+ 'actions' => array(
53
+ array(
54
+ 'caption' => Mage::helper('dropship')->__('edit'),
55
+ 'url' => array('base'=> '*/*/edit'),
56
+ 'field' => 'id'
57
+ ),
58
+ array(
59
+ 'caption' => Mage::helper('dropship')->__('delete'),
60
+ 'url' => array('base'=> '*/*/delete'),
61
+ 'field' => 'id',
62
+ 'confirm' =>'Are you sure to delete the Vendor?'
63
+
64
+ )
65
+ ),
66
+ 'filter' => false,
67
+ 'sortable' => false,
68
+ 'index' => 'stores',
69
+ 'is_system' => true,
70
+ 'renderer' => 'Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Textaction'
71
+ ));
72
+ return parent::_prepareColumns();
73
+ }
74
+
75
+
76
+
77
+
78
+ public function getRowUrl($row)
79
+ {
80
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
81
+ }
82
+ public function getGridUrl()
83
+ {
84
+ return $this->getUrl('*/*/grid', array('_current'=>true));
85
+ }
86
+
87
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sales/Order/View/Items.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adminhtml order items grid overwrite for Adding Amosoft order item details
4
+ *
5
+ * @category Amosoft
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_Sales_Order_View_Items extends Mage_Adminhtml_Block_Sales_Order_View_Items
9
+ {
10
+ /**
11
+ * Retrieve order items collection
12
+ *
13
+ * @return unknown
14
+ */
15
+ public function getItemsCollection()
16
+ {
17
+ $id = $this->getOrder()->getId();
18
+ $collection = Mage::getResourceModel('sales/order_item_collection');
19
+ $collection->getSelect()->joinLeft( array('abc'=> Mage::getSingleton('core/resource')->getTableName('dropship/orderitems')), "main_table.item_id = abc.item_id",array("abc.amosoft_item_status", "abc.amosoft_vendor_sku","abc.amosoft_vendor_code"))->where("main_table.order_id =".$id);
20
+ $collection->getSelect()->joinLeft( array('nr'=> Mage::getSingleton('core/resource')->getTableName('dropship/ranking')), "abc.amosoft_vendor_code = nr.amosoft_vendor_code",array("nr.amosoft_vendor_name"));
21
+ return $collection;
22
+ }
23
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Showhistory.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Showhistory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+ public function __construct()
12
+ {
13
+ $this->_controller = 'adminhtml_ranking';
14
+ $this->_blockGroup = 'dropship';
15
+ $this->_headerText = Mage::helper('dropship')->__('Vendor Ranking Log');
16
+ $this->__addBackButton = Mage::helper('dropship')->__('Back');
17
+ $this->addButton('back',array(
18
+ 'label' => 'Back',
19
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/') .'\')',
20
+ 'class' => 'back',
21
+ )
22
+ );
23
+ parent::__construct();
24
+ $this->removeButton('add');
25
+
26
+ }
27
+
28
+ public function getLogCollection(){
29
+ $collection = Mage::getModel('dropship/rankinglog')->getCollection();
30
+ $collection->getSelect()->order('created_at desc');
31
+ $logtable = array();
32
+ foreach($collection as $value){
33
+ $logtable[$value->getLabel()] = unserialize($value->getRankingData());
34
+ $logtable[$value->getLabel()]['created'] = $value->getCreatedAt();
35
+ }
36
+
37
+ return $logtable;
38
+ }
39
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+ public function __construct()
12
+ {
13
+ $this->_controller = 'adminhtml_sourcing';
14
+ $this->_blockGroup = 'dropship';
15
+ $this->_headerText = Mage::helper('dropship')->__('Order Management');
16
+ $this->_addButtonLabel = Mage::helper('dropship')->__('Add Vendor');
17
+ parent::__construct();
18
+ $this->removeButton('add');
19
+ }
20
+
21
+ public function getAmosoftOrderItemsDetails($item){
22
+
23
+ $ItemCollection = Mage::getModel('dropship/orderitems')->getCollection()->addFieldTofilter('item_order_id',$item->getOrderId())->addFieldTofilter('sku',$item->getSku());
24
+ $ItemCollection->getSelect()->joinLeft( array('nrank'=> Mage::getSingleton('core/resource')->getTableName('dropship/ranking')), "main_table.amosoft_vendor_code = nrank.amosoft_vendor_code",array("nrank.amosoft_vendor_name"));
25
+ return $ItemCollection->getFirstItem();
26
+ }
27
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+ public function __construct()
13
+ {
14
+
15
+
16
+ $this->_objectId = 'amosoft_item_id';
17
+ $this->_blockGroup = 'dropship';
18
+ $this->_controller = 'adminhtml_sourcing';
19
+ parent::__construct();
20
+
21
+ $this->_updateButton('save', 'label', Mage::helper('dropship')->__('Save Sourcing'));
22
+ $this->_updateButton('delete', 'label', Mage::helper('dropship')->__('Delete Supplier'));
23
+
24
+ $this->_addButton('saveandcontinue', array(
25
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
26
+ 'onclick' => 'saveAndContinueEdit()',
27
+ 'class' => 'save amosoft-button',
28
+ ), -100);
29
+ if(Mage::registry('sourcing_data')->getData('updated_by') != 'Amosoft'){
30
+
31
+ $this->_addButton('cancelitem', array(
32
+ 'label' => Mage::helper('adminhtml')->__('Cancel Item'),
33
+ 'onclick' => 'cancelItem()',
34
+ 'class' => 'delete',
35
+ ), -100);
36
+ }
37
+ $this->_removeButton('delete');
38
+ $this->_removeButton('reset');
39
+ $this->_formScripts[] = "
40
+
41
+ function saveAndContinueEdit(){
42
+ editForm.submit($('edit_form').action+'back/edit/');
43
+ }
44
+ function cancelItem(){
45
+ $('amosoft_vendor_code').className = '';
46
+ editForm.submit($('edit_form').action+'cancel/item/');
47
+ }
48
+ ";
49
+
50
+
51
+ }
52
+
53
+ public function getBackUrl()
54
+ {
55
+ return $this->getUrl('*/*/sourcinggrid');
56
+ }
57
+
58
+ public function getHeaderText()
59
+ {
60
+ if( Mage::registry('sourcing_data') && Mage::registry('sourcing_data')->getAmosoftItemId() ) {
61
+ return Mage::helper('dropship')->__("Edit Item Sourcing Supplier", $this->htmlEscape(Mage::registry('sourcing_data')->getTitle()));
62
+ } else {
63
+ return Mage::helper('dropship')->__('Select Sourcing Supplier');
64
+ }
65
+ }
66
+
67
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit/Form.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+ protected function _prepareForm()
13
+ {
14
+ $form = new Varien_Data_Form(array(
15
+ 'id' => 'edit_form',
16
+ 'action' => $this->getUrl('*/*/save', array('amosoft_item_id' => $this->getRequest()->getParam('amosoft_item_id'), 'qty'=>$this->getRequest()->getParam('qty'))),
17
+ 'method' => 'post',
18
+ 'enctype' => 'multipart/form-data'
19
+ )
20
+ );
21
+
22
+ $form->setUseContainer(true);
23
+ $this->setForm($form);
24
+ return parent::_prepareForm();
25
+ }
26
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit/Tab/Form.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
11
+ {
12
+
13
+ protected $_statusArray = array(
14
+ Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_TRANSMITTING,
15
+ Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_SOURCING,
16
+ Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_REPROCESS,
17
+ Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER,
18
+ Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_NO_DROPSHIP
19
+ );
20
+ protected function _prepareForm()
21
+ {
22
+ $form = new Varien_Data_Form();
23
+ $sku = Mage::registry('sourcing_data')->getData('sku');
24
+ $this->setForm($form);
25
+ $fieldset = $form->addFieldset('amosoft_form', array('legend'=>Mage::helper('dropship')->__('Item Sourcing Information')));
26
+
27
+ if(in_array(Mage::registry('sourcing_data')->getData('amosoft_item_status'),$this->_statusArray)){
28
+ $fieldset->addField('amosoft_vendor_code', 'select', array(
29
+ 'label' => Mage::helper('dropship')->__('Supplier'),
30
+ 'class' => 'required-entry validate-select',
31
+ 'required' => true,
32
+ 'name' => 'amosoft_vendor_code',
33
+ 'values' => Mage::getModel('dropship/system_config_source_vendorlist')->vendorListSourcing(true,$sku),
34
+ 'default' => '',
35
+ 'note' => 'Select your Dropship Supplier to source this item and bypass the dropship sourcing rule.'
36
+ ));
37
+ }
38
+ $fieldset->addField('amosoft_item_status', 'text', array(
39
+ 'label' => Mage::helper('dropship')->__('Amosoft Item Status'),
40
+ 'name' => 'amosoft_item_status',
41
+ 'note'=>'Read only filed',
42
+ 'readonly'=> true
43
+ ));
44
+
45
+
46
+ $fieldset->addField('sku', 'text', array(
47
+ 'label' => Mage::helper('dropship')->__('Sku'),
48
+ 'name' => 'sku',
49
+ 'note'=>'Read only filed',
50
+ 'readonly'=> true
51
+ ));
52
+ $fieldset->addField('item_order_id', 'hidden', array(
53
+ 'name' => 'item_order_id',
54
+ ));
55
+
56
+ $fieldset->addField('item_id', 'hidden', array(
57
+ 'name' => 'item_id',
58
+ ));
59
+
60
+ if ( Mage::getSingleton('adminhtml/session')->getSourcingData() )
61
+ {
62
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getSourcingData());
63
+ Mage::getSingleton('adminhtml/session')->setSourcingData(null);
64
+ } elseif ( Mage::registry('sourcing_data') ) {
65
+ $form->setValues(Mage::registry('sourcing_data')->getData());
66
+ }
67
+ return parent::_prepareForm();
68
+ }
69
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Edit/Tabs.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
11
+ {
12
+
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+ $this->setId('amosoft_tabs');
18
+ $this->setDestElementId('edit_form');
19
+ $this->setTitle(Mage::helper('dropship')->__('Item Sourcing Information'));
20
+ }
21
+
22
+ protected function _beforeToHtml()
23
+ {
24
+ $this->addTab('form_section', array(
25
+ 'label' => Mage::helper('dropship')->__('Item Sourcing Information'),
26
+ 'title' => Mage::helper('dropship')->__('Item Sourcing Information'),
27
+ 'content' => $this->getLayout()->createBlock('dropship/adminhtml_sourcing_edit_tab_form')->toHtml(),
28
+ ));
29
+
30
+ return parent::_beforeToHtml();
31
+ }
32
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/Grid.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_Grid extends Mage_Adminhtml_Block_Widget_Grid
11
+ {
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->setId('sourcinggrid');
16
+ $this->setDefaultSort('created_at');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ }
20
+
21
+ protected function _prepareCollection()
22
+ {
23
+ $tableName = Mage::getSingleton("core/resource")->getTableName('sales/order_item');
24
+
25
+ $collection = Mage::getModel('sales/order_item')->getCollection()->addFieldToSelect(array('qty_ordered','order_id'));
26
+
27
+ $collection->getSelect()->columns('if(`main_table`.`row_total` <> 0, `main_table`.`row_total`,(SELECT config.`row_total` FROM '.$tableName.' as simple INNER JOIN '.$tableName.' as config
28
+ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`item_id`)) as row_total');
29
+
30
+ $collection->getSelect()->join(array('amosoftItems'=>Mage::getSingleton('core/resource')->getTableName('dropship/orderitems')),
31
+ 'amosoftItems.item_id = main_table.item_id', array('item_order_id','amosoft_item_id'=>'id','amosoft_item_status','magento_sku'=>'sku','amosoft_vendor_code','amosoft_vendor_sku','vendor_cost','shipping_cost','updated_by','updated_at'));
32
+
33
+ $collection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
34
+ 'salesOrder.entity_id = main_table.order_id', array('increment_id','status','created_at'));
35
+
36
+ $collection->getSelect()->joinleft(array('amosoftRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship/ranking')),
37
+ 'amosoftRanking.amosoft_vendor_code = amosoftItems.amosoft_vendor_code', array('amosoft_vendor_name'));
38
+ $this->setCollection($collection);
39
+ return parent::_prepareCollection();
40
+ }
41
+
42
+ protected function _getStore()
43
+ {
44
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
45
+ return Mage::app()->getStore($storeId);
46
+ }
47
+
48
+ protected function prepareOptionValue(){
49
+
50
+ $itemStatus = array_merge(Mage::helper('dropship')->getItemStatuses(), array('Sent to Vendor'));
51
+ foreach($itemStatus as $status )
52
+ {
53
+ $options[$status] = Mage::helper('dropship')->__($status);
54
+ }
55
+ return $options;
56
+ }
57
+
58
+ protected function _prepareColumns()
59
+ {
60
+ $this->addColumn('increment_id', array(
61
+ 'header' => Mage::helper('dropship')->__('Order #'),
62
+ 'align' =>'right',
63
+ 'width' => '50px',
64
+ 'index' => 'increment_id',
65
+ ));
66
+ $this->addColumn('created_at', array(
67
+ 'header' => Mage::helper('dropship')->__('Order Date'),
68
+ 'align' =>'right',
69
+ 'width' => '50px',
70
+ 'type' => 'datetime',
71
+ 'filter_index' => 'salesOrder.created_at',
72
+ 'index' => 'created_at',
73
+ ));
74
+ $this->addColumn('magento_sku', array(
75
+ 'header' => Mage::helper('dropship')->__('Product Sku'),
76
+ 'align' =>'right',
77
+ 'width' => '50px',
78
+ "filter_index" => "amosoftItems.sku",
79
+ 'index' => 'magento_sku',
80
+ ));
81
+
82
+ $this->addColumn('amosoft_vendor_name', array(
83
+ 'header' => Mage::helper('dropship')->__('Vendor'),
84
+ 'align' =>'left',
85
+ 'width' => '80px',
86
+ 'index' => 'amosoft_vendor_name',
87
+ ));
88
+
89
+
90
+ $this->addColumn('amosoft_vendor_sku', array(
91
+ 'header' => Mage::helper('dropship')->__('Vendor Sku'),
92
+ 'align' =>'left',
93
+ 'width' => '80px',
94
+ 'index' => 'amosoft_vendor_sku',
95
+ ));
96
+ $store = $this->_getStore();
97
+ $this->addColumn('vendor_cost', array(
98
+ 'header' => Mage::helper('dropship')->__('Vendor Price'),
99
+ 'align' =>'left',
100
+ 'width' => '80px',
101
+ 'index' => 'vendor_cost',
102
+ 'type' => 'price',
103
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
104
+ ));
105
+
106
+ $this->addColumn('shipping_cost', array(
107
+ 'header' => Mage::helper('dropship')->__('Vendor Ship Cost'),
108
+ 'align' =>'left',
109
+ 'width' => '80px',
110
+ 'index' => 'shipping_cost',
111
+ 'type' => 'price',
112
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
113
+ ));
114
+
115
+ $this->addColumn('row_total', array(
116
+ 'header' => Mage::helper('dropship')->__('Website Product Price'),
117
+ 'align' =>'left',
118
+ 'width' => '80px',
119
+ 'index' => 'row_total',
120
+ 'type' => 'price',
121
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
122
+ ));
123
+ $this->addColumn('qty_ordered', array(
124
+ 'header' => Mage::helper('dropship')->__('Qty'),
125
+ 'align' =>'left',
126
+ 'width' => '80px',
127
+ 'index' => 'qty_ordered',
128
+ ));
129
+
130
+
131
+ $this->addColumn('amosoft_item_status', array(
132
+ 'header' => Mage::helper('dropship')->__('Drop Ship Status'),
133
+ 'align' =>'left',
134
+ 'width' => '80px',
135
+ 'index' => 'amosoft_item_status',
136
+ 'type' => 'options',
137
+ 'options' => $this->prepareOptionValue()
138
+ ));
139
+
140
+ $this->addColumn('status', array(
141
+ 'header' => Mage::helper('dropship')->__('Order Status'),
142
+ 'align' =>'left',
143
+ 'width' => '80px',
144
+ 'index' => 'status',
145
+ 'type' => 'options',
146
+ 'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
147
+ ));
148
+
149
+ $this->addColumn('updated_by', array(
150
+ 'header' => Mage::helper('dropship')->__('Last Updated By'),
151
+ 'align' =>'left',
152
+ 'width' => '80px',
153
+ 'index' => 'updated_by',
154
+ 'type' => 'options',
155
+ 'options' => array(
156
+ 'Pending' => Mage::helper('catalog')->__('Pending'),
157
+ 'User' => Mage::helper('catalog')->__('User'),
158
+ 'Cron' => Mage::helper('catalog')->__('Cron'),
159
+ 'Amosoft' => Mage::helper('catalog')->__('Amosoft'),
160
+ )
161
+ ));
162
+ $this->addColumn('updated_at', array(
163
+ 'header' => Mage::helper('dropship')->__('Updated On'),
164
+ 'align' =>'right',
165
+ 'width' => '50px',
166
+ 'type' => 'datetime',
167
+ 'filter_index' => 'amosoftItems.updated_at',
168
+ 'index' => 'updated_at',
169
+
170
+ ));
171
+
172
+ $this->addColumn('view',
173
+ array(
174
+ 'header' => Mage::helper('sales')->__('Action'),
175
+ 'width' => '50px',
176
+ 'type' => 'action',
177
+ 'renderer' => 'dropship/adminhtml_sourcing_history_renderer_action',
178
+ 'filter' => false,
179
+ 'sortable' => false,
180
+ 'index' => 'stores',
181
+ 'is_system' => true,
182
+ ));
183
+
184
+ $this->addColumn('action',
185
+ array(
186
+ 'header' => Mage::helper('dropship')->__('Edit'),
187
+ 'width' => '100px',
188
+ 'type' => 'textaction',
189
+ 'filter' => false,
190
+ 'sortable' => false,
191
+ 'index' => 'stores',
192
+ 'is_system' => true,
193
+ 'renderer' => 'Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Textaction'
194
+ ));
195
+
196
+
197
+ $this->addExportType('*/*/exportCsv', Mage::helper('dropship')->__('CSV'));
198
+ $this->addExportType('*/*/exportXml', Mage::helper('dropship')->__('XML'));
199
+ return parent::_prepareColumns();
200
+ }
201
+
202
+ public function getRowUrl($row)
203
+ {
204
+ //return $this->getUrl('*/*/edit', array('amosoft_item_id' => $row->getAmosoftItemId()));
205
+ }
206
+ public function getGridUrl()
207
+ {
208
+ //return $this->getUrl('*/*/grid', array('_current'=>true));
209
+ }
210
+
211
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/Renderer/Action.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adminhtml sourcing grid block action item renderer
4
+ *
5
+ * @category Amosoft
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_History_Renderer_Action
9
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
10
+ {
11
+ /**
12
+ * Render grid row
13
+ *
14
+ * @param Varien_Object $row
15
+ * @return string
16
+ */
17
+ public function render(Varien_Object $row)
18
+ {
19
+ $actions[] = array(
20
+ 'caption' => Mage::helper('sales')->__('View Order'),
21
+ 'url' => $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getItemOrderId())));
22
+ $actions[] = array(
23
+ 'caption' => Mage::helper('sales')->__('View History'),
24
+ 'url' => $this->getUrl('*/*/viewOrderItemHistory', array('amosoft_item_id' => $row->getItemId())))
25
+ ;
26
+
27
+ $this->getColumn()->setActions($actions);
28
+ return parent::render($row);
29
+ }
30
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/View.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adminhtml quotation view
5
+ *
6
+ * @category Amosoft
7
+ * @package Amosoft_Dropship
8
+ *
9
+ */
10
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_History_View extends Mage_Adminhtml_Block_Widget_Form_Container
11
+ {
12
+
13
+ public function __construct()
14
+ {
15
+ $this->_objectId = 'amosoft_item_id';
16
+ $this->_blockGroup = 'dropship';
17
+ $this->_controller = 'adminhtml_sourcing_history';
18
+ $this->_mode = 'view';
19
+ parent::__construct();
20
+ $data = array(
21
+ 'label' => 'Back',
22
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/sourcinggrid') . '\')',
23
+ 'class' => 'back'
24
+ );
25
+ $this->addButton ('custom_back', $data, 0, 100, 'header');
26
+ $this->_removeButton('back');
27
+ $this->_removeButton('reset');
28
+ $this->_removeButton('save');
29
+ $this->_removeButton('delete');
30
+ $this->setId('adminhtml_sourcing_history_view');
31
+ }
32
+
33
+ /**
34
+ * Get Header title
35
+ *
36
+ * @return string
37
+ */
38
+ public function getHeaderText()
39
+ {
40
+ $itemId = $this->getRequest()->getParam('amosoft_item_id');
41
+ $orderItems = Mage::getModel('dropship/orderitems')->load($itemId, 'item_id');
42
+ $orderId = Mage::getModel('sales/order')->load($orderItems->getItemOrderId())->getIncrementId();
43
+ $createdDate = Mage::helper('core')->formatDate($orderItems->getCreatedAt(), 'medium', true);
44
+ return Mage::helper('sales')->__('Item Sku %s | Order # %s | %s', $orderItems->getSku(), $orderId, $createdDate);
45
+ }
46
+
47
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/View/Form.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adminhtml sourcing history view panel
4
+ *
5
+ * @category Amosoft
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_History_View_Form extends Mage_Adminhtml_Block_Template
10
+ {
11
+ protected function _construct()
12
+ {
13
+ parent::_construct();
14
+ $this->setTemplate('amosoft/item_order_history.phtml');
15
+ }
16
+
17
+ /*
18
+ * To get the order item status history from serialized to unserialized form
19
+ *
20
+ * @return array
21
+ */
22
+ public function getHistory()
23
+ {
24
+ $ItemId = Mage::app()->getRequest()->getParam('amosoft_item_id');
25
+ $itemStatusHistory = Mage::getModel ( 'dropship/orderitems' )->load($ItemId, 'item_id')->getItemStatusHistory();
26
+ return unserialize($itemStatusHistory);
27
+ }
28
+
29
+
30
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Sourcing/History/View/Tabs.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sourcing History view tabs
4
+ *
5
+ * @category Amosoft
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_Sourcing_History_View_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
9
+ {
10
+
11
+ public function __construct()
12
+ {
13
+ parent::__construct();
14
+ $this->setId('adminhtml_sourcing_history_view');
15
+ $this->setDestElementId('history_view');
16
+ $this->setTitle(Mage::helper('dropship')->__('Order Item History'));
17
+ }
18
+
19
+ protected function _beforeToHtml()
20
+ {
21
+ $this->addTab('form_section', array(
22
+ 'label' => Mage::helper('dropship')->__('Order Item History'),
23
+ 'title' => Mage::helper('dropship')->__('Order Item History'),
24
+ ));
25
+
26
+ return parent::_beforeToHtml();
27
+ }
28
+
29
+
30
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Crontime.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_System_Config_Crontime extends Mage_Adminhtml_Block_System_Config_Form_Field
9
+ {
10
+ public function getName($name)
11
+ {
12
+ if (strpos($name, '[]') === false) {
13
+ $name.= '[]';
14
+ }
15
+ return $name;
16
+ }
17
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
18
+ {
19
+ $element->addClass('select');
20
+
21
+ $value_hrs = 0;
22
+ $value_min = 0;
23
+
24
+ if( $value = $element->getValue() ) {
25
+ $values = explode(',', $value);
26
+ if( is_array($values) && count($values) == 2 ) {
27
+ $value_hrs = $values[0];
28
+ $value_min = $values[1];
29
+ }
30
+ }
31
+
32
+ $html = '<input type="hidden" id="' . $element->getHtmlId() . '" />';
33
+ $html .= '<div style = "float: left;width: 100px;"><select name="'. $this->getName($element->getName()) . '" style="width:auto">'."\n";
34
+
35
+ for( $i=-2;$i<24;$i++ ) {
36
+ $hour = $i;
37
+ if($i == -1 )
38
+ $html.= '<option value="'.$hour.'" '. ( ($value_hrs == $i) ? 'selected="selected"' : '' ) .'> Every-Hour </option>';
39
+ else if($i == -2)
40
+ $html.= '<option value="-2" selected="selected">Please select</option>';
41
+ else
42
+ $html.= '<option value="'.$hour.'" '. ( ($value_hrs == $i) ? 'selected="selected"' : '' ) .'>' . $hour . '</option>';
43
+ }
44
+ $html.= '</select>'."\n <p class='note'><span>Hours</span></p> </div>";
45
+
46
+ $html.= '<div style = "padding-left:15px;float: left;width: 100px;"><select name="'. $this->getName($element->getName()) . '" style="width:auto">'."\n";
47
+
48
+ for( $i=-1;$i<60;$i++ ) {
49
+ $hour = $i;
50
+ if($i == -1 )
51
+ $html.= '<option value="'.$hour.'" '. ( ($value_min == $i) ? 'selected="selected"' : '' ) .'> Every-Min </option>';
52
+ else
53
+ $html.= '<option value="'.$hour.'" '. ( ($value_min == $i) ? 'selected="selected"' : '' ) .'>' . $hour . '</option>';
54
+ }
55
+ $html.= '</select>'."\n <p class='note'><span>Minutes</span></p></div>";
56
+ $html.= $element->getAfterElementHtml();
57
+ return $html;
58
+ }
59
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Fieldset/Hint.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_System_Config_Fieldset_Hint
9
+ extends Mage_Adminhtml_Block_Abstract
10
+ implements Varien_Data_Form_Element_Renderer_Interface
11
+ {
12
+ protected $_template = 'amosoft/system/config/fieldset/hint.phtml';
13
+
14
+ /**
15
+ * Render fieldset html
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+
21
+
22
+ public function render(Varien_Data_Form_Element_Abstract $element)
23
+ {
24
+
25
+ return $this->toHtml();
26
+ }
27
+
28
+
29
+
30
+ public function getStoreList(){
31
+
32
+ return Mage::getModel('dropship/system_config_source_store')->toOptionArray();
33
+
34
+ }
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Helplink.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_System_Config_Helplink extends Mage_Adminhtml_Block_System_Config_Form_Field
10
+ {
11
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
+ {
13
+ $url = Mage::helper('dropship')->getConfigObject('apiconfig/helpurl/link');
14
+ $html = parent::_getElementHtml($element);
15
+ $html .= "<a href='{$url}' target='_blank' title='amosoft'>Visit dropship Knowledge Base</a>";
16
+ return $html;
17
+ }
18
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Singuplink.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_System_Config_Singuplink extends Mage_Adminhtml_Block_System_Config_Form_Field
10
+ {
11
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
+ {
13
+ $url = 'https://portal.amosoft.com/';
14
+ $html = parent::_getElementHtml($element);
15
+ $html .= "<a href='{$url}' target='_blank' title='amosoft'>Sign up here</a>";
16
+ return $html;
17
+ }
18
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Submitbutton.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_System_Config_Submitbutton
9
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
10
+ {
11
+ /*
12
+ * Set template
13
+ */
14
+ protected function _construct()
15
+ {
16
+ parent::_construct();
17
+ }
18
+
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
20
+ {
21
+ $element->setReadonly('readonly');
22
+ return parent::_getElementHtml($element);
23
+ }
24
+
25
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/System/Config/Time.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_System_Config_Time extends Mage_Adminhtml_Block_System_Config_Form_Field
9
+ {
10
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
11
+ {
12
+ $html = '';
13
+ if(strstr($element->getName(),'schedule_backorder') ){
14
+ $selectedHourValue = Mage::getStoreConfig('amosoft_sourcing/cron_settings/schedule_backorder_hour');
15
+ $selectedMinValue = Mage::getStoreConfig('amosoft_sourcing/cron_settings/schedule_backorder_min');
16
+ $idHour = $element->getHtmlId().'_hour';
17
+ $nameHour = str_replace("schedule_backorder","schedule_backorder_hour",$element->getName());
18
+ $idMin = $element->getHtmlId().'_min';
19
+ $nameMin = str_replace("schedule_backorder","schedule_backorder_min",$element->getName());
20
+ }else {
21
+ $selectedHourValue = Mage::getStoreConfig('amosoft_sourcing/cron_settings/schedule_sourcing_hour');
22
+ $selectedMinValue = Mage::getStoreConfig('amosoft_sourcing/cron_settings/schedule_sourcing_min');
23
+ $idHour = $element->getHtmlId().'_hour';
24
+ $nameHour = str_replace("schedule_sourcing","schedule_sourcing_hour",$element->getName());
25
+ $idMin = $element->getHtmlId().'_min';
26
+ $nameMin = str_replace("schedule_sourcing","schedule_sourcing_min",$element->getName());
27
+
28
+ }
29
+
30
+ $html .= '<div style="float:left;width:100px"><select onchange = "onChangeHour'.$idHour.'(this.value)" style="width:109px" id="'.$idHour.'" name="'.$nameHour.'" class=" select">';
31
+ for( $i=0;$i<=24;$i++ ) {
32
+ $isSelected = ($selectedHourValue == $i) ? 'selected="selected"':'';
33
+ $html .= "<option value='{$i}'{$isSelected}>{$i}</option>";
34
+ }
35
+
36
+ $html .= '</select>';
37
+ $html .= '<p class="note"><span>Hours.</span></p></div>';
38
+ //$html .= '&nbsp;';
39
+ $html .= '<div style="float:right;width:100px"><select style="width:109px" id="'.$idMin.'" name="'.$nameMin.'" class=" select">';
40
+
41
+ $j = 0;
42
+ for( $i=10;$i<=60;$i++ ) {
43
+
44
+ if($i >= $j+10 ){
45
+ $isSelected = ($selectedMinValue == $i) ? 'selected="selected"':'';
46
+ $html .= "<option value='{$i}'{$isSelected}>{$i}</option>";
47
+ $j = $j+10;
48
+ }
49
+ }
50
+
51
+ $html .= '</select>';
52
+ $html .= '<p class="note"><span>Minutes.</span></p></div>';
53
+ $html .= '<script type="text/javascript">//<![CDATA[
54
+ function onChangeHour'.$idHour.'(value){
55
+
56
+ var x = document.getElementById("'.$idMin.'");
57
+ if(value > 0){
58
+ var options = $$("select#'.$idMin.' option");
59
+ var len = options.length;
60
+ for (var i = 0; i < len; i++) {
61
+ if(options[i].value == 0)
62
+ return;
63
+ }
64
+ var option = document.createElement("option");
65
+ option.text = "0";
66
+ option.value = "0";
67
+ x.add(option,0);
68
+ }else
69
+ {
70
+ //x.remove(0);
71
+ }
72
+ }
73
+ //]]></script>';
74
+ return $html;
75
+ }
76
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Upload extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+ protected $_headerText = 'Upload Vendor Product';
12
+ protected $_isProductSetupMode = false;
13
+ public function __construct()
14
+ {
15
+ $this->addButton('download_sample_csv',array(
16
+ 'label' => 'Download Sample Csv',
17
+ 'onclick' => 'downloadSampleCsv()',
18
+ 'class' => 'save amosoft-button',
19
+ ));
20
+ $this->addButton('history',array(
21
+ 'label' => 'History',
22
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/adminhtml_upload/vendorsuploadhistory') .'\')',
23
+ 'class' => 'save amosoft-button',
24
+ ));
25
+ parent::__construct();
26
+
27
+ $this->removeButton('back')
28
+ ->removeButton('reset')
29
+ ->_updateButton('save', 'label', $this->__('Upload'))
30
+ ->_updateButton('save', 'id', 'upload_button');
31
+ $this->_formScripts[] = "
32
+ function uploadVendorProductStep(){
33
+ var activeRankers = ".$this->getActiveRankers()."
34
+ var url;
35
+ var selectBox = $('vendor');
36
+ if(selectBox.selectedIndex <= 0 ){
37
+ alert('please select a Vendor');
38
+ return;
39
+ }
40
+ var r = confirm('Are you sure you want to setup this supplier for all Magento Products?');
41
+ if (r == true) {
42
+ if(activeRankers.indexOf(selectBox.value) == -1)
43
+ {
44
+ alert('supplier is Inactive - Cannot Setup Vendor on All Products');
45
+ return;
46
+ }
47
+ url = '". $this->getSetupUrl() ."amosoft_vendor_code/'+selectBox.value;
48
+ //alert(url);
49
+ window.open(url);
50
+ $('vendor_product_setup').addClassName('disabled');
51
+ $('vendor_product_setup').disable();
52
+ } else {
53
+ return;
54
+ }
55
+ }";
56
+ //->_updateButton('save', 'onclick', 'editForm.postToFrame();');
57
+ }
58
+
59
+ /**
60
+ * Internal constructor
61
+ *
62
+ * @return void
63
+ */
64
+ protected function _construct()
65
+ {
66
+ parent::_construct();
67
+ $this->_blockGroup = 'dropship';
68
+ $this->_controller = 'adminhtml_upload';
69
+ }
70
+
71
+ /**
72
+ * set header text
73
+ *
74
+ * @return string
75
+ */
76
+ public function setHeaderText($header)
77
+ {
78
+ return $this->_headerText = $header ;
79
+ }
80
+ public function setProductSetupMode($bool = false)
81
+ {
82
+ $this->_isProductSetupMode = $bool;
83
+ }
84
+ public function getProductSetupMode()
85
+ {
86
+ return $this->_isProductSetupMode;
87
+ }
88
+ public function getFormHtml()
89
+ {
90
+ $this->getChild('form')->setData('action', $this->getSaveUrl());
91
+ $this->getChild('form')->setData('productsetupmode', $this->_isProductSetupMode);
92
+ $this->getChild('form')->setData('legendtext', $this->_headerText);
93
+ return $this->getChildHtml('form');
94
+ }
95
+ protected function getActiveRankers()
96
+ {
97
+ $rankersArray = array();
98
+ $collection = Mage::getModel('dropship/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
99
+ if($collection->count() > 0){
100
+ foreach($collection as $data){
101
+ $rankersArray[] = $data->getAmosoftVendorCode();
102
+ }
103
+ }
104
+ return Mage::helper('core')->jsonEncode($rankersArray);
105
+ }
106
+ protected function getSetupUrl()
107
+ {
108
+ return $this->getUrl('*/adminhtml_upload/run');
109
+ }
110
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload/Bulkassign.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ class Amosoft_Dropship_Block_Adminhtml_Upload_Bulkassign extends Mage_Adminhtml_Block_Abstract
10
+ {
11
+ /**
12
+ * Flag for batch model
13
+ * @var boolean
14
+ */
15
+ protected $_batchModelPrepared = false;
16
+ /**
17
+ * Batch model instance
18
+ * @var Mage_Dataflow_Model_Batch
19
+ */
20
+ protected $_batchModel = null;
21
+ /**
22
+ * Preparing batch model (initialization)
23
+ * @return Mage_Adminhtml_Block_System_Convert_Profile_Run
24
+ */
25
+
26
+ protected function _construct()
27
+ {
28
+ parent::_construct();
29
+ Mage::getSingleton('adminhtml/session')->setTerminateExecution(false);
30
+
31
+
32
+ }
33
+ protected function _prepareBatchModel()
34
+ {
35
+ if ($this->_batchModelPrepared) {
36
+ return $this;
37
+ }
38
+ $this->setShowFinished(true);
39
+ $batchModel = Mage::getModel('dropship/uploadvendor')->prepareBulkassignmentCollection($this->getBulkVendorCode());
40
+ if (count($batchModel) > 0) {
41
+
42
+ $numberOfRecords = 100;
43
+ $this->setShowFinished(false);
44
+ $importIds = $batchModel;
45
+ $this->setBatchItemsCount(count($batchModel));
46
+ $this->setBatchConfig(
47
+ array(
48
+ 'styles' => array(
49
+ 'error' => array(
50
+ 'icon' => Mage::getDesign()->getSkinUrl('images/error_msg_icon.gif'),
51
+ 'bg' => '#FDD'
52
+ ),
53
+ 'message' => array(
54
+ 'icon' => Mage::getDesign()->getSkinUrl('images/fam_bullet_success.gif'),
55
+ 'bg' => '#DDF'
56
+ ),
57
+ 'loader' => Mage::getDesign()->getSkinUrl('images/ajax-loader.gif')
58
+ ),
59
+ 'template' => '<li style="#{style}" id="#{id}">'
60
+ . '<img id="#{id}_img" src="#{image}" class="v-middle" style="margin-right:5px"/>'
61
+ . '<span id="#{id}_status" class="text">#{text}</span>'
62
+ . '</li>',
63
+ 'text' => $this->__('Processed <strong>%s%% %s/%d</strong> records', '#{percent}', '#{updated}', $this->getBatchItemsCount()),
64
+ 'successText' => $this->__('Imported <strong>%s</strong> records', '#{updated}')
65
+ )
66
+ );
67
+ $jsonIds = array_chunk($importIds, $numberOfRecords);
68
+ $importData = array();
69
+ foreach ($jsonIds as $part => $ids) {
70
+ $importData[] = array(
71
+ 'vendor_code' => $this->getBulkVendorCode(),
72
+ 'rows[]' => $ids
73
+ );
74
+ }
75
+ $this->setImportData($importData);
76
+
77
+ }
78
+ $this->_batchModelPrepared = true;
79
+ return count($batchModel);
80
+ }
81
+ /**
82
+ * Return a batch model instance
83
+ * @return Mage_Dataflow_Model_Batch
84
+ */
85
+ protected function _getBatchModel()
86
+ {
87
+ return $this->_batchModel;
88
+ }
89
+ /**
90
+ * Return a batch model config JSON
91
+ * @return string
92
+ */
93
+ public function getBatchConfigJson()
94
+ {
95
+ return Mage::helper('core')->jsonEncode(
96
+ $this->getBatchConfig()
97
+ );
98
+ }
99
+ /**
100
+ * Encoding to JSON
101
+ * @param string $source
102
+ * @return string JSON
103
+ */
104
+ public function jsonEncode($source)
105
+ {
106
+ return Mage::helper('core')->jsonEncode($source);
107
+ }
108
+ /**
109
+ * Get a profile
110
+ * @return object
111
+ */
112
+ public function getBulkVendorCode()
113
+ {
114
+ return Mage::registry('bulk_vendor_Code');
115
+ }
116
+ /**
117
+ * Generating form key
118
+ * @return string
119
+ */
120
+ public function getFormKey()
121
+ {
122
+ return Mage::getSingleton('core/session')->getFormKey();
123
+ }
124
+ /**
125
+ * Return batch model and initialize it if need
126
+ * @return Mage_Dataflow_Model_Batch
127
+ */
128
+ public function getBatchModel()
129
+ {
130
+ return $this->_prepareBatchModel();
131
+ }
132
+ /**
133
+ * Generating exceptions data
134
+ * @return array
135
+ */
136
+ public function getExceptions()
137
+ {
138
+ if (!is_null(parent::getExceptions()))
139
+ return parent::getExceptions();
140
+ $exceptions = array();
141
+ $this->getProfile()->run();
142
+ foreach ($this->getProfile()->getExceptions() as $e) {
143
+ switch ($e->getLevel()) {
144
+ case Varien_Convert_Exception::FATAL:
145
+ $img = 'error_msg_icon.gif';
146
+ $liStyle = 'background-color:#FBB; ';
147
+ break;
148
+ case Varien_Convert_Exception::ERROR:
149
+ $img = 'error_msg_icon.gif';
150
+ $liStyle = 'background-color:#FDD; ';
151
+ break;
152
+ case Varien_Convert_Exception::WARNING:
153
+ $img = 'fam_bullet_error.gif';
154
+ $liStyle = 'background-color:#FFD; ';
155
+ break;
156
+ case Varien_Convert_Exception::NOTICE:
157
+ $img = 'fam_bullet_success.gif';
158
+ $liStyle = 'background-color:#DDF; ';
159
+ break;
160
+ }
161
+ $exceptions[] = array(
162
+ "style" => $liStyle,
163
+ "src" => Mage::getDesign()->getSkinUrl('images/'.$img),
164
+ "message" => $e->getMessage(),
165
+ "position" => $e->getPosition()
166
+ );
167
+ }
168
+ parent::setExceptions($exceptions);
169
+ return $exceptions;
170
+ }
171
+
172
+
173
+
174
+ protected function isManualUploadRunning(){
175
+
176
+ $result = false;
177
+ if(Mage::helper('dropship')->isProcessRunning('manual_upload')){
178
+ $result = true;
179
+ }
180
+ return $result;
181
+ }
182
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload/Edit/Button.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_Upload_Edit_Button extends Varien_Data_Form_Element_Abstract {
9
+
10
+ protected $_element;
11
+
12
+ public function getElementHtml()
13
+ {
14
+ $enable = ($this->getDisabled()) ? 'disabled' : "";
15
+ $required = ($this->getRequired()) ? 'required-entry' : "";
16
+
17
+ $html = '<button id="'.$this->getId().'" title="'.$this->getTitle().'" type="button" class="scalable save '.$required.' '.$enable.'" onclick="'.$this->getOnclick().'" '.$enable.'><span><span><span>'.$this->getValue().'</span></span></span></button>';
18
+ $html .= '<div id="email-list"></div>';
19
+ return $html;
20
+
21
+ }
22
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Upload/Edit/Form.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Upload_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
10
+ {
11
+ /**
12
+ * Add fieldset
13
+ *
14
+ * @return Mage_ImportExport_Block_Adminhtml_Import_Edit_Form
15
+ */
16
+ protected function _prepareForm()
17
+ {
18
+ $isProductSetupMode = $this->getProductsetupmode();
19
+ $form = new Varien_Data_Form(array(
20
+ 'id' => 'edit_form',
21
+ 'action' => ($isProductSetupMode) ? $this->getUrl('*/adminhtml_upload/uploadFile') : $this->getUrl('*/*/uploadFile'),
22
+ 'method' => 'post',
23
+ 'enctype' => 'multipart/form-data'
24
+ ));
25
+ $legend = ($isProductSetupMode) ? $this->getLegendtext() : 'Import Settings';
26
+ $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('importexport')->__($legend)));
27
+ $isProcessContinue = Mage::helper('dropship')->isProcessRunning('bulk_assign');
28
+ $fieldset->addField('productsetupmode', 'hidden', array(
29
+ 'name' => 'productsetupmode',
30
+ 'value' => $isProductSetupMode
31
+ ));
32
+ //var_dump($isProcessContinue);
33
+ $fieldset->addField('vendor', 'select', array(
34
+ 'name' => 'vendor',
35
+ 'title' => Mage::helper('importexport')->__('Vendor'),
36
+ 'label' => Mage::helper('importexport')->__('Vendor'),
37
+ 'required' => true,
38
+ 'values' => Mage::getModel('dropship/system_config_source_vendorlist')->getAllVendor()
39
+ ));
40
+ if($isProductSetupMode){
41
+ $fieldset->addType('custombutton', 'Amosoft_Dropship_Block_Adminhtml_Upload_Edit_Button');
42
+ $fieldset->addField('vendor_product_setup', 'custombutton', array(
43
+ 'name' => 'vendor_product_setup',
44
+ 'title' => Mage::helper('importexport')->__('Setup Vendor on all Products'),
45
+ 'required' => false,
46
+ 'disabled' => ($isProcessContinue) ? true : false,
47
+ 'value' => 'Setup Vendor on all Products',
48
+ 'onclick' => 'uploadVendorProductStep()'
49
+ ));
50
+ }
51
+ $fieldset->addField(Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE, 'file', array(
52
+ 'name' => Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE,
53
+ 'label' => Mage::helper('importexport')->__('Select File to Import'),
54
+ 'title' => Mage::helper('importexport')->__('Select File to Import'),
55
+ 'required' => true
56
+ ));
57
+
58
+ $form->setUseContainer(true);
59
+ $this->setForm($form);
60
+
61
+ return parent::_prepareForm();
62
+ }
63
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Vendorproductuploadhistory.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Block_Adminhtml_Vendorproductuploadhistory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+
12
+ protected $_message = array(
13
+ 'row_magento_sku'=>'Missing Data at Row(s) for Magento Sku row_num',
14
+ 'row_vendor_sku'=>'Missing Data at Row(s) for Vendor Sku row_num',
15
+ 'row_qty'=>'Bad Data for Qty at Row(s) row_num',
16
+ 'row_cost'=>'Bad Data for Cost at Row(s) row_num',
17
+ 'empty_file'=>'Sorry,we cant find the record to update inventory',
18
+ 'inventory_update_error'=>'Error in updating magento product inventory, magento_sku',
19
+ 'magento_sku_exists'=>'magento product sku not exist magento_sku',
20
+ 'inventory_add_error'=>'Error in adding magento product inventory, magento_sku',
21
+ 'combination_notexist'=>'Vendor Sku vendor_sku & Supplier code vendor_code combination does not exist',
22
+ 'already_assigned'=>'Vendor sku vendor_sku is already been assigned for this vendor',
23
+ 'duplicate_vendor_sku'=>'Vendor sku vendor_sku is duplicate in Magento Sku magento_sku for this supplier',
24
+ 'combination_exist'=> 'Vendor sku vendor_sku or Supplier code vendor_code combination already present for Magento Sku magento_sku',
25
+ 'data_notchnage'=> 'Cost & Qty for Vendor Sku vendor_sku & Supplier code vendor_code not changed',
26
+ 'amosoft_upc_notexist'=> 'UPC attribute missing vendor_sku',
27
+ 'amosoft_upc_multiple'=> 'Multiple Match found for UPC vendor_sku',
28
+ 'amosoft_mnp_notexist'=> 'MNP attribute missing vendor_sku',
29
+ 'amosoft_mnp_multiple'=> 'Multiple Match found for MNP vendor_sku',
30
+ 'sku_multiple'=> 'Multiple Match found for SKU vendor_sku',
31
+ 'attribute_notexist'=> 'Attribute assigned for Supplier code vendor_code does not exist for Vendor sku vendor_sku'
32
+ );
33
+ protected $_replace = array('magento_sku','vendor_sku','vendor_code');
34
+ public function __construct()
35
+ {
36
+ $backButtonUrl = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl('*/*/');
37
+ $this->_controller = 'adminhtml_ranking';
38
+ $this->_blockGroup = 'dropship';
39
+ $this->_headerText = Mage::helper('dropship')->__('Vendor Product Upload Log');
40
+ $this->__addBackButton = Mage::helper('dropship')->__('Back');
41
+ $this->addButton('back',array(
42
+ 'label' => 'Back',
43
+ 'onclick' => 'setLocation(\'' . $backButtonUrl .'\')',
44
+ 'class' => 'back',
45
+ )
46
+ );
47
+
48
+ parent::__construct();
49
+ $this->removeButton('add');
50
+
51
+ }
52
+
53
+ public function getMessageArray(){
54
+ return $this->_message;
55
+ }
56
+
57
+ public function getReplaceValue(){
58
+ return $this->_replace;
59
+ }
60
+ public function getLogCollection(){
61
+
62
+ $conn = Mage::getModel('dropship/uploadvendor')->getDatabaseConnection();
63
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log' );
64
+ $select = $conn->select()->from($tableVendorImportLog)->order('created_at DESC');
65
+ $stmt = $conn->query($select);
66
+ $rows = $stmt->fetchAll();
67
+ return $rows;
68
+ }
69
+
70
+ public function getLogDescriptionCollection($error_id){
71
+ $conn = Mage::getModel('dropship/uploadvendor')->getDatabaseConnection();
72
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log_desc' );
73
+ $select = $conn->select()->from($tableVendorImportLog)->where('error_id ='.$error_id);
74
+ $stmt = $conn->query($select);
75
+ $rows = $stmt->fetchAll();
76
+ return $rows;
77
+ }
78
+
79
+ public function parseDescription($data,$vendorCode){
80
+
81
+ $decodedata = $this->prepareRowData($data);
82
+ if(!is_array($decodedata) || empty($decodedata))
83
+ return empty($decodedata) ? implode('',$decodedata) : $decodedata;
84
+ $htmlStart = '<ul>';
85
+ $htmlEnd = '</ul>';
86
+ foreach($decodedata as $data){
87
+ $msg = $this->_message[$data['error_type']];
88
+
89
+ if(is_array($data['value']) && !empty($data['value'])){
90
+
91
+ $htmlStart .= $this->genrateHtml($data['value'],$msg,$vendorCode);
92
+ }else{
93
+ $htmlStart .= '<li>'.str_replace('row_num',$data['value'],$msg).'</li>';
94
+ }
95
+ }
96
+ return $htmlStart.$htmlEnd;
97
+ }
98
+
99
+ public function genrateHtml($value,$msg,$vendorCode){
100
+
101
+ $string = $msg;
102
+ $value['vendor_code'] = $vendorCode;
103
+ foreach($this->_replace as $val){
104
+
105
+ if(strstr($string,$val))
106
+ $string = str_replace($val,$value[$val],$string);
107
+ }
108
+
109
+ return '<li>'.$string.'</li>';
110
+ }
111
+
112
+ public function prepareRowData($data)
113
+ {
114
+ $decodedata = array();
115
+ $dataTemp = array();
116
+ if(is_numeric($data))
117
+ {
118
+ $rowData = $this->getLogDescriptionCollection($data);
119
+ if(count($rowData) > 0)
120
+ {
121
+ foreach($rowData as $eachRow)
122
+ {
123
+ $decodedata[] = array_merge($dataTemp, $this->getDecodedJson($eachRow['description']));
124
+ }
125
+ }
126
+ }else
127
+ {
128
+ $decodedata = $this->getDecodedJson($data);
129
+ }
130
+ return $decodedata;
131
+ }
132
+ protected function getDecodedJson($data)
133
+ {
134
+ if(empty($data) || !Mage::helper('dropship')->isJson($data)){
135
+ return $data;
136
+ }
137
+ $data = trim($data,'"');
138
+ $data = trim($data,'\'');
139
+ $decodedata = Mage::helper('core')->jsonDecode($data);
140
+ return $decodedata;
141
+ }
142
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Nameaction.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Nameaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
11
+ {
12
+
13
+ /**
14
+ * Renders column
15
+ *
16
+ * @param Varien_Object $row
17
+ * @return string
18
+ */
19
+ public function render(Varien_Object $row)
20
+ {
21
+ $sku = $row->getData('product_sku');
22
+ $productObject = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
23
+ if ($productObject)
24
+ $out = $productObject->getName();
25
+ else
26
+ $out = '';
27
+ return $out;
28
+ }
29
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Orderaction.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Orderaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
9
+ {
10
+
11
+ /**
12
+ * Renders column
13
+ *
14
+ * @param Varien_Object $row
15
+ * @return string
16
+ */
17
+ public function render(Varien_Object $row)
18
+ {
19
+ $incrementId = $row->getData($this->getColumn()->getIndex());
20
+ $order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
21
+ if ($order)
22
+ $out = '<a target="_blank" rel="external" href="'.Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId())).'">'.$incrementId.'</a>';
23
+ else
24
+ $out = $incrementId;
25
+ return $out;
26
+ }
27
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Skuaction.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Skuaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
11
+ {
12
+
13
+ /**
14
+ * Renders column
15
+ *
16
+ * @param Varien_Object $row
17
+ * @return string
18
+ */
19
+ public function render(Varien_Object $row)
20
+ {
21
+
22
+ if($row->getData('product_sku'))
23
+ {
24
+ $label = ($this->getColumn()->getIndex() == 'amosoft_vendor_sku') ? $row->getData('amosoft_vendor_sku'):$row->getData('product_sku');
25
+ }
26
+ else
27
+ { $productid = Mage::getModel('catalog/product')->getIdBySku(trim($row->getData('sku')));
28
+ $vendorScreenUrl = ($this->getColumn()->getIndex() == 'amosoft_vendor_sku') ? 'back/edit/tab/product_info_tabs_vendor_tab':'';
29
+ $labeltxt = ($this->getColumn()->getIndex() == 'amosoft_vendor_sku') ? $row->getData('amosoft_vendor_sku'):$row->getData('sku');
30
+ $label = '<a href="'.$this->getUrl('adminhtml/catalog_product/edit',array('id'=>$productid)).$vendorScreenUrl.'" target="_blank"><strong>'.$labeltxt.'</strong></a>';
31
+ }
32
+ return $label;
33
+ }
34
+ }
app/code/local/Amosoft/Dropship/Block/Adminhtml/Widget/Grid/Column/Textaction.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Block_Adminhtml_Widget_Grid_Column_Textaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
9
+ {
10
+
11
+ /**
12
+ * Renders column
13
+ *
14
+ * @param Varien_Object $row
15
+ * @return string
16
+ */
17
+ public function render(Varien_Object $row)
18
+ {
19
+
20
+ $actions[] = array(
21
+ 'caption' => Mage::helper('sales')->__('Edit'),
22
+ 'url' => $this->getUrl('*/*/edit', array('amosoft_item_id' => $row->getAmosoftItemId(), 'qty'=> (int)$row->getQtyOrdered())))
23
+ ;
24
+ if ( empty($actions) || !is_array($actions) || !in_array($row->getAmosoftItemStatus(),array('Backorder'))) {
25
+ return '&nbsp;';
26
+ }
27
+ $out="";
28
+ if(!$this->getColumn()->getNoLink()) {
29
+ foreach ($actions as $action) {
30
+ if ( is_array($action) ) {
31
+ $out .= "&nbsp;&nbsp;&nbsp;".$this->_toLinkHtml($action, $row);
32
+ }
33
+ }
34
+ }
35
+ return $out;
36
+
37
+ }
38
+ }
app/code/local/Amosoft/Dropship/Helper/Data.php ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Helper_Data extends Mage_Core_Helper_Abstract
11
+ {
12
+
13
+ const AMOSOFT_ITEM_STATUS_TRANSMITTING = 'Transmitting';
14
+ const AMOSOFT_ITEM_STATUS_SOURCING = 'Sourcing';
15
+ const AMOSOFT_ITEM_STATUS_REPROCESS = 'Reprocess';
16
+ const AMOSOFT_ITEM_STATUS_BACKORDER = 'Backorder';
17
+ const AMOSOFT_ITEM_STATUS_SENT_TO_SUPPLIER = 'Sent to Supplier';
18
+ const AMOSOFT_ITEM_STATUS_CANCELLED = 'Cancelled';
19
+ const AMOSOFT_ITEM_STATUS_NO_DROPSHIP = 'No Dropship';
20
+ const AMOSOFT_ITEM_STATUS_COMPLETED = 'Completed';
21
+ const AMOSOFT_PRODUCT_LINK_UPC = 'UPC';
22
+ const AMOSOFT_PRODUCT_LINK_MNP = 'Manufacturer Part Number';
23
+ const AMOSOFT_PRODUCT_LINK_SKU = 'Magento Sku';
24
+ const AMOSOFT_PRODUCT_LINK_NONE = 'None';
25
+ const AMOSOFT_PRODUCT_LINK_CODE_UPC = 'amosoft_upc';
26
+ const AMOSOFT_PRODUCT_LINK_CODE_MNP = 'amosoft_mnp';
27
+ const AMOSOFT_PRODUCT_LINK_CODE_SKU = 'sku';
28
+ protected $_maxtime = 60; // time in minutes
29
+ protected $_shipping_cost;
30
+
31
+ public function getConfigObject($nodeName = null)
32
+ {
33
+ return trim(Mage::getConfig()->getNode($nodeName)->__toString());
34
+ }
35
+
36
+ public function getItemStatuses()
37
+ {
38
+ return array('Sourcing','Reprocess','Backorder','Transmitting','Sent to Supplier','Cancelled','No Dropship','Completed');
39
+ }
40
+
41
+ public function getIsQtyDecimal($product_sku,$inventory)
42
+ {
43
+ if($product_sku){
44
+ $is_qty_decimal = $this->checkIsQtyDecimal($product_sku);
45
+ if($is_qty_decimal == 1)
46
+ {
47
+ $inventory = $inventory;
48
+ }
49
+ else
50
+ {
51
+ $inventory = floor($inventory);
52
+ }
53
+
54
+ }
55
+ return $inventory;
56
+ }
57
+
58
+ public function checkIsQtyDecimal($product_sku){
59
+
60
+ $is_qty_decimal = 0;
61
+ $product_collection = Mage::getResourceModel('catalog/product_collection');
62
+ $product_collection->getSelect()->join(Mage::getConfig()->getTablePrefix().'cataloginventory_stock_item', 'e.entity_id ='.Mage::getConfig()->getTablePrefix().'cataloginventory_stock_item.product_id');
63
+ $product_collection->getSelect()->where('e.sku = ' ."'" .$product_sku."'");
64
+ $product_collection_count = count($product_collection);
65
+ if($product_collection_count > 0)
66
+ {
67
+ $is_qty_decimal = $product_collection->getFirstItem ()->getData('is_qty_decimal');
68
+
69
+ }
70
+
71
+ return $is_qty_decimal;
72
+ }
73
+
74
+ public function getDatabaseConnection() {
75
+ return Mage::getSingleton ( 'core/resource' );
76
+ }
77
+
78
+ public function getTableName($name)
79
+ {
80
+ return $this->getDatabaseConnection()->getTableName ( $name );
81
+ }
82
+
83
+ public function isProcessRunning($type){
84
+
85
+ $isProcessRunning = false;
86
+ if($this->selectTmpTableData($type))
87
+ {
88
+ if(!$this->isProcessHault($type))
89
+ {
90
+ $isProcessRunning = true;
91
+ }
92
+ }
93
+
94
+ return $isProcessRunning;
95
+ }
96
+
97
+ public function startProcess($type){
98
+
99
+ if(!$this->selectTmpTableData($type))
100
+ {
101
+ $this->insertTmpTableData($type);
102
+ }
103
+ return;
104
+ }
105
+
106
+
107
+ public function finishProcess($type){
108
+ $this->deleteTmpTableData($type);
109
+ }
110
+
111
+ protected function insertTmpTableData($type){
112
+ $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
113
+ $updatedAt = Mage::getModel('core/date')->gmtDate();
114
+ $createAt = Mage::getModel('core/date')->gmtDate();
115
+ $tmpTableName = $this->getTableName ( 'dropship/tmpdata' );
116
+ $insert = 'insert into '.$tmpTableName.' (tmpdata,created_at,updated_at) values("'.$type.'","'.$createAt.'","'.$updatedAt.'")';
117
+ $write->beginTransaction ();
118
+ $write->query($insert);
119
+ try {
120
+ $write->commit();
121
+ } catch ( Exception $e ) {
122
+ $write->rollBack ();
123
+ }
124
+
125
+ }
126
+
127
+ protected function updateTmpTableData($type){
128
+
129
+ $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
130
+ $updatedAt = Mage::getModel('core/date')->gmtDate();
131
+ $tmpTableName = $this->getTableName ( 'dropship/tmpdata' );
132
+ $update = 'update '.$tmpTableName.' set updated_at = '.$updatedAt.' where tmpdata = "'.$type.'"' ;
133
+ $write->beginTransaction ();
134
+ $write->query($update);
135
+ try {
136
+ $write->commit();
137
+ } catch ( Exception $e ) {
138
+ $write->rollBack ();
139
+ }
140
+ }
141
+
142
+ protected function deleteTmpTableData($type){
143
+
144
+ $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
145
+ $tmpTableName = $this->getTableName ( 'dropship/tmpdata' );
146
+ $delete = 'delete from '.$tmpTableName.' where tmpdata = "'.$type.'"' ;
147
+ $write->beginTransaction ();
148
+ $write->query($delete);
149
+ try {
150
+ $write->commit();
151
+
152
+ } catch ( Exception $e ) {
153
+ $write->rollBack ();
154
+ }
155
+ }
156
+
157
+ public function selectTmpTableData($type){
158
+
159
+ $read = $this->getDatabaseConnection()->getConnection ( 'core_read' );
160
+ $tmpTableName = $this->getTableName ( 'dropship/tmpdata' );
161
+ $select = 'Select * from '.$tmpTableName.' where tmpdata = "'.$type.'" ORDER BY id DESC limit 1';
162
+ $result = $read->fetchAll($select);
163
+
164
+ if(count($result) >= 1)
165
+ $this->_lastUpdateTime = $result[0]['updated_at'];
166
+ return count($result) <= 0 ? false : true;
167
+ }
168
+
169
+ protected function isProcessHault($type){
170
+ $now = strtotime(Mage::getModel('core/date')->date('Y-m-d H:i:s'));
171
+ $lastupdate = Mage::getModel('core/date')->timestamp(strtotime($this->_lastUpdateTime));
172
+
173
+ $isProcessHault = true;
174
+ $timePassed = ($now - $lastupdate)/60;
175
+
176
+ if($timePassed <= $this->_maxtime){
177
+
178
+ $isProcessHault = false;
179
+ }else{
180
+
181
+ $this->finishProcess($type);
182
+ }
183
+ return $isProcessHault;
184
+ }
185
+
186
+ /*
187
+ *
188
+ * $state 0,1,2 // 0= start without sepration text,1=Start logging section sepration,2=end logging section sepration
189
+ *
190
+ *
191
+ * */
192
+ public function genrateLog($state,$startMessage = null,$endMessage =null,$message = null){
193
+ if($state == 1){
194
+ Mage::log('******'.$startMessage.'******', null, 'amosoft_debug.log');
195
+ }
196
+ if($state == 0 && !empty($startMessage) ){
197
+ Mage::log('******'.$startMessage.'******', null, 'amosoft_debug.log');
198
+ }
199
+ if(!empty($message)){
200
+ Mage::log($message, null, 'amosoft_debug.log');
201
+ }
202
+ if($state == 2){
203
+ Mage::log('******'.$endMessage.'******', null, 'amosoft_debug.log');
204
+ }
205
+ if($state == 0 && !empty($endMessage) ){
206
+ Mage::log('******'.$endMessage.'******', null, 'amosoft_debug.log');
207
+ }
208
+ }
209
+
210
+ protected function getLogCollection($params){
211
+ $conn = Mage::getModel('dropship/uploadvendor')->getDatabaseConnection();
212
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log' );
213
+ $select = $conn->select()->from($tableVendorImportLog)
214
+ ->where("created_at=?", $params['vdate']);
215
+ $result = $conn->query($select);
216
+ $rows = $result->fetch();
217
+ return $rows;
218
+ }
219
+
220
+ /**
221
+ * Returns indexes of the fetched array as headers for CSV
222
+ *
223
+ * @return array
224
+ */
225
+ protected function _getCsvHeaders()
226
+ {
227
+ $headers = array('Supplier Code','Supplier','Magento Sku','vendor_sku','cost','inventory','Failure Reason') ;
228
+ return $headers;
229
+ }
230
+
231
+ /**
232
+ * Generates CSV file with error's list according to the collection in the $this->_list
233
+ * @return array
234
+ */
235
+ public function generateErrorList($params,$isFtp = false)
236
+ {
237
+ $ftpCollection = (!$isFtp) ? $this->getLogCollection($params) : $params;
238
+ //$ftpError = explode('<li>', $this->_list['ftp_error_desc']);
239
+ if (!empty($ftpCollection)) {
240
+ if (count($ftpCollection) > 0) {
241
+ if($ftpCollection['failure'] > 3000){
242
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Data size is too big for export'));
243
+ return array('error' => true);
244
+ }
245
+ $io = new Varien_Io_File();
246
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
247
+ $name = md5(microtime());
248
+ $file = $path . DS . $name . '.csv';
249
+ $io->setAllowCreateFolders(true);
250
+ $io->open(array('path' => $path));
251
+ $io->streamOpen($file, 'w+');
252
+ $io->streamLock(true);
253
+ $io->streamWriteCsv($this->_getCsvHeaders());
254
+ $rowData = (!is_null($ftpCollection['ftp_error_desc'])) ? $ftpCollection['ftp_error_desc'] : $ftpCollection['error_id'];
255
+ $prepareValue = $this->prepareExportVaues($rowData, $ftpCollection['amosoft_vendor_code']);
256
+ if(is_array($prepareValue)){
257
+ foreach($prepareValue as $value){
258
+ $csv[] = $ftpCollection['amosoft_vendor_code'];
259
+ $csv[] = $this->getSupplierName($ftpCollection['amosoft_vendor_code']);
260
+ $csv[] = $value['magento_sku'];
261
+ $csv[] = $value['vendor_sku'];
262
+ $csv[] = $value['cost'];
263
+ $csv[] = $value['qty'];
264
+ $csv[] = $value['reason'];
265
+ $io->streamWriteCsv($csv);
266
+ unset($csv);
267
+ }
268
+ }else
269
+ {
270
+ $csv[] = $ftpCollection['amosoft_vendor_code'];
271
+ $csv[] = $this->getSupplierName($ftpCollection['amosoft_vendor_code']);
272
+ $csv[] = '';
273
+ $csv[] = '';
274
+ $csv[] ='';
275
+ $csv[] = '';
276
+ $csv[] = $ftpCollection['ftp_error_desc'];
277
+ $io->streamWriteCsv($csv);
278
+ unset($csv);
279
+ }
280
+ }
281
+ return array(
282
+ 'type' => 'filename',
283
+ 'value' => $file,
284
+ 'rm' => true,
285
+ 'error'=> false
286
+ );
287
+ }
288
+ }
289
+ public function prepareExportVaues($description,$vendorCode){
290
+ $csvData = array();
291
+ $decodedata = Mage::app()->getLayout()->createBlock('dropship/adminhtml_vendorproductuploadhistory')->prepareRowData($description);
292
+ if(!is_array($decodedata) || empty($decodedata))
293
+ return empty($decodedata) ? implode('',$decodedata) : $decodedata;
294
+ foreach($decodedata as $data){
295
+ $msgArray = Mage::app()->getLayout()->createBlock('dropship/adminhtml_vendorproductuploadhistory')->getMessageArray();
296
+ $msg = $msgArray[$data['error_type']];
297
+ if(is_array($data['value']) && !empty($data['value'])){
298
+ $csvData[] = array('magento_sku'=>$data['value']['magento_sku'],'vendor_sku'=>$data['value']['vendor_sku'],'cost'=>$data['value']['cost'],'qty'=>$data['value']['qty'],'reason'=> $this->genrateHtml($data['value'],$msg,$vendorCode));
299
+ }else{
300
+ $csvData[] = array('magento_sku'=>'','vendor_sku'=>'','cost'=>'','qty'=>'','reason'=> (strstr($msg,'row_num')) ? str_replace('row_num',$data['value'],$msg) : str_replace('empty_file',$data['value'],$msg) );
301
+ }
302
+ }
303
+ return $csvData;
304
+ }
305
+ public function genrateHtml($value,$msg,$vendorCode){
306
+ $replace = Mage::app()->getLayout()->createBlock('dropship/adminhtml_vendorproductuploadhistory')->getReplaceValue();
307
+ $string = $msg;
308
+ $value['vendor_code'] = $vendorCode;
309
+ foreach($replace as $val){
310
+ if(strstr($string,$val))
311
+ $string = str_replace($val,$value[$val],$string);
312
+ }
313
+ return $string;
314
+ }
315
+
316
+ /**
317
+ * Item status for orders
318
+ *
319
+ * @return array
320
+ */
321
+ public function getAmosoftOrderItemStatus()
322
+ {
323
+ return array('Reprocess', 'Backorder', 'Transmitting', 'Sent to Supplier', 'No Dropship');
324
+
325
+ }
326
+
327
+ /*
328
+ * Get serialised data for order item history
329
+ * @param object $orderItemInstance, string $itemStatus, string $orderStatus
330
+ * @return string
331
+ */
332
+ public function getSerialisedData($orderItemInstance, $itemStatus, $orderStatus )
333
+ {
334
+ if($orderItemInstance->getItemStatusHistory()){
335
+ $existingValues = unserialize($orderItemInstance->getItemStatusHistory());
336
+ $data = array('date'=>now(), 'item_status'=>$itemStatus, 'order_status'=>$orderStatus);
337
+ array_push($existingValues,$data);
338
+ $serializeData = serialize($existingValues);
339
+ }else{
340
+ $data = array(0=>array('date'=>now(), 'item_status'=>$itemStatus, 'order_status'=>$orderStatus));
341
+ $serializeData = serialize($data);
342
+ }
343
+ return $serializeData;
344
+ }
345
+
346
+ public function sendMail($templateObject,$email,$templateId,$attachment = null){
347
+
348
+ $result = false;
349
+
350
+ if(empty($templateId) || empty($email))
351
+ return $result;
352
+ $mailTemplate = Mage::getModel('core/email_template');
353
+ if($attachment)
354
+ {
355
+ $content = file_get_contents($attachment);
356
+ //$content = str_replace('></',">\n</",$content);
357
+ // this is for to set the file format
358
+ $at = new Zend_Mime_Part($content);
359
+ $at->type = 'application/csv'; // if u have PDF then it would like -> 'application/pdf'
360
+ $at->disposition = Zend_Mime::DISPOSITION_INLINE;
361
+ $at->encoding = Zend_Mime::ENCODING_8BIT;
362
+ $at->filename = 'outdated_productlist'.date('ymdHis').'.csv';
363
+ $mailTemplate->getMail()->addAttachment($at);
364
+ //$emailTemplate->_mail->addAttachment($at);
365
+ }
366
+ /* @var $mailTemplate Mage_Core_Model_Email_Template */
367
+ $mailTemplate->setDesignConfig(array('area' => 'backend'));
368
+ if($templateObject->getBcc())
369
+ {
370
+ $mailTemplate->addBcc($templateObject->getBcc());
371
+ }
372
+ //$mailTemplate->setTemplateSubject($subject);
373
+ $name = explode('@',$email);
374
+ $mailTemplate->sendTransactional(
375
+ $templateId,
376
+ 'general',
377
+ $email,
378
+ $name[0],
379
+ array('templatevar' => $templateObject)
380
+ );
381
+ (!$mailTemplate->getSentSuccess()) ? $result = false : $result = true;
382
+ return $result;
383
+ }
384
+
385
+ /**
386
+ * Turn on read uncommitted mode
387
+ */
388
+ public function turnOnReadUncommittedMode()
389
+ {
390
+ $this->getDatabaseConnection()->getConnection('read')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
391
+ }
392
+ /**
393
+ * Turn on read committed mode
394
+ */
395
+ public function turnOnReadCommittedMode()
396
+ {
397
+ $this->getDatabaseConnection()->getConnection('read')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED");
398
+ }
399
+ public function isJson($data){
400
+ $result = false;
401
+ $data = trim($data,'"');
402
+ $data = trim($data,'\'');
403
+ $data = stripslashes($data);
404
+ $decodedata = json_decode($data);
405
+ $result = (json_last_error() == JSON_ERROR_NONE) ? true : false;
406
+ return $result;
407
+ }
408
+ public function getSupplierName($vendorCode){
409
+ $vendorRankModel = Mage::getSingleton('dropship/ranking')->load($vendorCode,'amosoft_vendor_code');
410
+ return $vendorRankModel->getAmosoftVendorName();
411
+ }
412
+
413
+ public function getVendorShippingCost($product){
414
+
415
+ $productSku = $product->getSku();
416
+ //echo $productSku; exit;
417
+ $itemId = $product->getItemId();
418
+ $isDefaultVendor = false;
419
+ $vendorCode = '';
420
+ $inventoryStock = '';
421
+ $defaultVendor = (Mage::getStoreConfig('amosoft_sourcing/rank/defaultbackorder') == 'none') ? '' : Mage::getStoreConfig('amosoft_sourcing/rank/defaultbackorder');
422
+ $orderItemInstance = Mage::getModel( 'dropship/orderitems' );
423
+ $orderItemInstance->load( $itemId, 'item_id' );
424
+ $collectionVendor = $orderItemInstance->prepareOrderItemData($product);
425
+ $arrDefaultVendorDetails = array();
426
+ $vendorCost = 0;
427
+
428
+ if ($collectionVendor->count() > 0) {
429
+ if($collectionVendor->count() >= 1){
430
+ foreach ($collectionVendor as $vendorData) {
431
+ //assign default vendor details
432
+ if(!empty($defaultVendor) && $vendorData->getAmosoftVendorCode() == $defaultVendor )
433
+ {
434
+ $arrDefaultVendorDetails = array('amosoft_vendor_code'=>$vendorData->getAmosoftVendorCode(),'stock'=>$vendorData->getStock(),'cost'=>$vendorData->getCost(),'shipping_cost'=>$vendorData->getShippingCost(),'amosoft_vendor_sku'=>$vendorData->getAmosoftVendorSku(),'product_sku'=>$vendorData->getProductSku());
435
+ }
436
+ //if item is in backordered
437
+ if($vendorData->getStock() < $qtyInvoiced ){
438
+ $arrVendorDetail[] = array('amosoft_vendor_code'=>$vendorData->getAmosoftVendorCode(),'stock'=>$vendorData->getStock(),'cost'=>$vendorData->getCost(),'amosoft_vendor_sku'=>$vendorData->getAmosoftVendorSku(),'product_sku'=>$vendorData->getProductSku());
439
+ $vendorCode = $arrVendorDetail[0]['amosoft_vendor_code'];
440
+ $inventoryStock = $arrVendorDetail[0]['stock'];
441
+ $vendorCost = $arrVendorDetail[0]['cost'];
442
+ $vendorShippingCost = $arrVendorDetail[0]['shipping_cost'];
443
+ $vendorSku = $arrVendorDetail[0]['amosoft_vendor_sku'];
444
+ $productSku = $arrVendorDetail[0]['product_sku'];
445
+ $arrVendorAvailable[] = $vendorData->getAmosoftVendorCode();
446
+ $isDefaultVendor = true;
447
+ }else{
448
+ $vendorCode = $vendorData->getAmosoftVendorCode();
449
+ $inventoryStock = $vendorData->getStock();
450
+ $vendorCost = $vendorData->getCost();
451
+ $vendorShippingCost = $vendorData->getShippingCost();
452
+ //echo $vendorShippingCost; exit;
453
+ $vendorSku = $vendorData->getAmosoftVendorSku();
454
+ $productSku = $vendorData->getProductSku();
455
+ $arrVendorAvailable[] = $vendorData->getAmosoftVendorCode();
456
+ $isDefaultVendor = false;
457
+ break;
458
+ }
459
+ }
460
+ $arrVendorAvailable[] = $vendorData->getAmosoftVendorCode();
461
+ }else {
462
+ $arrFirstVendor = $collectionVendor->getFirstItem()->getData();
463
+ $vendorCode = $arrFirstVendor['amosoft_vendor_code'];
464
+ $inventoryStock = $arrFirstVendor['stock'];
465
+ $vendorShippingCost = $arrFirstVendor['shipping_cost'];
466
+ $vendorCost = $arrFirstVendor['cost'];
467
+ $vendorSku = $arrFirstVendor['amosoft_vendor_sku'];
468
+ $productSku = $arrFirstVendor['product_sku'];
469
+ if($inventoryStock < $qtyInvoiced)
470
+ $isDefaultVendor = true;
471
+ else
472
+ $isDefaultVendor = false;
473
+
474
+ $arrVendorAvailable[] = $arrFirstVendor['amosoft_vendor_code'];
475
+ }
476
+ return $vendorShippingCost;
477
+ }
478
+ }
479
+
480
+ public function setCustomShipping($_shipping_cost){
481
+ $this->_shipping_cost = $_shipping_cost;
482
+ //return $this->_shipping_cost;
483
+ }
484
+
485
+ public function getCustomShipping(){
486
+ return $this->_shipping_cost;
487
+ }
488
+ }
app/code/local/Amosoft/Dropship/Model/Amosoft.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ class Amosoft_Dropship_Model_Amosoft {
10
+
11
+ /* Create API role */
12
+
13
+ public function createApiRoleAndUser($fieldsetData) {
14
+
15
+ $role = Mage::getModel('api/roles');
16
+ $roleName = 'amosoft';
17
+ $parentId = '';
18
+ $roleType = 'G';
19
+ $definedRole = Mage::helper('dropship')->getConfigObject('apiconfig/soap_role');
20
+ $ruleNodes = (!empty($definedRole)) ? explode(',',$definedRole) : array('all');
21
+
22
+ if (!is_array($fieldsetData)) {
23
+ return false;
24
+ }
25
+ $role->load($roleName, 'role_name');
26
+ //$ruleNodes = array('all');
27
+ //$ruleNodes = $definedRole;
28
+ try {
29
+ $role = $role->setName($roleName)
30
+ ->setPid($parentId)
31
+ ->setRoleType($roleType)
32
+ ->save();
33
+
34
+ Mage::getModel("api/rules")->setRoleId($role->getId())
35
+ ->setResources($ruleNodes)
36
+ ->saveRel();
37
+ } catch (Exception $e) {
38
+ return false;
39
+ }
40
+ $password = '';
41
+ $userExist = $this->_userExists($fieldsetData['api_user_name'],$fieldsetData['email']);
42
+ $userId = '';
43
+ if (is_array($userExist)) {
44
+ $modelData = Mage::getModel('api/user')->load($userExist[1]);
45
+ $userId = $modelData->getUserId();
46
+ }else
47
+ {
48
+ $modelData = Mage::getModel('api/user');
49
+ }
50
+ $modelData->setData(array(
51
+ 'user_id'=> $userId,
52
+ 'username' => $fieldsetData['api_user_name'],
53
+ 'firstname' => 'amosoft',
54
+ 'lastname' => 'amosoft',
55
+ 'email' => $fieldsetData['email'],
56
+ 'api_key' => $password,
57
+ 'api_key_confirmation' => $password,
58
+ 'is_active' => 1,
59
+ 'user_roles' => '',
60
+ 'assigned_user_role' => '',
61
+ 'role_name' => '',
62
+ 'roles' => array($role->getId()) // your created custom role
63
+ ));
64
+
65
+ try {
66
+
67
+ Mage::register('api_password', $modelData->getApiKey());
68
+ $modelData->save();
69
+ $modelData->setRoleIds(array($role->getId())) // your created custom role
70
+ ->setRoleUserId($modelData->getUserId())
71
+ ->saveRelations();
72
+ }
73
+
74
+ catch (Exception $e) {
75
+ return false;
76
+ }
77
+ return array('password'=>$modelData->getApiKey(),'user_id'=>$modelData->getUserId());
78
+ }
79
+
80
+ protected function _userExists($username,$email)
81
+ {
82
+ $resource = Mage::getSingleton('core/resource');
83
+ $usersTable = $resource->getTableName('api/user');
84
+ $adapter = $resource->getConnection('core_read');
85
+ $condition = array(
86
+ $adapter->quoteInto("{$usersTable}.username = ?", $username),
87
+ $adapter->quoteInto("{$usersTable}.email = ?", $email),
88
+ );
89
+ $select = $adapter->select()
90
+ ->from($usersTable)
91
+ ->where(implode(' OR ', $condition))
92
+ ->where($usersTable.'.user_id != ?', '');
93
+ $result = $adapter->fetchRow($select);
94
+ if(is_array($result) && count($result) > 0 )
95
+ {
96
+ return array(true,(int)$result['user_id']);
97
+ }else
98
+ {
99
+ return false;
100
+ }
101
+
102
+ }
103
+
104
+ protected function _generatePassword($length = 8) {
105
+ $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
106
+ $count = mb_strlen($chars);
107
+
108
+ for ($i = 0, $result = ''; $i < $length; $i++) {
109
+ $index = rand(0, $count - 1);
110
+ $result .= mb_substr($chars, $index, 1);
111
+ }
112
+
113
+ return $result;
114
+ }
115
+
116
+
117
+
118
+ public function checkAndCreateOrderStatus($fieldsetData) {
119
+ if (!is_array($fieldsetData) && empty($fieldsetData)) {
120
+ return false;
121
+ }
122
+ $statuses = $fieldsetData;
123
+ $state = 'processing';
124
+ $isDefault = '0';
125
+ foreach ($statuses as $status => $label) {
126
+ $this->assignStatus($status, $label, $state, $isDefault);
127
+ }
128
+ return true;
129
+ }
130
+
131
+ protected function assignStatus($status, $label, $state, $isDefault){
132
+ $statusModel = Mage::getModel('sales/order_status')->load($status);
133
+ if (!$statusModel->getStatus()) {
134
+ $statusModel->setData(array('status' => $status, 'label' => $label))->setStatus($status);
135
+ try {
136
+ $statusModel->save();
137
+ $statusModel->assignState($state, $isDefault);
138
+
139
+ }catch (Mage_Core_Exception $e) {
140
+ return false;
141
+ }
142
+ }
143
+ }
144
+
145
+
146
+ public function updateOrderState($fieldsetData) {
147
+ $state = 'processing';
148
+ $isDefault = '0';
149
+ $statusModel = Mage::getModel('sales/order_status')->load('amosoft_ready_to_source');
150
+ try {
151
+ $statusModel->unassignState('new');
152
+ $statusModel->assignState($state, $isDefault);
153
+
154
+ }catch (Mage_Core_Exception $e) {
155
+ return false;
156
+ }
157
+ return true;
158
+ }
159
+
160
+ public function send($attachment = null,$fieldsetData) {
161
+ try {
162
+ $fieldsetData['isnewreg'] = true;
163
+ $version = Mage::helper('dropship')->getConfigObject('default/amosoft_integration/integration/ds360_version');
164
+ $fieldsetData['subject'] = 'New DropShip Package Extension version '.$version.' was installed';
165
+ $postObject = new Varien_Object();
166
+ $postObject->setData($fieldsetData);
167
+ $templateId = 'amosoft_email_email_template';
168
+ $email = Mage::helper('dropship')->getConfigObject('apiconfig/email/toaddress');
169
+ $isMailSent = Mage::helper('dropship')->sendMail($postObject,$email,$templateId);
170
+ if (!$isMailSent) {
171
+ Mage::helper('dropship')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
172
+ }
173
+ Mage::getSingleton('adminhtml/session')->unsNotification();
174
+ return true;
175
+ } catch (Exception $e) {
176
+ return false;//$e->getMassage();
177
+ }
178
+ }
179
+
180
+ public function prepareNotification($object,$orderId){
181
+ if($object == null || $orderId == null)
182
+ return;
183
+ $collection = $object->getCollection();
184
+ if($collection->getSize() == 0 )
185
+ $this->saveNotificationValue($orderId,'amosoft/setup_notification/order');
186
+ }
187
+ public function saveNotificationValue($value = null,$path){
188
+ $data = array(
189
+ 'scope' => 'default',
190
+ 'scope_id' => '0',
191
+ 'path' => $path,
192
+ 'value' => $value,
193
+ );
194
+ try{
195
+ Mage::getModel('core/config_data')->load($data['path'],'path');
196
+ Mage::getModel('core/config_data')->setData($data)->save();
197
+ }catch(Exception $e){
198
+ return false;
199
+ }
200
+ }
201
+
202
+ public function setupNotification()
203
+ {
204
+ $order = Mage::getStoreConfig('amosoft/setup_notification/order');
205
+
206
+ if($order)
207
+ {
208
+ $inventory = Mage::getModel('dropship/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order)->addFieldToFilter('amosoft_item_status','Transmitting');
209
+ if($inventory->getSize() > 0){
210
+
211
+ try {
212
+ $fieldsetData['order'] = Mage::getModel('sales/order')->load($order);
213
+ $fieldsetData['subject'] = 'DropShip Order has been Placed on Magento';
214
+ $postObject = new Varien_Object();
215
+ $postObject->setData($fieldsetData);
216
+ $templateId = 'amosoft_order_notification';
217
+ $email = Mage::helper('dropship')->getConfigObject('apiconfig/email/toaddress');
218
+ $isMailSent = Mage::helper('dropship')->sendMail($postObject,$email,$templateId);
219
+ if (!$isMailSent) {
220
+ Mage::helper('dropship')->genrateLog(0,'Order notification started','Order notification ended','First order goes to transmitting successfully email sending failed');
221
+ }
222
+ $this->saveNotificationValue(null,'amosoft/setup_notification/order');
223
+ return true;
224
+ } catch (Exception $e) {
225
+ return false;//$e->getMassage();
226
+ }
227
+
228
+ }
229
+
230
+ }
231
+ }
232
+
233
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Createroleandrule.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_Api2_Createroleandrule
9
+ {
10
+
11
+ public function initiliazeRest(){
12
+
13
+ $restRoleId = $this->createRoleRest();
14
+ $this->createAttributeAttributeRest();
15
+ $arrConsumer = $this->createOauthuser();
16
+ $adminUserId = $this->createAdminUserAndRole();
17
+ $resourceModel = Mage::getResourceModel('api2/acl_global_role');
18
+ try{
19
+ $resourceModel->saveAdminToRoleRelation($adminUserId, $restRoleId);
20
+ }catch(Exception $e)
21
+ {
22
+ echo $e->getMessage();
23
+ }
24
+
25
+ $restOauthAuthorization = $this->restOauthAuthorization(array('consumer_id'=>$arrConsumer['consumer_id'],'admin_id'=>$adminUserId));
26
+ $result = array_merge($arrConsumer,$restOauthAuthorization);
27
+ return $result;
28
+
29
+ }
30
+
31
+ protected function restOauthAuthorization($oauthRequest)
32
+ {
33
+ $helper = Mage::helper('oauth');
34
+
35
+ $oauthRequest['type']= 'access';
36
+ $oauthRequest['token']= $helper->generateToken();
37
+ $oauthRequest['secret']= $helper->generateTokenSecret();
38
+ $oauthRequest['verifier']= $helper->generateVerifier();
39
+ $oauthRequest['revoked']= 0;
40
+ $oauthRequest['authorized']= 1;
41
+ $oauthRequest['callback_url']= Mage::getBaseUrl();
42
+
43
+ $token = Mage::getModel('oauth/token')->load($oauthRequest['consumer_id'],'consumer_id');
44
+
45
+ if(!$token->getEntityId())
46
+ $token->addData($oauthRequest);
47
+
48
+ try {
49
+
50
+ $token->save();
51
+
52
+ } catch (Exception $e) {
53
+ echo $e->getMessage();
54
+ }
55
+ return array('token'=>$token->getToken(),'secret'=>$token->getSecret());
56
+ }
57
+
58
+ protected function createRoleRest(){
59
+
60
+ $role = Mage::getModel ( 'api2/acl_global_role' );
61
+ $roleName = 'amosoft';
62
+ $ruleAsString = '__root__,group-amosoft,group-product_import,resource-import,privilege-import-create,group-inventory_import,resource-inventory_import,privilege-inventory_import-create';
63
+ Mage::app ()->getRequest ()->setParam ( 'resource', $ruleAsString );
64
+
65
+ $role->load ( $roleName, 'role_name' );
66
+
67
+ try {
68
+ $role->setRoleName ( $roleName )->save ();
69
+ $rule = Mage::getModel ( 'api2/acl_global_rule' );
70
+ if ($role->getId ()) {
71
+ $collection = $rule->getCollection ();
72
+ $collection->addFilterByRoleId ( $role->getId () );
73
+ foreach ( $collection as $model ) {
74
+ $model->delete ();
75
+ }
76
+ }
77
+ $ruleTree = Mage::getModel ( 'api2/acl_global_rule_tree', array (
78
+ 'type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_PRIVILEGE
79
+ ) );
80
+ $resources = $ruleTree->getPostResources ();
81
+ $id = $role->getId ();
82
+ foreach ( $resources as $resourceId => $privileges ) {
83
+ foreach ( $privileges as $privilege => $allow ) {
84
+ if (! $allow) {
85
+ continue;
86
+ }
87
+
88
+ $rule->setId ( null )->isObjectNew ( true );
89
+
90
+ $rule->setRoleId ( $id )->setResourceId ( $resourceId )->setPrivilege ( $privilege )->save ();
91
+ }
92
+ }
93
+ } catch ( Exception $e ) {
94
+ echo $e->getMessage ();
95
+ }
96
+
97
+ return $id;
98
+ }
99
+
100
+
101
+ protected function createAttributeAttributeRest(){
102
+
103
+ $attributeRule = '__root__,group-amosoft,group-product_import,resource-import,operation-import-write,attribute-import-write-productdata,group-inventory_import,resource-inventory_import,operation-inventory_import-write,attribute-inventory_import-write-vendordata';
104
+ $type = 'admin';
105
+ Mage::app()->getRequest()->setParam('resource',$attributeRule);
106
+ try {
107
+
108
+ $ruleTree = Mage::getModel(
109
+ 'api2/acl_global_rule_tree',
110
+ array('type' => Mage_Api2_Model_Acl_Global_Rule_Tree::TYPE_ATTRIBUTE)
111
+ );
112
+
113
+
114
+ $attribute = Mage::getModel('api2/acl_filter_attribute');
115
+
116
+
117
+ $collection = $attribute->getCollection();
118
+ $collection->addFilterByUserType($type);
119
+
120
+ /** @var $model Mage_Api2_Model_Acl_Filter_Attribute */
121
+ foreach ($collection as $model) {
122
+ $model->delete();
123
+ }
124
+
125
+ foreach ($ruleTree->getPostResources() as $resourceId => $operations) {
126
+ if (Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL === $resourceId) {
127
+ $attribute->setUserType($type)
128
+ ->setResourceId($resourceId)
129
+ ->save();
130
+ } else {
131
+ foreach ($operations as $operation => $attributes) {
132
+ $attribute->setId(null)
133
+ ->isObjectNew(true);
134
+
135
+ $attribute->setUserType($type)
136
+ ->setResourceId($resourceId)
137
+ ->setOperation($operation)
138
+ ->setAllowedAttributes(implode(',', array_keys($attributes)))
139
+ ->save();
140
+ }
141
+ }
142
+ }
143
+ } catch (Exception $e) {
144
+ $e->getMessage();
145
+ }
146
+
147
+ }
148
+
149
+ protected function createOauthuser(){
150
+
151
+ $model = Mage::getModel('oauth/consumer');
152
+ $helper = Mage::helper('oauth');
153
+ $data = array(
154
+
155
+ 'name'=>'amosoft',
156
+ 'key'=> $helper->generateConsumerKey(),
157
+ 'secret'=> $helper->generateConsumerSecret(),
158
+ ) ;
159
+ $model->load($data['name'],'name');
160
+ try {
161
+ if(!$model->getId()){
162
+ $model->addData($data);
163
+ $model->save();
164
+ }
165
+ }catch (Exception $e) {
166
+ echo $e->getMessage();
167
+ exit;
168
+ }
169
+
170
+ return array('consumer_id' => $model->getId(),'consumer_key'=>$model->getKey(),'consumer_secret'=>$model->getSecret());
171
+ }
172
+
173
+ protected function createAdminUserAndRole(){
174
+
175
+ $resource = '__root__,admin/amosoft,admin/dropship/integration,admin/dropship/order_sourcing,admin/dropship/vendor_ranking,admin/dropship/inventory,admin/dropship/suppliers';
176
+ $roleName = 'amosoftds';
177
+
178
+ $role = Mage::getModel('admin/roles');
179
+ $username = 'amosoftds';
180
+ $email = Mage::helper('dropship')->getConfigObject('apiconfig/email/toaddress');
181
+ $user = Mage::getModel('admin/user');
182
+ $user->loadByUsername($username);
183
+ if(!$user->getId()){
184
+ $user->setData(array(
185
+ 'username' => $username,
186
+ 'firstname' => 'amosoft',
187
+ 'lastname' => 'amosoft',
188
+ 'email' => $email.'.'.rand(1,99),
189
+ 'password' =>'amosoft@123',
190
+ 'is_active' => 1
191
+ ));
192
+
193
+ try {
194
+
195
+ $user->save();
196
+
197
+ } catch (Exception $e) {
198
+ echo $e->getMessage();
199
+ exit;
200
+ }
201
+ }
202
+
203
+ $role->load($roleName,'role_name');
204
+ //Assign Role Id
205
+ try {
206
+
207
+ $role->setName($roleName)
208
+ ->setPid(0)
209
+ ->setRoleType('G')
210
+ ->setGwsIsAll(1)
211
+ ->setGwsWebsites(NULL)
212
+ ->setGwsStoreGroups(NULL);
213
+
214
+ $role->save();
215
+
216
+ Mage::getModel("admin/rules")
217
+ ->setRoleId($role->getId())
218
+ ->setResources($resource)
219
+ ->saveRel();
220
+
221
+ $this->_addUserToRole($user->getId(), $role->getId());
222
+
223
+
224
+ } catch (Exception $e) {
225
+ echo $e->getMessage();
226
+ exit;
227
+ }
228
+ return $user->getId();
229
+ }
230
+
231
+ protected function userExists($user)
232
+ {
233
+ $result = Mage::getResourceModel('admin/user')->userExists($user);
234
+ return (is_array($result) && count($result) > 0) ? true : false;
235
+ }
236
+ protected function _addUserToRole($userId, $roleId)
237
+ {
238
+ $user = Mage::getModel("admin/user")->load($userId);
239
+ $user->setRoleId($roleId)->setUserId($userId);
240
+
241
+ if( $user->roleUserExists() === true ) {
242
+ return false;
243
+ } else {
244
+ $user->add();
245
+ return true;
246
+ }
247
+ }
248
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Inventory.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ class Amosoft_Dropship_Model_Api2_Inventory extends Mage_Api2_Model_Resource
10
+ {
11
+ public function getAvailableAttributes($userType, $operation)
12
+ {
13
+ return array (
14
+ 'vendordata' => 'vendordata'
15
+ );
16
+
17
+ }
18
+
19
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ abstract class Amosoft_Dropship_Model_Api2_Inventory_Rest extends Amosoft_Dropship_Model_Api2_Inventory
10
+ {
11
+ /**
12
+ * Current loaded product
13
+ *
14
+ * @var Mage_Catalog_Model_Product
15
+ */
16
+ protected $_product;
17
+
18
+ /**
19
+ * Retrieve product data
20
+ *
21
+ * @return array
22
+ */
23
+ protected function _retrieve()
24
+ {
25
+ $product = $this->_getProduct();
26
+
27
+ $this->_prepareProductForResponse($product);
28
+ return $product->getData();
29
+ }
30
+
31
+ /**
32
+ * Product create only available for admin
33
+ *
34
+ * @param array $data
35
+ */
36
+ protected function _create(array $data)
37
+ {
38
+ $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);
39
+ }
40
+ /**
41
+ * Product create only available for admin
42
+ *
43
+ * @param array $data
44
+ */
45
+ protected function _multicreate(array $data)
46
+ {
47
+
48
+ //return array('name'=>'shashank');
49
+ //$this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);
50
+ }
51
+
52
+
53
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest/Admin/V1.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ class Amosoft_Dropship_Model_Api2_Inventory_Rest_Admin_V1 extends Amosoft_Dropship_Model_Api2_Inventory_Rest
10
+ {
11
+ protected function _create(array $data)
12
+ {
13
+ if(Mage::helper('dropship')->isProcessRunning('bulk_assign')){
14
+ $message = 'Bulk product setup is currently running hence cannot run REST import';
15
+ echo $message;
16
+ //Mage::log($message, null, 'amosoft_log_report.log');
17
+ die;
18
+ }
19
+ $requestData = array_chunk($data['vendordata'], 1, true);
20
+ try {
21
+ foreach($requestData as $chunkData)
22
+ {
23
+ $processedData['vendordata'] = $chunkData;
24
+ $result[] = Mage::getModel('dropship/inventory')->prepareInventoryTable($processedData);
25
+ }
26
+
27
+ foreach($result as $row){
28
+ foreach($row as $vendor=>$msg){
29
+ echo $msg.' '.$vendor.'<br>';
30
+ }
31
+ }
32
+ die();
33
+ } catch (Exception $e) {
34
+ die($e->getMessage());
35
+ }
36
+ }
37
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest/Customer/V1.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ class Mage_Catalog_Model_Api2_Product_Rest_Customer_V1 extends Mage_Catalog_Model_Api2_Product_Rest
10
+ {
11
+ /**
12
+ * Current logged in customer
13
+ *
14
+ * @var Mage_Customer_Model_Customer
15
+ */
16
+ protected $_customer;
17
+
18
+ /**
19
+ * Get customer group
20
+ *
21
+ * @return int
22
+ */
23
+ protected function _getCustomerGroupId()
24
+ {
25
+ return $this->_getCustomer()->getGroupId();
26
+ }
27
+
28
+ /**
29
+ * Define product price with or without taxes
30
+ *
31
+ * @param float $price
32
+ * @param bool $withTax
33
+ * @return float
34
+ */
35
+ protected function _applyTaxToPrice($price, $withTax = true)
36
+ {
37
+ $customer = $this->_getCustomer();
38
+ /** @var $session Mage_Customer_Model_Session */
39
+ $session = Mage::getSingleton('customer/session');
40
+ $session->setCustomerId($customer->getId());
41
+ $price = $this->_getPrice($price, $withTax, $customer->getPrimaryShippingAddress(),
42
+ $customer->getPrimaryBillingAddress(), $customer->getTaxClassId());
43
+ $session->setCustomerId(null);
44
+
45
+ return $price;
46
+ }
47
+
48
+ /**
49
+ * Retrieve current customer
50
+ *
51
+ * @return Mage_Customer_Model_Customer
52
+ */
53
+ protected function _getCustomer()
54
+ {
55
+ if (is_null($this->_customer)) {
56
+ /** @var $customer Mage_Customer_Model_Customer */
57
+ $customer = Mage::getModel('customer/customer')->load($this->getApiUser()->getUserId());
58
+ if (!$customer->getId()) {
59
+ $this->_critical('Customer not found.', Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);
60
+ }
61
+ $this->_customer = $customer;
62
+ }
63
+ return $this->_customer;
64
+ }
65
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Inventory/Rest/Guest/V1.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ class Amosoft_Dropship_Model_Api2_Inventory_Rest_Guest_V1 extends Amosoft_Dropship_Model_Api2_Inventory_Rest
10
+ {
11
+
12
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Product.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ class Amosoft_Dropship_Model_Api2_Product extends Mage_Api2_Model_Resource
10
+ {
11
+ public function getAvailableAttributes($userType, $operation)
12
+ {
13
+ return array (
14
+ 'productdata' => 'productdata'
15
+ );
16
+ }
17
+
18
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ abstract class Amosoft_Dropship_Model_Api2_Product_Rest extends Amosoft_Dropship_Model_Api2_Product
10
+ {
11
+ /**
12
+ * Current loaded product
13
+ *
14
+ * @var Mage_Catalog_Model_Product
15
+ */
16
+ protected $_product;
17
+
18
+ /**
19
+ * Retrieve product data
20
+ *
21
+ * @return array
22
+ */
23
+ protected function _retrieve()
24
+ {
25
+ $product = $this->_getProduct();
26
+
27
+ $this->_prepareProductForResponse($product);
28
+ return $product->getData();
29
+ }
30
+
31
+ /**
32
+ * Product create only available for admin
33
+ *
34
+ * @param array $data
35
+ */
36
+ protected function _create(array $data)
37
+ {
38
+ $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);
39
+ }
40
+ /**
41
+ * Product create only available for admin
42
+ *
43
+ * @param array $data
44
+ */
45
+ protected function _multicreate(array $data)
46
+ {
47
+
48
+ //return array('name'=>'shashank');
49
+ //$this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);
50
+ }
51
+
52
+
53
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest/Admin/V1.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ class Amosoft_Dropship_Model_Api2_Product_Rest_Admin_V1 extends Amosoft_Dropship_Model_Api2_Product_Rest
10
+ {
11
+ protected function _create(array $data)
12
+ {
13
+ //request data parse in to chunks
14
+ $requestData = array_chunk($data['productdata'], 1, true);
15
+ try {
16
+ $time_start = now();
17
+ foreach($requestData as $chunkData)
18
+ {
19
+ $processedData['productdata'] = $chunkData;
20
+ $result[] = Mage::getModel('dropship/productimport')->_init()->processData($processedData);
21
+ }
22
+ $time_end = now();
23
+ echo 'Start Time = '.$time_start;
24
+ echo '<hr>';
25
+ echo 'End Time = '.$time_end;
26
+ echo '<hr>';
27
+ }catch (Exception $e) {
28
+ echo $e->getMessage();
29
+ }catch (Mage_Core_Exception $e) {
30
+ $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);
31
+ } catch (Exception $e) {
32
+ $this->_critical(self::RESOURCE_UNKNOWN_ERROR);
33
+ }
34
+ foreach($result as $row){
35
+ foreach($row as $vendor=>$msg){
36
+ echo '<br>'.$vendor.' ';
37
+ foreach($msg as $err){
38
+ echo $err;
39
+ }
40
+ }
41
+ }
42
+ die();
43
+ }
44
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest/Customer/V1.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+
8
+ */
9
+ class Mage_Catalog_Model_Api2_Product_Rest_Customer_V1 extends Mage_Catalog_Model_Api2_Product_Rest
10
+ {
11
+ /**
12
+ * Current logged in customer
13
+ *
14
+ * @var Mage_Customer_Model_Customer
15
+ */
16
+ protected $_customer;
17
+
18
+ /**
19
+ * Get customer group
20
+ *
21
+ * @return int
22
+ */
23
+ protected function _getCustomerGroupId()
24
+ {
25
+ return $this->_getCustomer()->getGroupId();
26
+ }
27
+
28
+ /**
29
+ * Define product price with or without taxes
30
+ *
31
+ * @param float $price
32
+ * @param bool $withTax
33
+ * @return float
34
+ */
35
+ protected function _applyTaxToPrice($price, $withTax = true)
36
+ {
37
+ $customer = $this->_getCustomer();
38
+ /** @var $session Mage_Customer_Model_Session */
39
+ $session = Mage::getSingleton('customer/session');
40
+ $session->setCustomerId($customer->getId());
41
+ $price = $this->_getPrice($price, $withTax, $customer->getPrimaryShippingAddress(),
42
+ $customer->getPrimaryBillingAddress(), $customer->getTaxClassId());
43
+ $session->setCustomerId(null);
44
+
45
+ return $price;
46
+ }
47
+
48
+ /**
49
+ * Retrieve current customer
50
+ *
51
+ * @return Mage_Customer_Model_Customer
52
+ */
53
+ protected function _getCustomer()
54
+ {
55
+ if (is_null($this->_customer)) {
56
+ /** @var $customer Mage_Customer_Model_Customer */
57
+ $customer = Mage::getModel('customer/customer')->load($this->getApiUser()->getUserId());
58
+ if (!$customer->getId()) {
59
+ $this->_critical('Customer not found.', Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);
60
+ }
61
+ $this->_customer = $customer;
62
+ }
63
+ return $this->_customer;
64
+ }
65
+ }
app/code/local/Amosoft/Dropship/Model/Api2/Product/Rest/Guest/V1.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ class Amosoft_Dropship_Model_Api2_Product_Rest_Guest_V1 extends Amosoft_Dropship_Model_Api2_Product_Rest
10
+ {
11
+
12
+ }
app/code/local/Amosoft/Dropship/Model/Carrier/Flatrateperproduct.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013 www.magebuzz.com
4
+ */
5
+ class Amosoft_Dropship_Model_Carrier_Flatrateperproduct
6
+ extends Mage_Shipping_Model_Carrier_Abstract
7
+ implements Mage_Shipping_Model_Carrier_Interface {
8
+ protected $_code = 'suppliershippingcostperproduct';
9
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
10
+ {
11
+ $itemStatusComplete = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_TRANSMITTING;
12
+ $itemStatusBackorder = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER;
13
+ $itemStatusNoDropShip = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_NO_DROPSHIP;
14
+
15
+ if (!$this->getConfigFlag('active')) {
16
+ return false;
17
+ }
18
+ $shippingPrice =0;
19
+ if ($request->getAllItems()) {
20
+ foreach ($request->getAllItems() as $item) {
21
+
22
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
23
+ //print_r($product->getData()); exit;
24
+ if($product->getTypeId()=='configurable' || $product->getTypeId()=='bundle') {
25
+ continue;
26
+ }
27
+
28
+ $shipCost = Mage::helper('dropship')->getVendorShippingCost($item);
29
+ //print_r($shipCost); exit;
30
+ if($shipCost==null || $shipCost==0){
31
+ $shippingPrice += $item->getQty() * $this->getConfigData('price');
32
+ }
33
+ else{
34
+ $shippingPrice += $item->getQty() * $shipCost;
35
+ }
36
+ }
37
+ }
38
+ $result = Mage::getModel('shipping/rate_result');
39
+ if ($shippingPrice !== false) {
40
+ $method = Mage::getModel('shipping/rate_result_method');
41
+ $method->setCarrier('suppliershippingcostperproduct');
42
+ $method->setCarrierTitle($this->getConfigData('title'));
43
+ $method->setMethod('suppliershippingcostperproduct');
44
+ $method->setMethodTitle($this->getConfigData('name'));
45
+ $method->setPrice($shippingPrice);
46
+ $method->setCost($shippingPrice);
47
+ $result->append($method);
48
+ }
49
+ return $result;
50
+ }
51
+ public function getAllowedMethods()
52
+ {
53
+ return array('suppliershippingcostperproduct'=>$this->getConfigData('name'));
54
+ }
55
+ }
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
app/code/local/Amosoft/Dropship/Model/Csvparser.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ class Amosoft_Dropship_Model_Csvparser
10
+ {
11
+
12
+ protected $dbConnection;
13
+ protected $tableName;
14
+ protected $vendorObject;
15
+ protected $chunksize = 50;
16
+ //protected $chnagedValue = array();
17
+ protected $ftpCSVFormat = array('vendor_code','vendor_sku','qty','cost');
18
+ protected $manualCSVFormat = array('vendor_sku','qty','cost');
19
+ protected $productSetupCSVFormat = array('magento_sku','vendor_sku');
20
+ protected $_exportHeaders = array('Vendor Code','Vendor','Magento Sku','Vendor Sku','Cost','Inventory','Last Sync Date');
21
+ protected $_indexVendorSku = 0;
22
+ protected $_indexStock = 1;
23
+ protected $_indexPrice = 2;
24
+
25
+ public function __construct(){
26
+
27
+ $this->dbConnection = Mage::helper('dropship')->getDatabaseConnection();
28
+ $this->tableName = Mage::helper('dropship')->getTableName('dropship/csvtmpdata');
29
+ $this->vendorObject = Mage::getModel('dropship/inventory');
30
+ }
31
+
32
+ // check is csv for manual or ftp other csv will not process data
33
+ protected function isProcessRequired($header)
34
+ {
35
+ $result = true;
36
+ if($header[0] == 'vendor_code')
37
+ {
38
+ $diffArray=array_diff($this->ftpCSVFormat,$header);
39
+ $result = (count($diffArray) == 0);
40
+ }else
41
+ {
42
+ $diffArray=array_diff($this->manualCSVFormat,$header);
43
+ $result = (count($diffArray) == 0);
44
+ }
45
+ //var_dump($result);
46
+ //die;
47
+ return $result;
48
+ }
49
+
50
+ protected function checkFtpHeader($header)
51
+ {
52
+ if(count($header) == 4 )
53
+ {
54
+ $this->_indexVendorSku = 1;
55
+ $this->_indexStock = 2;
56
+ $this->_indexPrice = 3;
57
+ }
58
+ }
59
+
60
+ public function getChangedValue($csvData,$vendorCode){
61
+
62
+ $parsedData = array();
63
+ if(count($csvData) <= 1 || !$this->isProcessRequired($csvData[0]))
64
+ {
65
+ return $csvData;
66
+ }
67
+ $this->emptyTable();
68
+ $this->checkFtpHeader($csvData[0]);
69
+ $insertQuery = $this->insertMultiple($csvData,$vendorCode);
70
+ if($insertQuery/*$this->executeStm($insertQuery)*/){
71
+ $parsedData = $this->prepareCsvjoin($csvData[0]);
72
+ //array_unshift($parsedData,$csvData[0]);
73
+ }
74
+ else{
75
+ $parsedData = $csvData;
76
+ }
77
+ return $parsedData;
78
+ }
79
+
80
+ protected function insertMultiple($csvData,$vendorCode){
81
+ $connection = $this->dbConnection->getConnection ( 'core_write' );
82
+ $csvArray = array();
83
+ $chunkCsvData = array_chunk($csvData,$this->chunksize);
84
+ foreach($chunkCsvData as $value)
85
+ {
86
+ foreach ($value as $key=>$data)
87
+ {
88
+ if($key == 0)
89
+ continue;
90
+ $csvArray[] = array('vendor_code'=>$vendorCode,'csv_vendor_sku'=>trim($data [$this->_indexVendorSku]),'csv_stock'=>$data [$this->_indexStock],'csv_price'=>$data [$this->_indexPrice]);
91
+ }
92
+ try {
93
+ $connection->insertOnDuplicate($this->tableName,$csvArray,array('csv_vendor_sku','csv_stock','csv_price'));
94
+ } catch (Exception $e) {
95
+ Mage::log($e->getTrace(),null,'amosoft_debug.log');
96
+ return false;
97
+ }
98
+ $csvArray = array();
99
+ }
100
+ return true;
101
+ }
102
+
103
+ protected function executeStm($query){
104
+
105
+ $write = $this->dbConnection->getConnection ( 'core_write' );
106
+ $write->beginTransaction ();
107
+ $write->query($query);
108
+ try {
109
+ $write->commit ();
110
+ return true;
111
+ } catch ( Exception $e ) {
112
+ $write->rollBack ();
113
+ Mage::log($e->getMessage(), null, 'vendor_inventory_import_error.log');
114
+ return false;
115
+ }
116
+
117
+ }
118
+
119
+ protected function prepareCsvjoin($header){
120
+ $chnagedValue =array();
121
+ $chnagedValue[] = $header;
122
+ $collection = $this->vendorObject->getCollection()->addFieldToSelect(array('amosoft_vendor_code','amosoft_vendor_sku','stock','cost'));
123
+ $collection->getSelect()->join(array('inventory'=>$this->tableName),
124
+ 'inventory.vendor_code = main_table.amosoft_vendor_code and inventory.csv_vendor_sku = main_table.amosoft_vendor_sku')->where('inventory.csv_stock != main_table.stock or inventory.csv_price != main_table.cost');
125
+
126
+ if($collection->getSize() > 0 ){
127
+
128
+ foreach($collection as $data){
129
+ $query = 'UPDATE '.$this->tableName.' set is_processed = 1 where csv_vendor_sku = "'.$data->getCsvVendorSku().'" and vendor_code = "'.$data->getAmosoftVendorCode().'"';
130
+ $chnagedValue[$data->getRowId()] = array($data->getCsvVendorSku(),$data->getCsvStock(),$data->getCsvPrice());
131
+ $this->executeStm($query);
132
+ }
133
+ }
134
+ return $chnagedValue;
135
+ }
136
+
137
+ public function emptyTable()
138
+ {
139
+ $write = $this->dbConnection->getConnection ( 'core_write' );
140
+ $query = 'TRUNCATE TABLE '.$this->tableName;
141
+ try {
142
+ $write->query($query);
143
+ } catch ( Exception $e ) {
144
+
145
+ Mage::log($e->getMessage(), null, 'vendor_inventory_import_error.log');
146
+ return false;
147
+ }
148
+
149
+ }
150
+ public function getCsvFile($itemObject)
151
+ {
152
+ $io = new Varien_Io_File();
153
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
154
+ $name = md5(microtime());
155
+ $file = $path . DS . $name . '.csv';
156
+ $io->setAllowCreateFolders(true);
157
+ $io->open(array('path' => $path));
158
+ $io->streamOpen($file, 'w+');
159
+ $io->streamLock(true);
160
+ $io->streamWriteCsv($this->_exportHeaders);
161
+ $this->_exportCsvItem($itemObject,$io);
162
+ $io->streamUnlock();
163
+ $io->streamClose();
164
+ return array(
165
+ 'type' => 'filename',
166
+ 'value' => $file,
167
+ 'rm' => true // can delete file after use
168
+ );
169
+ }
170
+ protected function _exportCsvItem($itemObject, Varien_Io_File $adapter)
171
+ {
172
+ $row = array();
173
+ foreach ($itemObject as $item) {
174
+ $row[] = $item->getAmosoftVendorCode();
175
+ $row[] = $item->getAmosoftVendorName();
176
+ $row[] = $item->getProductSku();
177
+ $row[] = $item->getAmosoftVendorSku();
178
+ $row[] = $item->getCost();
179
+ $row[] = $item->getStock();
180
+ $row[] = $this->formatDate($item->getUpdatedAt());
181
+ $adapter->streamWriteCsv($row);
182
+ unset($row);
183
+ }
184
+ }
185
+ public function formatDate($date){
186
+ $format = Mage::app()->getLocale()->getDateTimeFormat(
187
+ Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
188
+ );
189
+ $date = Mage::app()->getLocale()
190
+ ->date($date, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
191
+ return $date;
192
+ }
193
+ public function generateManualCsvRow($csvData,$isProductSetupMode,$amosoft_vendor_code)
194
+ {
195
+ $records = array();
196
+ foreach($csvData as $row => $csvRowData)
197
+ {
198
+ if($row == 0)
199
+ continue;
200
+ if(!$isProductSetupMode)
201
+ {
202
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
203
+ if(is_numeric($csvRowData[2])){
204
+ /* LBN - 935 change */
205
+ $magento_sku = Mage::getModel('dropship/uploadvendor')->getMagentoSku($amosoft_vendor_code, trim($csvRowData[1]));
206
+ $csvqty = (!empty($magento_sku)) ? Mage::helper('dropship')->getIsQtyDecimal($magento_sku,$csvRowData[2]) : $csvRowData[2];;
207
+ }
208
+ else
209
+ {
210
+ $csvqty = $csvRowData[2];
211
+ }
212
+ }
213
+ if(!$isProductSetupMode)
214
+ $records[$row] = array('vendor_sku'=>trim($csvRowData[1]),'qty'=>$csvqty ,'cost'=>$csvRowData[3],'amosoft_vendor_code'=>$amosoft_vendor_code);
215
+ else
216
+ $records[$row] = array('magento_sku'=>trim($csvRowData[0]),'vendor_sku'=>trim($csvRowData[1]),'qty'=>0 ,'cost'=>0,'amosoft_vendor_code'=>$amosoft_vendor_code);
217
+ }
218
+ return $records;
219
+ }
220
+ public function generateFtpCsvRow($csvData,$vendorCode)
221
+ {
222
+ $records = array();
223
+ foreach($csvData as $row => $csvRowData)
224
+ {
225
+ if($row == 0)
226
+ continue;
227
+
228
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
229
+ if(is_numeric($csvRowData[2]) || $csvRowData[2] > 0){
230
+
231
+ $magento_sku = Mage::getModel('dropship/uploadvendor')->getMagentoSku($vendorCode, trim($csvRowData[1]));
232
+ (! empty ( $magento_sku )) ? $qty = Mage::helper ( 'dropship' )->getIsQtyDecimal ( $magento_sku, $csvRowData [2] ) : $qty = $csvRowData [2];
233
+
234
+ }else{
235
+ $qty = $csvRowData[2];
236
+ }
237
+ $records[$row] = array('amosoft_vendor_code'=>$vendorCode,'vendor_sku'=>trim($csvRowData[1]),'qty'=>$qty ,'cost'=>$csvRowData[3]);
238
+ }
239
+ return $records;
240
+ }
241
+ public function isCsvFileEmpty()
242
+ {
243
+ return (count($this->getCsvRows()) > 0) ? false : true;
244
+ }
245
+ protected function getCsvRows()
246
+ {
247
+ $rows = array();
248
+ $conn = $this->dbConnection->getConnection ( 'core_read' );
249
+ $select = $conn->select()->from($this->tableName)->where('is_processed = 0');
250
+ $stmt = $conn->query($select);
251
+ $rows = $stmt->fetchAll();
252
+ return $rows;
253
+ }
254
+ public function getUnprocessedCsvRows($vendorCode,$isFtp){
255
+ $records = array();
256
+ $rows = $this->getCsvRows();
257
+ if(count($rows) > 0 ){
258
+ foreach($rows as $row){
259
+ $records[$row['row_id']] = array('amosoft_vendor_code'=>$vendorCode,'vendor_sku'=>trim($row['csv_vendor_sku']),'qty'=>$row['csv_stock'] ,'cost'=>$row['csv_price']);
260
+ }
261
+ }
262
+ return $records;
263
+ }
264
+ }
265
+
app/code/local/Amosoft/Dropship/Model/Inventory.php ADDED
@@ -0,0 +1,468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Inventory extends Mage_Core_Model_Abstract
11
+ {
12
+ protected $_productInventoryAdd = 0;
13
+ protected $_productInventorySubtract = 0;
14
+ protected $_productInventoryUpdate = 0;
15
+ protected $_stockBeforeQtyDecimalCheck = '';
16
+ protected $_iserror = true;
17
+ protected $_errorMsg = '';
18
+ protected function _construct()
19
+ {
20
+ $this->_init("dropship/inventory");
21
+ }
22
+
23
+ public function prepareInventoryTable($restReqest)
24
+ {
25
+ $result = $this->prepareData($restReqest);
26
+ $this->updateProductStock();
27
+ return $result;
28
+ }
29
+
30
+ protected function updateProductStock()
31
+ {
32
+ $dataCollection = Mage::getModel('dropship/inventory')->getCollection();
33
+ $stockData = array();
34
+ if($dataCollection->count() < 0){
35
+ return;
36
+ }
37
+ foreach($dataCollection as $stock){
38
+ if(array_key_exists($stock->getProductSku(),$stockData)){
39
+
40
+ $stockData[$stock->getProductSku()] = $stockData[$stock->getProductSku()] + $stock->getStock();
41
+ }else{
42
+ $stockData[$stock->getProductSku()] = $stock->getStock();
43
+ }
44
+
45
+ }
46
+ if(empty($stockData)){
47
+ return;
48
+ }
49
+ foreach ($stockData as $sku=>$qty) {
50
+ $this->saveStockData($sku, $qty);
51
+ }
52
+ }
53
+
54
+ protected function saveStockData($sku, $qty)
55
+ {
56
+ $productId = Mage::getModel('catalog/product')->getIdBySku($sku);
57
+ if($productId){
58
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
59
+ if (!$stockItem->getId()) {
60
+ $stockItem->setData('product_id', $productId);
61
+ $stockItem->setData('stock_id', 1);
62
+ }
63
+ if ($stockItem->getQty() != $qty) {
64
+ $stockItem->setData('qty', $qty);
65
+ $stockItem->setData('is_in_stock', $qty ? 1 : 0);
66
+ try {
67
+ $stockItem->save();
68
+ } catch (Exception $e) {
69
+ Mage::helper('dropship')->genrateLog(0,'mgento inventory update started','mgento inventory update ended','Section :Error In Setting/update magento inventory: '.$e->getMessage().' sku : '.$sku);
70
+ echo $e->getMessage();
71
+ }
72
+ }
73
+ }
74
+ }
75
+
76
+
77
+ protected function prepareData($restReqest)
78
+ {
79
+ $result = array();
80
+ $buffer = trim(Mage::getStoreConfig('amosoft_sourcing/inventory/buffer'));
81
+ $vendorModel = Mage::getModel('dropship/ranking')->getCollection();
82
+ foreach ($restReqest as $value) {
83
+ foreach ($value as $key=>$val) {
84
+ $result[$val['amosoft_vendor_code']] = $this->saveAmosoftInventory($val, $buffer);
85
+ }
86
+ }
87
+ return $result;
88
+ }
89
+
90
+ protected function validateRowData($val)
91
+ {
92
+ if(empty($val['product_sku']) && empty($val['amosoft_vendor_sku'])){
93
+ $this->_errorMsg = 'Please provide the Vendor SKU or Product SKU details';
94
+ $this->_iserror = false;
95
+ }elseif(empty($val['amosoft_vendor_code'])){
96
+ $this->_errorMsg = 'Error In Importing "amosoft_vendor_code" Cannot Be Empty';
97
+ $this->_iserror = false;
98
+ }
99
+ return $this->_iserror;
100
+ }
101
+
102
+ protected function updateStock($val,$buffer)
103
+ {
104
+ if(!empty($buffer))
105
+ ($buffer > $val['stock']) ? $val['stock'] = 0 : $val['stock'] = $val['stock'] - $buffer;
106
+ return $val['stock'];
107
+ }
108
+
109
+
110
+ protected function _prepareCollection($val)
111
+ {
112
+ $dataCollection = Mage::getModel('dropship/inventory');
113
+ $collection = null;
114
+ $amosoft_vendor_sku = $val['amosoft_vendor_sku'];
115
+ if($amosoft_vendor_sku != ''){
116
+ $collection = $dataCollection->getCollection()->addFieldToFilter('amosoft_vendor_code',$val['amosoft_vendor_code'])->addFieldToFilter('amosoft_vendor_sku',$amosoft_vendor_sku);
117
+ if($collection->getSize() == 0 && $val['product_sku'] != ''){
118
+ if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
119
+ $this->_errorMsg = 'Can not import Vendor inventory for non-existing product';
120
+ return $collection;
121
+ }
122
+ $collection = $dataCollection->getCollection()->addFieldToFilter('amosoft_vendor_code',$val['amosoft_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
123
+ }
124
+ }
125
+ else{
126
+ if($val['product_sku'] != ''){
127
+ if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
128
+ $this->_errorMsg = 'Can not import Vendor inventory for non-existing product';
129
+ return $collection;
130
+ }
131
+ $collection = $dataCollection->getCollection()->addFieldToFilter('amosoft_vendor_code',$val['amosoft_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
132
+ } else{
133
+ $this->_errorMsg = 'Can not import Vendor inventory for blank product sku';
134
+ return $collection;
135
+ }
136
+ }
137
+ return $collection;
138
+ }
139
+
140
+ protected function getLogMsg($ignoreData)
141
+ {
142
+ if(count($ignoreData)>0){
143
+ if(in_array('stock', $ignoreData)) {
144
+ $msg = 'Cost Updated Successfully, Stock Ignored due to invalid data for';
145
+ $type = 'Cost Updated , Qty Ignored';
146
+ }
147
+ if(in_array('cost', $ignoreData)){
148
+
149
+ $msg = 'Stock Updated Successfully, Cost Ignored due to invalid data for';
150
+ $type = 'Qty Updated, Cost Ignored';
151
+ }
152
+ if(count($ignoreData)==2){
153
+ $msg = 'Cost & Stock Update Failed due to invalid data for';
154
+ $type = 'ignore';
155
+ }
156
+ }else{
157
+ $msg = 'Cost & Stock Updated Successfully for';
158
+ $type = 'update';
159
+ }
160
+ return array('msg'=>$msg,'type'=>$type);
161
+ }
162
+
163
+ /**
164
+ * This function is used to save Vendor inventory
165
+ * @param array $val
166
+ * @return array $msg
167
+ */
168
+ protected function saveAmosoftInventory($rowVal, $buffer)
169
+ {
170
+ $val = array_map('trim',$rowVal);
171
+ $originalStock = $val['stock'];
172
+ $vendorObject = Mage::getModel('dropship/ranking');
173
+ $vendorCollection = $vendorObject->load($val['amosoft_vendor_code'],'amosoft_vendor_code');
174
+ if(!$this->validateRowData($val))
175
+ {
176
+ return $this->_errorMsg;
177
+ }
178
+
179
+ $ignoreData = array();
180
+ (!is_numeric($val['cost']) || $val['cost'] < 0) ? $ignoreData[]= 'cost' : '';
181
+ (!is_numeric($val['stock']) || $val['stock'] < 0) ? $ignoreData[]= 'stock' : '';
182
+ (!is_numeric($val['stock']) || $val['stock'] < 0 || $val['stock'] == "") ? $stockFlag = false : $stockFlag = true;
183
+ (!is_numeric($val['cost']) || $val['cost'] < 0 || $val['cost'] == "") ? $costFlag = false : $costFlag = true;
184
+ $val['stock'] = $this->updateStock($val,$buffer);
185
+ $collection = $this->_prepareCollection($val);
186
+ if(is_null($collection)){
187
+ return $this->_errorMsg;
188
+ }
189
+ $product_sku = $collection->getFirstItem()->getProductSku();
190
+ /* LBN - 935 change */
191
+ $val['stock'] = Mage::helper('dropship')->getIsQtyDecimal($product_sku,$val['stock']);
192
+ if($collection->getSize() >= 2 && empty($val['product_sku']))
193
+ {
194
+ return 'Multiple records found. Please provide Product SKU';
195
+ }
196
+ if($collection->getSize() > 0){
197
+ $collection->getFirstItem ()->setUpdatedAt(now());
198
+ ($stockFlag == true) ? $collection->getFirstItem ()->setStock($val['stock']) : '';
199
+ ($costFlag == true) ? $collection->getFirstItem ()->setCost($val['cost']) : '';
200
+ $arrayUpdate = array('updated_by'=>'system','product_sku'=>$product_sku,'amosoft_vendor_code'=>$val['amosoft_vendor_code'],'cost'=>$val['cost'],'stock'=>$originalStock);
201
+ $logDetail = $this->getLogMsg($ignoreData);
202
+ $this->_saveInventoryLog($logDetail['type'],$arrayUpdate);
203
+ if(count($ignoreData)!=2){
204
+ $collection->getFirstItem ()->save();
205
+ $this->_updateVendorList($vendorCollection,$val,false);
206
+ }
207
+ return $logDetail['msg'];
208
+ }else{
209
+ return 'Vendor Sku "'.$val['amosoft_vendor_sku'].'" and Magento SKU "'.$val['product_sku'].'" combination does not exist for vendor ';
210
+ }
211
+ }
212
+
213
+ public function saveTabVendorData($request)
214
+ {
215
+ $update = isset($request['vendor_update']) ? $request['vendor_update'] : '';
216
+ $addNew = isset($request['vendor_new']) ? $request['vendor_new'] : '';
217
+ $sku = isset($request['sku']) ? $request['sku'] : '';
218
+ $result = true;
219
+ $error = $this->_validate($request);
220
+ if($error){
221
+ return $result = false;
222
+ }
223
+ if(!empty($update)){
224
+ foreach($update as $key => $data){
225
+ if($data['is_delete'] == 1){
226
+ $this->_deleteInvendorVendor($key);
227
+ }else{
228
+ $result = $this->_updateInventoryVendor($key,$data);
229
+ }
230
+ }
231
+ }
232
+ if(!empty($addNew)){
233
+ foreach($addNew as $key => $data){
234
+ if($data['is_delete'] == 1){
235
+ continue;
236
+ }
237
+ $this->_addNewInventoryVendor($data,$sku);
238
+ }
239
+ }
240
+ $finalStock = 0;
241
+ $finalStock = $this->_productInventoryAdd + $this->_productInventoryUpdate;
242
+ return array('inventory'=>$finalStock,'result' => $result);
243
+ }
244
+
245
+ protected function _validate($request)
246
+ {
247
+ $arrVendorCode = array();
248
+ $isUniqueCombination = false;
249
+ $isEntrySame = false;
250
+ $isError = true;
251
+ $errorArr = array();
252
+ if(!empty($request['vendor_new'])){
253
+ foreach ($request['vendor_new'] as $key => $data){
254
+ $arrVendorCode[] = $data['amosoft_vendor_code'];
255
+ //patch for unique combination keys vendor_code and vendor_sku
256
+ if($this->checkCodeSkuCombination($data['amosoft_vendor_code'],$data['amosoft_vendor_sku']) > 0 )
257
+ {
258
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Duplicate entry found for %s , %s',$data['amosoft_vendor_code'],$data['amosoft_vendor_sku']));
259
+ $errorArr[] = 'yes';
260
+ }else{
261
+ $errorArr[] = 'no';
262
+ }
263
+ }
264
+ $isUnique = (array_unique($arrVendorCode) == $arrVendorCode);
265
+ $isEntrySame = $isUnique ? false : true;
266
+ if($isEntrySame)
267
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Duplicate Vendor Entry'));
268
+ $isUniqueCombination = in_array('yes',$errorArr);
269
+ }
270
+ //patch for unique combination keys vendor_code and vendor_sku
271
+ (!$isUniqueCombination && !$isEntrySame) ? $isError = false : $isError;
272
+ return $isError;
273
+ }
274
+
275
+ protected function checkCodeSkuCombination($vendorCode,$vendorSku)
276
+ {
277
+ $collection = $this->getCollection()->addFieldTofilter('amosoft_vendor_code',$vendorCode)->addFieldTofilter('amosoft_vendor_sku',$vendorSku);
278
+ return $collection->count();
279
+ }
280
+
281
+ protected function _addNewInventoryVendor($request,$productSku){
282
+ $vendorCollection = Mage::getModel('dropship/ranking')->load($request['amosoft_vendor_code'],'amosoft_vendor_code');
283
+ $request['created_at'] = now();
284
+ $request['updated_at'] = now();
285
+ $request['product_sku'] = $productSku;
286
+ $request['updated_by'] = Mage::getSingleton('admin/session')->getUser()->getUsername();
287
+ $request['amosoft_vendor_name'] = $vendorCollection->getAmosoftVendorName();
288
+ $request['amosoft_vendor_sku'] = trim($request['amosoft_vendor_sku']);
289
+ if(!empty($productSku)){
290
+ $qty = Mage::helper('dropship')->getIsQtyDecimal($productSku, $request['stock']);
291
+ }
292
+ else{
293
+ $qty = $request['stock'];
294
+ }
295
+ $request['stock'] = $this->_updateBuffer($qty);
296
+ $this->setData($request);
297
+ try{
298
+ $this->save();
299
+ $this->_saveInventoryLog('add',$request);
300
+ $this->_productInventoryAdd = $this->_productInventoryAdd + $request['stock'];
301
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('%s Added Successfully ',$request['amosoft_vendor_name']));
302
+ }catch(Exception $e){
303
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
304
+ }
305
+ }
306
+
307
+ protected function _updateInventoryVendor($id,$request){
308
+
309
+ $model = $this->load($id);
310
+ $vendorCode = $model->getAmosoftVendorCode();
311
+ $vendorName = $model->getAmosoftVendorName();
312
+ $DbValues['cost'] = $model->getCost();
313
+ $DbValues['shipping_cost'] = $model->getShippingCost();
314
+ $DbValues['stock'] = $model->getStock();
315
+ $DbValues['amosoft_vendor_sku'] = $model->getAmosoftVendorSku();
316
+ $productSku = $model->getProductSku();
317
+ $request['amosoft_vendor_sku'] = trim($request['amosoft_vendor_sku']);
318
+ $request['shipping_cost'] = trim($request['shipping_cost']);
319
+ if(!empty($productSku)){
320
+ $this->_stockBeforeQtyDecimalCheck = $request['stock'];
321
+ $request['stock'] = Mage::helper('dropship')->getIsQtyDecimal($productSku, $request['stock']);
322
+ }
323
+
324
+ if($DbValues['amosoft_vendor_sku'] != $request['amosoft_vendor_sku']){
325
+ //patch for unique combination keys vendor_code and vendor_sku
326
+ if($this->checkCodeSkuCombination($vendorCode,$request['amosoft_vendor_sku']) > 0){
327
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Duplicate entry found for %s , %s',$vendorCode,$request['amosoft_vendor_sku']));
328
+ return false;
329
+ }
330
+ }
331
+ if($DbValues['cost'] != $request['cost'] || $DbValues['stock'] != $request['stock'] || $DbValues['amosoft_vendor_sku'] != $request['amosoft_vendor_sku'] || $DbValues['shipping_cost'] != $request['shipping_cost']){
332
+ if($DbValues['stock'] != $request['stock'])
333
+ $request['stock'] = $this->_updateBuffer($request['stock'],$DbValues['stock']);
334
+ $request['updated_at'] = now();
335
+ $model->addData($request);
336
+ try{
337
+ $model->save();
338
+ $this->_saveInventoryLog('update',array('updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'amosoft_vendor_code'=>$model->getAmosoftVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock()));
339
+ $this->_productInventoryUpdate = $this->_productInventoryUpdate + $request['stock'];
340
+
341
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('%s Updated Successfully',$vendorName));
342
+ }catch(Exception $e){
343
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
344
+ }
345
+ }else{
346
+ $this->_productInventoryUpdate = $this->_productInventoryUpdate + $request['stock'];
347
+ }
348
+ return true;
349
+ }
350
+
351
+ protected function _deleteInvendorVendor($vendorId){
352
+ $model = $this->load($vendorId);
353
+ $vendorCode = $model->getAmosoftVendorCode();
354
+ $vendorCollection = Mage::getModel('dropship/ranking')->load($vendorCode,'amosoft_vendor_code');
355
+ $request = array('amosoft_vendor_name'=>$vendorCollection->getAmosoftVendorName(),'updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'amosoft_vendor_code'=>$model->getAmosoftVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock(),'updated_at' => now());
356
+ try{
357
+ $model->delete();
358
+ $this->_saveInventoryLog('delete',$request);
359
+ $this->_productInventorySubtract = $this->_productInventorySubtract + $request['stock'];
360
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('%s Deleted Successfully ',$request['amosoft_vendor_name']));
361
+ }catch(Exception $e){
362
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
363
+ }
364
+ }
365
+
366
+ public function _saveInventoryLog($type,$request){
367
+ $modelLog = Mage::getModel('dropship/inventorylog');
368
+ $request['activity'] = $type;
369
+ if($type=='add')
370
+ $request['created_at'] = now();
371
+ $request['updated_at'] = now();
372
+ if(!isset($request['amosoft_vendor_name'])){
373
+ $vendorRankModel = Mage::getModel('dropship/ranking')->load($request['amosoft_vendor_code'],'amosoft_vendor_code');
374
+ $request['amosoft_vendor_name'] = $vendorRankModel->getAmosoftVendorName();
375
+ }
376
+ $modelLog->setData($request);
377
+ try{
378
+ $modelLog->save();
379
+ }catch(Exception $e){
380
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
381
+ }
382
+ }
383
+
384
+ protected function _updateVendorList($object,$data = ''){
385
+ if(!empty($data)){
386
+ $object->setUpdatedAt(now());
387
+ $object->setAmosoftVendorType('enhanced');
388
+ if(!$object->getId()) $object->setIsDropship('no');
389
+ $object->setAmosoftVendorCode($data['amosoft_vendor_code']);
390
+
391
+ }
392
+ try{
393
+ $object->save();
394
+ }catch(Exception $e){
395
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
396
+ }
397
+ }
398
+
399
+ protected function _updateBuffer($stock,$dbCost = null){
400
+ $buffer = Mage::getStoreConfig('amosoft_sourcing/inventory/buffer');
401
+ $finalStock = 0;
402
+ if(!empty($dbCost) && $this->_stockBeforeQtyDecimalCheck == $dbCost)
403
+ {
404
+ return $stock;
405
+ }
406
+ if(!empty($buffer)){
407
+ if($buffer > $stock){
408
+ $stock = 0;
409
+ }else{
410
+
411
+ $finalStock = $stock - $buffer;
412
+ }
413
+ }else{
414
+ $finalStock = $stock;
415
+ }
416
+ return $finalStock;
417
+ }
418
+ /* method use to send email notification to amosoft
419
+ * that first vendor has been added to amosoft_vendor_inventory
420
+ */
421
+ protected function _afterSave()
422
+ {
423
+ $colSize = $this->getCollection()->getSize();
424
+ $notifyVs = Mage::getStoreConfigFlag('amosoft/notification/vendor_setup');
425
+ if($colSize == 1 && !$notifyVs)
426
+ {
427
+ $this->sendVendorNotification();
428
+ Mage::getModel('dropship/amosoft')->saveNotificationValue(1,'amosoft/notification/vendor_setup');
429
+ }
430
+ parent::_afterSave();
431
+ return;
432
+ }
433
+
434
+ protected function sendVendorNotification(){
435
+
436
+ try {
437
+ $fieldsetData['subject'] = 'DS360 Product Setup completed on Magento';
438
+ $postObject = new Varien_Object();
439
+ $postObject->setData($fieldsetData);
440
+ $templateId = 'amosoft_productsetup_notification';
441
+ $email = Mage::helper('dropship')->getConfigObject('apiconfig/email/toaddress');
442
+ $isMailSent = Mage::helper('dropship')->sendMail($postObject,$email,$templateId);
443
+ if (!$isMailSent) {
444
+ Mage::helper('dropship')->genrateLog(0,'Order notification started','Order notification ended','First product setup complete successfully but email sending failed');
445
+ }
446
+ return true;
447
+ } catch (Exception $e) {
448
+ return false;//$e->getMassage();
449
+ }
450
+ }
451
+ public function upDateVendorName($vendor){
452
+ if(empty($vendor['code']) || empty($vendor['name']))
453
+ {
454
+ return;
455
+ }
456
+ $table = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/inventory' );
457
+ $update = 'UPDATE '.$table.' SET amosoft_vendor_name = "'.$vendor['name'].'" WHERE amosoft_vendor_code = "'.$vendor['code'].'"';
458
+ $conObj = Mage::getSingleton ( 'core/resource' )->getConnection('core_write');
459
+ $conObj->beginTransaction();
460
+ $conObj->query($update);
461
+ try {
462
+ $conObj->commit ();
463
+ } catch ( Exception $e ) {
464
+ $conObj->rollBack ();
465
+ Mage::getSingleton ( 'adminhtml/session' )->addError($e->getMessage ());
466
+ }
467
+ }
468
+ }
app/code/local/Amosoft/Dropship/Model/Inventorylog.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Inventorylog extends Mage_Core_Model_Abstract
11
+ {
12
+ protected function _construct(){
13
+
14
+ $this->_init("dropship/inventorylog");
15
+ }
16
+ }
17
+
app/code/local/Amosoft/Dropship/Model/Observer.php ADDED
@@ -0,0 +1,508 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Model_Observer {
10
+
11
+ const CRON_STRING_PATH_SOURCING = 'crontab/jobs/amosoft_dropship/schedule/cron_expr';
12
+ const CRON_STRING_PATH_BACKORDER = 'crontab/jobs/amosoft_backorder/schedule/cron_expr';
13
+ const XML_PATH_AMOSOFT_ORDER_BEGIN_SOURCING_STATUS = 'Reprocess';
14
+ const XML_PATH_AMOSOFT_ORDER_BACKORDERED = 'Backorder';
15
+ const XML_PATH_AMOSOFT_EMAIL_SHIPMENT = 'amosoft_sourcing/rank/email_shipment';
16
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL = 'amosoft_sourcing/inventory_notification/email';
17
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED = 'amosoft_sourcing/inventory_notification/enabled';
18
+ const XML_PATH_INVENTORY_NOTIFICATION_DAYS = 'amosoft_sourcing/inventory_notification/days';
19
+ const XML_PATH_LOGICSOURCING_SOURCING_TYPE = 'amosoft_sourcing/rank/sourcing_type';
20
+ protected $_orderStatus;
21
+ protected $_itemData = array();
22
+
23
+ public static function getWorkingDir()
24
+ {
25
+ return Mage::getBaseDir();
26
+ }
27
+
28
+
29
+ public function insertProcessOrder($object)
30
+ {
31
+
32
+ $this->_orderStatus = $object->getOrder()->getStatus();
33
+ foreach ($object->getOrder ()->getAllItems() as $item){
34
+ if(in_array($item->getProductType(),array('simple','grouped')) ){
35
+ $started = 0;
36
+ $ended = 1;
37
+ $logMsg = 'Item inserted @'.Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/orderitems' ). ' sku : '.$item->getSku().','.$object->getOrder()->getIncrementId();
38
+ Mage::helper('dropship')->genrateLog(++$started,'Order Item Inserted Started',null,$logMsg);
39
+ $this->getOrderSourcing($item, $object);
40
+ Mage::helper('dropship')->genrateLog(++$ended,null,'Order Item Inserted Ended',null);
41
+ }
42
+ }
43
+ }
44
+
45
+ protected function getOrderSourcing($item, $object){
46
+ $orderSourcingInstance = Mage::getModel( 'dropship/orderitems' );
47
+ Mage::getModel('dropship/amosoft')->prepareNotification($orderSourcingInstance,$object->getOrder()->getEntityId());
48
+ $orderStatus = $object->getOrder()->getStatus();
49
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($orderSourcingInstance, 'Sourcing', $orderStatus);
50
+
51
+ $selected_ship_method = $object->getOrder()->getShippingMethod();
52
+ if($selected_ship_method == "suppliershippingcostperproduct_suppliershippingcostperproduct"){
53
+
54
+ $shipCost = Mage::helper('dropship')->getVendorShippingCost($item);
55
+ $shippingPrice = $item->getQtyOrdered() * $shipCost;
56
+ $orderSourcingInstance->setShippingCost( $shippingPrice );
57
+ }
58
+ $orderSourcingInstance->setSku( $item->getSku() );
59
+ $orderSourcingInstance->setItemId( $item->getItemId() );
60
+ $orderSourcingInstance->setItemOrderId( $object->getOrder()->getEntityId() );
61
+ $orderSourcingInstance->setAmosoftItemStatus('Sourcing');
62
+ $orderSourcingInstance->setUpdatedBy('Cron');
63
+ $orderSourcingInstance->setUpdatedAt(now());
64
+ $orderSourcingInstance->setItemStatusHistory($itemStatusHistory);
65
+ try {
66
+ $orderSourcingInstance->save();
67
+ } catch ( Execption $e ) {
68
+ Mage::helper('dropship')->genrateLog(0,null,null,'Section : order item inserted Error: '.$e->getMessage().' sku : '.$item->getSku());
69
+ echo $e->getMessage();
70
+ }
71
+
72
+ //As item get saved in amosoft_sales_orders_items we run our sourcing logic
73
+ if(Mage::getStoreConfigFlag(self::XML_PATH_LOGICSOURCING_SOURCING_TYPE)){
74
+ $this->assignToVendor($item);
75
+ Mage::getResourceModel('dropship/orderitems')->saveOrderItems($this->_itemData,$object->getOrder());
76
+ $this->_itemData = array();
77
+ }
78
+ }
79
+
80
+ public function amosoftSourcing() {
81
+ $sourcingObj = Mage::getModel('dropship/ordersourcing');
82
+ if(!Mage::getStoreConfig(self::CRON_STRING_PATH_SOURCING)) {
83
+ Mage::helper('dropship')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as cron time not set');
84
+ return;
85
+ }
86
+ if($sourcingObj->checkRunningStatus('sourcing')){
87
+
88
+ Mage::helper('dropship')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as process already running');
89
+ return;
90
+ }
91
+ Mage::helper('dropship')->genrateLog(1,'Sourcing Started for '.Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_REPROCESS.' Item status',null,null);
92
+ $sourcingObj->sourcingStarted(Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_SOURCING);
93
+ $this->setAmosoftVendorRanking (Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_REPROCESS,true);
94
+ $this->addCronStatus('amosoft_sourcing/cron_settings/dispaly_sourcing_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
95
+ $sourcingObj->sourcingCompleted(Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_SOURCING);
96
+ Mage::helper('dropship')->genrateLog(2,null,'Sourcing Ended for ' .Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_REPROCESS.' Item status',null);
97
+ return;
98
+ }
99
+
100
+ public function amosoftBackorder()
101
+ {
102
+ $sourcingObj = Mage::getModel('dropship/ordersourcing');
103
+ if(!Mage::getStoreConfig(self::CRON_STRING_PATH_BACKORDER)) {
104
+ Mage::helper('dropship')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started as cron time not set');
105
+ return;
106
+ }
107
+ if($sourcingObj->checkRunningStatus(Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER)){
108
+ Mage::helper('dropship')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started process already running');
109
+ return;
110
+ }
111
+ Mage::helper('dropship')->genrateLog(1,'Backorder Sourcing Started for '.Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER . ' item status',null,null);
112
+ $sourcingObj->sourcingStarted(Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER);
113
+ $this->setAmosoftVendorRanking (Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER);
114
+ $this->addCronStatus('amosoft_sourcing/cron_settings/display_backorder_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
115
+ $sourcingObj->sourcingCompleted(Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER);
116
+ Mage::helper('dropship')->genrateLog(1,'Backorder Sourcing Ended for '.Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER .' item status',null,null);
117
+ return;
118
+ }
119
+
120
+
121
+ /*
122
+ * Save last cron status
123
+ * @param string $statusPath
124
+ * @param string $status
125
+ */
126
+ protected function addCronStatus($statusPath, $status) {
127
+ $config = new Mage_Core_Model_Config();
128
+ $config->saveConfig($statusPath, $status, 'default', 0);
129
+ return;
130
+ }
131
+
132
+ protected function setAmosoftVendorRanking($crontype,$isCronSourcing = false)
133
+ {
134
+ $reprocess = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_REPROCESS;
135
+ $OrderInstances = Mage::getModel('dropship/ordersourcing');
136
+ $collection = $OrderInstances->prepareItemCollection($crontype,$isCronSourcing);
137
+ if(count($collection) > 0 ){
138
+ foreach ( $collection as $orderID => $orderCollectionData ) {
139
+ $orderCollection = Mage::getModel('sales/order')->Load($orderID);
140
+ //Patch : skip sourcing process if order is deleted
141
+ if (! $orderCollection->getEntityId ()) {
142
+ Mage::helper ( 'dropship' )->genrateLog ( 0, null, null, 'Order not exists for => order_id: ' . $orderID . ' hence cannot continue' );
143
+ continue;
144
+ }
145
+ $this->_orderStatus = $orderCollection->getStatus();
146
+ foreach ($orderCollectionData as $orderData ){
147
+ Mage::helper('dropship')->genrateLog(0,null,null,'<---->Item Processing Started : '.$orderData->getSku());
148
+ if ($crontype == Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_REPROCESS) {
149
+ $assigned = $this->assignToVendor(Mage::getModel('sales/order_item')->Load($orderData->getItemId()));
150
+ }else
151
+ {
152
+ $orderItems = Mage::getModel( 'dropship/orderitems' )->load($orderData->getItemId(), 'item_id');
153
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($orderItems, $reprocess, $this->_orderStatus);
154
+ $this->_itemData[$orderData->getItemId()] = array('amosoft_item_status'=>$reprocess,'item_status_history'=>$itemStatusHistory);
155
+ }
156
+ Mage::helper('dropship')->genrateLog(0,null,null,'####### Item Processing ended : '.$orderData->getSku());
157
+
158
+ }
159
+ Mage::getResourceModel('dropship/orderitems')->saveOrderItems($this->_itemData,$orderCollection,$crontype);
160
+ $this->_itemData = array();
161
+ }
162
+ }else {
163
+ Mage::helper('dropship')->genrateLog(0,null,null,'Order collection is empty for => Cron_type: '.$crontype.' hence cannot continue');
164
+ return;
165
+ }
166
+ }
167
+ protected function assignToVendor($item) {
168
+ $productSku = $item->getSku();
169
+ $itemStatusComplete = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_TRANSMITTING;
170
+ $itemStatusBackorder = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER;
171
+ $itemStatusNoDropShip = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_NO_DROPSHIP;
172
+ $qtyInvoiced = $item->getQtyOrdered();
173
+ $itemId = $item->getItemId();
174
+ $isDefaultVendor = false;
175
+ $vendorCode = '';
176
+ $inventoryStock = '';
177
+ $defaultVendor = (Mage::getStoreConfig('amosoft_sourcing/rank/defaultbackorder') == 'none') ? '' : Mage::getStoreConfig('amosoft_sourcing/rank/defaultbackorder');
178
+ $orderItemInstance = Mage::getModel( 'dropship/orderitems' );
179
+ $orderItemInstance->load( $itemId, 'item_id' );
180
+ $collectionVendor = $orderItemInstance->prepareOrderItemData($item);
181
+ $arrDefaultVendorDetails = array();
182
+ $vendorCost = 0;
183
+
184
+ if ($collectionVendor->count() > 0) {
185
+ if($collectionVendor->count() >= 1){
186
+ foreach ($collectionVendor as $vendorData) {
187
+ //assign default vendor details
188
+ if(!empty($defaultVendor) && $vendorData->getAmosoftVendorCode() == $defaultVendor )
189
+ {
190
+ $arrDefaultVendorDetails = array('amosoft_vendor_code'=>$vendorData->getAmosoftVendorCode(),'stock'=>$vendorData->getStock(),'cost'=>$vendorData->getCost(),'amosoft_vendor_sku'=>$vendorData->getAmosoftVendorSku(),'product_sku'=>$vendorData->getProductSku());
191
+ }
192
+ //if item is in backordered
193
+ if($vendorData->getStock() < $qtyInvoiced ){
194
+ $arrVendorDetail[] = array('amosoft_vendor_code'=>$vendorData->getAmosoftVendorCode(),'stock'=>$vendorData->getStock(),'cost'=>$vendorData->getCost(),'amosoft_vendor_sku'=>$vendorData->getAmosoftVendorSku(),'product_sku'=>$vendorData->getProductSku());
195
+ $vendorCode = $arrVendorDetail[0]['amosoft_vendor_code'];
196
+ $inventoryStock = $arrVendorDetail[0]['stock'];
197
+ $vendorCost = $arrVendorDetail[0]['cost'];
198
+ $vendorSku = $arrVendorDetail[0]['amosoft_vendor_sku'];
199
+ $productSku = $arrVendorDetail[0]['product_sku'];
200
+ $arrVendorAvailable[] = $vendorData->getAmosoftVendorCode();
201
+ $isDefaultVendor = true;
202
+ }else{
203
+ $vendorCode = $vendorData->getAmosoftVendorCode();
204
+ $inventoryStock = $vendorData->getStock();
205
+ $vendorCost = $vendorData->getCost();
206
+ $vendorSku = $vendorData->getAmosoftVendorSku();
207
+ $productSku = $vendorData->getProductSku();
208
+ $arrVendorAvailable[] = $vendorData->getAmosoftVendorCode();
209
+ $isDefaultVendor = false;
210
+ break;
211
+ }
212
+ }
213
+ $arrVendorAvailable[] = $vendorData->getAmosoftVendorCode();
214
+ }else {
215
+ $arrFirstVendor = $collectionVendor->getFirstItem()->getData();
216
+ $vendorCode = $arrFirstVendor ['amosoft_vendor_code'];
217
+ $inventoryStock = $arrFirstVendor ['stock'];
218
+ $vendorCost = $arrFirstVendor ['cost'];
219
+ $vendorSku = $arrFirstVendor ['amosoft_vendor_sku'];
220
+ $productSku = $arrFirstVendor ['product_sku'];
221
+ if($inventoryStock < $qtyInvoiced)
222
+ $isDefaultVendor = true;
223
+ else
224
+ $isDefaultVendor = false;
225
+
226
+ $arrVendorAvailable[] = $arrFirstVendor ['amosoft_vendor_code'];
227
+ }
228
+ }
229
+
230
+ if(!empty($vendorCode)){
231
+ if ($vendorCode && $inventoryStock >= $qtyInvoiced) {
232
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($orderItemInstance, $itemStatusComplete, $this->_orderStatus);
233
+ Mage::helper('dropship')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatusComplete);
234
+ Mage::getModel('dropship/amosoft')->setupNotification();
235
+ $this->_itemData [$item->getItemId()] = array (
236
+ 'updateInventory' => true,
237
+ 'qtyInvoiced' =>$qtyInvoiced,
238
+ 'updated_at' => now(),
239
+ 'sku' => $item->getSku(),
240
+ 'updated_by' => 'Cron',
241
+ 'amosoft_item_status' => $itemStatusComplete,
242
+ 'amosoft_vendor_code' => $vendorCode,
243
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
244
+ 'amosoft_vendor_sku' => $vendorSku,
245
+ 'item_status_history' => $itemStatusHistory
246
+ );
247
+ return $itemStatusComplete;
248
+ }
249
+ if ($isDefaultVendor && $inventoryStock <= $qtyInvoiced && !empty($defaultVendor) && in_array($defaultVendor,$arrVendorAvailable)) {
250
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($orderItemInstance, $itemStatusComplete, $this->_orderStatus);
251
+ Mage::helper('dropship')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details Default vendor set ==>stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->Transmitting');
252
+ $this->_itemData [$item->getItemId()] = array (
253
+ 'updateInventory' => false,
254
+ 'updated_at' => now(),
255
+ 'sku' => $item->getSku(),
256
+ 'updated_by' => 'Cron',
257
+ 'amosoft_item_status' => $itemStatusComplete,
258
+ 'amosoft_vendor_code' => $defaultVendor,
259
+ 'vendor_cost' => $arrDefaultVendorDetails ['cost'] * $qtyInvoiced,
260
+ 'amosoft_vendor_sku' => $arrDefaultVendorDetails ['amosoft_vendor_sku'],
261
+ 'item_status_history' => $itemStatusHistory
262
+ );
263
+ return $itemStatusComplete;
264
+ }
265
+ if ($vendorCode && $inventoryStock <= $qtyInvoiced) {
266
+ $itemStatusHistory =Mage::helper('dropship')->getSerialisedData($orderItemInstance, $itemStatusBackorder, $this->_orderStatus);
267
+ Mage::helper('dropship')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==>stock('.$inventoryStock.') <= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatusBackorder);
268
+ $this->_itemData [$item->getItemId()] = array (
269
+ 'updateInventory' => false,
270
+ 'updated_at' => now(),
271
+ 'sku' => $item->getSku(),
272
+ 'updated_by' => 'Cron',
273
+ 'amosoft_item_status' => $itemStatusBackorder,
274
+ 'amosoft_vendor_code' => $vendorCode,
275
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
276
+ 'amosoft_vendor_sku' => $vendorSku,
277
+ 'item_status_history' => $itemStatusHistory
278
+ );
279
+ return $itemStatusBackorder;
280
+ }
281
+ }else{
282
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($orderItemInstance,$itemStatusNoDropShip, $this->_orderStatus);
283
+ Mage::helper('dropship')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> No vendor Set ,vendor_code ->'.$vendorCode.', item-status->No Dropship');
284
+ $this->_itemData [$item->getItemId()] = array (
285
+ 'updateInventory' => false,
286
+ 'updated_at' => now(),
287
+ 'sku' => $item->getSku(),
288
+ 'updated_by' => 'Cron',
289
+ 'amosoft_item_status' => $itemStatusNoDropShip,
290
+ 'amosoft_vendor_code' => $vendorCode,
291
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
292
+ 'amosoft_vendor_sku' => '',
293
+ 'item_status_history' => $itemStatusHistory
294
+ );
295
+ return $itemStatusNoDropShip;
296
+ }
297
+ }
298
+
299
+ /**
300
+ * Flag to stop observer executing more than once
301
+ *
302
+ * @var static bool
303
+ */
304
+ //static protected $_singletonFlag = false;
305
+
306
+ /**
307
+ * This method will run when the product is saved from the Magento Admin
308
+ * Use this function to update the product model, process the
309
+ * data or anything you like
310
+ *
311
+ * @param Varien_Event_Observer $observer
312
+ */
313
+
314
+ public function saveProductTabData(Varien_Event_Observer $observer)
315
+ {
316
+ $product = $observer->getEvent()->getProduct();
317
+ if(!empty($product['vendor_update']) || !empty($product['vendor_new'])){
318
+ try {
319
+ /**
320
+ * Perform any actions you want here
321
+ *
322
+ */
323
+ $customFieldValue = $this->_getRequest()->getPost('product');
324
+ $result = Mage::getModel('dropship/inventory')->saveTabVendorData($customFieldValue);
325
+
326
+ /**
327
+ * Uncomment the line below to save the product
328
+ *
329
+ */
330
+ //if(!$result)
331
+ //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Vendor Data Cannot be saved'));
332
+
333
+ //$product->save();
334
+
335
+
336
+ $this->_inventoryUpdate($result,$customFieldValue['sku']);
337
+ }
338
+ catch (Exception $e) {
339
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
340
+ }
341
+ }
342
+ return;
343
+ }
344
+
345
+ protected function _inventoryUpdate($result,$sku)
346
+ {
347
+ if(!$result['result']){
348
+ return;
349
+ }
350
+
351
+ $finalStock = $result['inventory'];
352
+ $finalStock = Mage::helper('dropship')->getIsQtyDecimal($sku, $finalStock);
353
+ $conn = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
354
+
355
+ $tableNameStatus = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status' );
356
+ $tableNameItem = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_item' );
357
+ $tableNameItemIdx = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status_indexer_idx' );
358
+
359
+ $stockStatus = $finalStock ? 1 : 0;
360
+ $productId = Mage::getModel('catalog/product')->getIdBySku($sku);
361
+ if($productId){
362
+ $updateStatus = 'update '.$tableNameStatus.' SET qty = '.$finalStock.',stock_status = '.$stockStatus.' where product_id = '.$productId;
363
+ $updateItem = 'update '.$tableNameItem.' SET qty = '.$finalStock.',is_in_stock = '.$stockStatus.' where product_id = '.$productId;
364
+ $updateItemIdx = 'update '.$tableNameItemIdx.' SET qty = '.$finalStock.',stock_status = '.$stockStatus.' where product_id = '.$productId;
365
+ $conn->beginTransaction ();
366
+ $conn->query ($updateStatus);
367
+ $conn->query ($updateItem);
368
+ $conn->query ($updateItemIdx);
369
+ try {
370
+ $conn->commit ();
371
+ } catch ( Exception $e ) {
372
+ $conn->rollBack ();
373
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
374
+ }
375
+ }
376
+ }
377
+
378
+ /**
379
+ * Retrieve the product model
380
+ *
381
+ * @return Mage_Catalog_Model_Product $product
382
+ */
383
+ public function getProduct()
384
+ {
385
+ return Mage::registry('product');
386
+ }
387
+
388
+ /**
389
+ * Shortcut to getRequest
390
+ *
391
+ */
392
+ protected function _getRequest()
393
+ {
394
+ return Mage::app()->getRequest();
395
+ }
396
+
397
+ public function preDispatch(Varien_Event_Observer $observer)
398
+ {
399
+ return;
400
+ }
401
+
402
+ protected function _isValidForShipmentEmail($shipment)
403
+ {
404
+ // send shipment email only when email shipment is enabled from module
405
+ if(Mage::getStoreConfig(self::XML_PATH_AMOSOFT_EMAIL_SHIPMENT)){
406
+ $trackingNumbers = array();
407
+ foreach ($shipment->getAllTracks() as $track) {
408
+ $trackingNumbers[] = $track->getNumber();
409
+ };
410
+ // send shipment email only when carrier tracking info is added
411
+ if (count($trackingNumbers) > 0) {
412
+ $lastValueOfArray = end($trackingNumbers);
413
+ $lastValueOfArray = trim($lastValueOfArray);
414
+ if(!empty($lastValueOfArray))
415
+ return true;
416
+ else
417
+ return false;
418
+ } else {
419
+ return false;
420
+ }
421
+ }
422
+ }
423
+
424
+ public function salesOrderShipmentSaveBefore(Varien_Event_Observer $observer)
425
+ {
426
+ if(!Mage::getStoreConfig(self::XML_PATH_AMOSOFT_EMAIL_SHIPMENT)){
427
+ return $this;
428
+ }
429
+ if (Mage::registry('salesOrderShipmentSaveBeforeTriggered')) {
430
+ return $this;
431
+ }
432
+ /* @var $shipment Mage_Sales_Model_Order_Shipment */
433
+ $shipment = $observer->getEvent()->getShipment();
434
+ if ($shipment) {
435
+ if ($this->_isValidForShipmentEmail($shipment)) {
436
+ $shipment->setEmailSent(true);
437
+ Mage::register('salesOrderShipmentSaveBeforeTriggered', true);
438
+ }
439
+ }
440
+ return $this;
441
+ }
442
+
443
+ public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer)
444
+ {
445
+ if(!Mage::getStoreConfig(self::XML_PATH_AMOSOFT_EMAIL_SHIPMENT)){
446
+ return $this;
447
+ }
448
+ if (Mage::registry('salesOrderShipmentSaveAfterTriggered')) {
449
+ return $this;
450
+ }
451
+
452
+ /* @var $shipment Mage_Sales_Model_Order_Shipment */
453
+ $shipment = $observer->getEvent()->getShipment();
454
+ if ($shipment) {
455
+ if ($this->_isValidForShipmentEmail($shipment)) {
456
+ $shipment->sendEmail();
457
+ Mage::register('salesOrderShipmentSaveAfterTriggered', true);
458
+ }
459
+ }
460
+ return $this;
461
+ }
462
+
463
+ /*
464
+ * This function is used to delete the sku from vendor inventory
465
+ * when the same sku is deleted from catalog product
466
+ */
467
+ public function catalogProductDeleteAfter(Varien_Event_Observer $observer)
468
+ {
469
+ $deletedProductSku = $observer->getEvent()->getProduct()->getSku();
470
+ $orderItem = Mage::getModel ('dropship/inventory')->getCollection()->addFieldToFilter('product_sku', $deletedProductSku);
471
+ if($orderItem->getSize() > 0){
472
+ foreach($orderItem as $data){
473
+ try {
474
+ Mage::getModel ('dropship/inventory')->load($data->getId())->delete();
475
+ } catch (Exception $e) {
476
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
477
+ }
478
+ }
479
+ }
480
+ return $this;
481
+ }
482
+ //@function : notify cutomer for oudated product inventory through email,initiated by cron
483
+ public function notifyForProductUpdateInventory(){
484
+ if (!Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED) || !Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_DAYS) || !Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL)) {
485
+ return $this;
486
+ }
487
+ $itemObject;
488
+ $fileInfo = array();
489
+ $ioAdapter = new Varien_Io_File();
490
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime('-'.Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_DAYS).' day'));
491
+ $open_monitor_to = Mage::getModel('core/date')->gmtDate();
492
+ $itemObject = Mage::getModel('dropship/inventory')->getCollection()->addFieldTofilter('updated_at', array('from' => $open_monitor_from,'to' => $open_monitor_to));
493
+ if($itemObject->getSize() <= 0){
494
+ Mage::log('cannot send outdated product inventory email collection is empty for form :'.$open_monitor_from.' to :'.$open_monitor_to, null, 'notification_error.log');
495
+ return $this;
496
+ }
497
+ $fileInfo = Mage::getModel('dropship/csvparser')->getCsvFile($itemObject);
498
+ $mailData['days'] = Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_DAYS);
499
+ $mailData['subject'] = 'dropship list of outdated product inventory';
500
+ $postObject = new Varien_Object();
501
+ $postObject->setData($mailData);
502
+ $email = trim(Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL));
503
+ $templateId = 'amosoft_outdated_product_inventory';
504
+ $isMailSent = Mage::helper('dropship')->sendMail($postObject,$email,$templateId,$fileInfo['value']);
505
+ $ioAdapter->rm($fileInfo['value']);
506
+ return $this;
507
+ }
508
+ }
app/code/local/Amosoft/Dropship/Model/Order/Api.php ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Order API rewrite to add three Amosoft fields in salesOrderItemEntity Array of salesorderinfo api
4
+ * and to update Amosoft item status
5
+ * @category Amosoft
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_Order_Api extends Mage_Sales_Model_Order_Api_V2
9
+ {
10
+ protected $_itemStatusTansmitting = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_TRANSMITTING;
11
+
12
+ /**
13
+ * Retrieve list of orders. Filtration could be applied
14
+ *
15
+ * @param null|object|array $filters
16
+ * @return array
17
+ */
18
+ public function items($filters = null)
19
+ {
20
+ $orders = array();
21
+ $itemTemp = array();
22
+ //TODO: add full name logic
23
+ $billingAliasName = 'billing_o_a';
24
+ $shippingAliasName = 'shipping_o_a';
25
+
26
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
27
+ $orderCollection = Mage::getModel("sales/order")->getCollection();
28
+ $billingFirstnameField = "$billingAliasName.firstname";
29
+ $billingLastnameField = "$billingAliasName.lastname";
30
+ $shippingFirstnameField = "$shippingAliasName.firstname";
31
+ $shippingLastnameField = "$shippingAliasName.lastname";
32
+ $orderCollection->addAttributeToSelect('*')
33
+ ->addAddressFields()
34
+ ->addExpressionFieldToSelect('billing_firstname', "{{billing_firstname}}",
35
+ array('billing_firstname' => $billingFirstnameField))
36
+ ->addExpressionFieldToSelect('billing_lastname', "{{billing_lastname}}",
37
+ array('billing_lastname' => $billingLastnameField))
38
+ ->addExpressionFieldToSelect('shipping_firstname', "{{shipping_firstname}}",
39
+ array('shipping_firstname' => $shippingFirstnameField))
40
+ ->addExpressionFieldToSelect('shipping_lastname', "{{shipping_lastname}}",
41
+ array('shipping_lastname' => $shippingLastnameField))
42
+ ->addExpressionFieldToSelect('billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})",
43
+ array('billing_firstname' => $billingFirstnameField, 'billing_lastname' => $billingLastnameField))
44
+ ->addExpressionFieldToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
45
+ array('shipping_firstname' => $shippingFirstnameField, 'shipping_lastname' => $shippingLastnameField)
46
+ );
47
+
48
+ /** @var $apiHelper Mage_Api_Helper_Data */
49
+ /*$apiHelper = Mage::helper('api');
50
+ $filters = $apiHelper->parseFilters($filters, $this->_attributesMap['order']);
51
+ try {
52
+ foreach ($filters as $field => $value) {
53
+ $orderCollection->addFieldToFilter($field, $value);
54
+ }
55
+ } catch (Mage_Core_Exception $e) {
56
+ $this->_fault('filters_invalid', $e->getMessage());
57
+ }*/
58
+
59
+ /* Patch apply to display item list with
60
+ * vendor_cost,amosoft_vendor_code,amosoft_vendor_sku,magento_sku
61
+ */
62
+ foreach ($orderCollection as $order) {
63
+
64
+ $results = $this->addItemDetails($order);
65
+ if(count($results) > 0){
66
+ /* new code */
67
+ foreach($results as $result)
68
+ {
69
+ if($result['amosoft_vendor_code'] == $filters)
70
+ $itemTemp['item_details'][] = $result;
71
+ }
72
+
73
+ //$a = !array_search('MagVendID1', $itemTemp['item_details']);
74
+ //return $a;
75
+ //unset($itemTemp['item_details'][$a]);
76
+
77
+ $itemTemp['dropship_item'] = $this->isDropshipItemReady($order);
78
+ $orders[] = array_merge($this->_getAttributes($order, 'order'),$itemTemp);
79
+ unset($itemTemp);
80
+ }else
81
+ {
82
+ $orders[] = $this->_getAttributes($order, 'order');
83
+ }
84
+ }
85
+
86
+ return $orders;
87
+ }
88
+ protected function isDropshipItemReady($order)
89
+ {
90
+ $result = false;
91
+ $ItemCollection = Mage::getModel('dropship/orderitems')->getCollection()->addFieldToFilter('amosoft_item_status',$this->_itemStatusTansmitting)->addFieldToFilter('item_order_id',$order->getEntityId());
92
+ if($ItemCollection->count() > 0)
93
+ $result = true;
94
+ return $result;
95
+ }
96
+
97
+ protected function addItemDetails($order){
98
+ $result = array();
99
+ $ItemCollection = Mage::getModel('dropship/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order->getEntityId());
100
+ if($ItemCollection->count() > 0){
101
+ unset($result);
102
+ foreach($ItemCollection as $item)
103
+ {
104
+ $result[] = array('item_sku'=>$item->getSku(),'amosoft_vendor_sku' => $item->getAmosoftVendorSku(),'amosoft_vendor_code' => $item->getAmosoftVendorCode(),'amosoft_vendor_cost' => $item->getVendorCost(),'amosoft_vendor_ship_cost' => $item->getShippingCost(),'amosoft_item_status'=>$item->getAmosoftItemStatus(), 'order_item_id'=>$item->getItemId());
105
+ }
106
+ }
107
+
108
+ return $result;
109
+ }
110
+ /**
111
+ * Retrieve full order information
112
+ *
113
+ * @param string $orderIncrementId
114
+ * @return array
115
+ */
116
+ public function info($orderIncrementId)
117
+ {
118
+ $order = $this->_initOrder($orderIncrementId);
119
+
120
+ if ($order->getGiftMessageId() > 0) {
121
+ $order->setGiftMessage(
122
+ Mage::getSingleton('giftmessage/message')->load($order->getGiftMessageId())->getMessage()
123
+ );
124
+ }
125
+
126
+ $result = $this->_getAttributes($order, 'order');
127
+
128
+ $result['shipping_address'] = $this->_getAttributes($order->getShippingAddress(), 'order_address');
129
+ $result['billing_address'] = $this->_getAttributes($order->getBillingAddress(), 'order_address');
130
+ $result['items'] = array();
131
+
132
+ //$id = $order->getId();
133
+ foreach ($order->getAllItems() as $item) {
134
+ $result['items'][] = $this->getProductAmosoftDetails($item, $order);
135
+ }
136
+
137
+ $result['payment'] = $this->_getAttributes($order->getPayment(), 'order_payment');
138
+
139
+ $result['status_history'] = array();
140
+
141
+ foreach ($order->getAllStatusHistory() as $history) {
142
+ $result['status_history'][] = $this->_getAttributes($history, 'order_status_history');
143
+ }
144
+
145
+ return $result;
146
+ }
147
+ /**
148
+ * This function will add details to order items
149
+ * @param array $item, int $id
150
+ * @return array $productItems
151
+ */
152
+ protected function getProductAmosoftDetails($item, $order){
153
+ if ($item->getGiftMessageId() > 0) {
154
+ $item->setGiftMessage(
155
+ Mage::getSingleton('giftmessage/message')->load($item->getGiftMessageId())->getMessage()
156
+ );
157
+ }
158
+ $productItems = array();
159
+ $productItems = $this->_getAttributes($item, 'order_item');
160
+ $amosoftItems = Mage::getModel('dropship/orderitems')->getCollection()
161
+ ->addFieldToSelect(array('sku', 'amosoft_vendor_sku', 'vendor_cost', 'shipping_cost', 'amosoft_item_status', 'amosoft_vendor_code', 'item_id'))
162
+ ->addFieldToFilter('item_order_id',array('eq'=>$order->getId()))
163
+ ->addFieldToFilter('item_id', array('eq'=>$productItems['item_id']));
164
+ //->addFieldToFilter('amosoft_item_status', array('eq'=>$this->_itemStatusTansmitting));
165
+ $amosoftItems->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
166
+ 'salesOrder.entity_id = main_table.item_order_id', array('state'));
167
+ //->where('salesOrder.state = ?','processing');
168
+ if($amosoftItems->getSize() > 0){
169
+ $productItems['amosoft_item_status'] = $amosoftItems->getFirstItem()->getAmosoftItemStatus();
170
+ $productItems['amosoft_vendor_sku'] = $amosoftItems->getFirstItem()->getAmosoftVendorSku();
171
+ $productItems['amosoft_vendor_cost'] = $amosoftItems->getFirstItem()->getVendorCost();
172
+ $productItems['amosoft_vendor_ship_cost'] = $amosoftItems->getFirstItem()->getShippingCost();
173
+ $productItems['vendor_sale_total'] = $productItems['amosoft_vendor_cost'] + $productItems['amosoft_vendor_ship_cost'];
174
+ $productItems['amosoft_vendor_code'] = $amosoftItems->getFirstItem()->getAmosoftVendorCode();
175
+ }
176
+ return $productItems;
177
+ }
178
+
179
+
180
+ /**
181
+ * Change Amosoft order item status
182
+ *
183
+ * @param string $orderIncrementId, array $sku, string $status
184
+ * @return bool
185
+ */
186
+ public function updateItemStatus($orderIncrementId, $sku, $status){
187
+
188
+ $order = $this->_initOrder($orderIncrementId);
189
+ $result = false;
190
+ try{
191
+ $items = $order->getAllItems();
192
+ foreach ($items as $item){
193
+ if( $item->getSku() == $sku){
194
+ $itemIdArr[] = $item->getItemId();
195
+ }
196
+ }
197
+ if(!$status){
198
+ $status = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_SENT_TO_SUPPLIER;
199
+ }
200
+ if($itemIdArr && in_array(ucfirst($status),Mage::helper('dropship')->getItemStatuses())){
201
+ foreach($itemIdArr as $itemId){
202
+ $result = $this->saveAmosoftStatus($itemId, $status);
203
+ }
204
+ }else{
205
+ $result = false;
206
+ }
207
+ }catch (Mage_Core_Exception $e) {
208
+ $this->_fault('status_not_changed', $e->getMessage());
209
+ }
210
+ return $result;
211
+ }
212
+
213
+ /**
214
+ * This function is used to save order item status
215
+ * @param int $itemId, string $status
216
+ * @return bool
217
+ */
218
+ protected function saveAmosoftStatus($itemId, $status){
219
+ $amosoftStatus = Mage::getModel('dropship/orderitems')->load($itemId, 'item_id');
220
+ $orderCollection = Mage::getModel('sales/order')->load($amosoftStatus->getItemOrderId());
221
+ $orderStatus = $orderCollection->getStatus();
222
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($amosoftStatus, ucfirst($status), $orderStatus);
223
+ if($amosoftStatus->getId()){
224
+ $amosoftStatus->setAmosoftItemStatus(ucfirst($status))
225
+ ->setUpdatedBy('amosoft')
226
+ ->setItemStatusHistory($itemStatusHistory)
227
+ ->setUpdatedAt(Mage::getModel('core/date')->gmtDate())
228
+ ->save();
229
+ Mage::helper('dropship')->genrateLog(0,'API Item Update started','API Item Update ended','Item Status updated by Amosoft API item-status->'.$status.' ,sku->'.$amosoftStatus->getSku().' ,orderId->'.$amosoftStatus->getItemOrderId());
230
+ return true;
231
+ }
232
+ }
233
+
234
+
235
+ /**
236
+ * Retrive orders by Item status
237
+ *
238
+ * @param string $orderIncrementId, string $orderStatus, int $limit
239
+ * @return bool
240
+ */
241
+ public function getAmosoftOrderByItemStatus($store_id,$orderItemStatus){
242
+
243
+ if (!$store_id) {
244
+ $this->_fault('invaild_store');
245
+ }
246
+ $orderItemStatus = (!empty($orderItemStatus)) ? $orderItemStatus : 'Transmitting';
247
+ $orderItemsdDetails = array();
248
+ try{
249
+
250
+ $orderCollection = Mage::getModel('dropship/orderitems')->getCollection();
251
+ $orderCollection->addFieldToFilter('amosoft_item_status',$orderItemStatus);
252
+ $orderCollection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
253
+ 'salesOrder.entity_id = main_table.item_order_id', array('increment_id','store_id'))->where('store_id = ?', (int)$store_id);
254
+ $orderCollection->getSelect()->group('item_order_id');
255
+
256
+ if($orderCollection->getSize() > 0){
257
+ $result['ResultCount'] = $orderCollection->count();
258
+ foreach($orderCollection as $order)
259
+ {
260
+ $result['orderDetails'][] = array('increment_id'=>$order->getIncrementId());
261
+ }
262
+ }else
263
+ $result['error_message'] = 'Result not found';
264
+
265
+
266
+ }catch (Mage_Core_Exception $e) {
267
+ $this->_fault('data_invalid', $e->getMessage());
268
+ }
269
+
270
+
271
+ return $result;
272
+ }
273
+
274
+
275
+
276
+ public function setAmosoftOrderItemStatus($orderIncrementId,$itemStatus){
277
+
278
+ $order = $this->_initOrder($orderIncrementId);
279
+ $itemId = array();
280
+ $itemOrderId = $order->getEntityId();
281
+ $result = false;
282
+ $orderCollection = Mage::getModel('dropship/orderitems')->getCollection();
283
+ $orderCollection->addFieldToFilter('amosoft_item_status','Transmitting');
284
+ $orderCollection->addFieldToFilter('item_order_id',$itemOrderId);
285
+
286
+ try{
287
+
288
+ if($orderCollection->getSize() > 0){
289
+ foreach($orderCollection as $itemDetails)
290
+ {
291
+ $itemId[] = $itemDetails->getItemId();
292
+ }
293
+
294
+ }
295
+ if(empty($itemStatus)){
296
+ $itemStatus = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_SENT_TO_SUPPLIER;
297
+ }
298
+
299
+ if(!empty($itemId) && in_array(ucfirst($itemStatus),Mage::helper('dropship')->getItemStatuses())){
300
+ foreach($itemId as $itemId){
301
+ $result = $this->saveAmosoftStatus($itemId, $itemStatus);
302
+ }
303
+ }else{
304
+ $result = false;
305
+ }
306
+ }catch (Mage_Core_Exception $e) {
307
+ $this->_fault('status_not_changed', $e->getMessage());
308
+ }
309
+ return ($result) ? array('success_message'=>'Item Status Upated Successfully') : array('error_message'=>'Error In Updating Item Status');
310
+ }
311
+
312
+ }
app/code/local/Amosoft/Dropship/Model/Order/Dropship/Api.php ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Amosoft
4
+ * @package Amosoft_Dropship
5
+ */
6
+ class Amosoft_Dropship_Model_Order_Dropship_Api extends Mage_Api_Model_Resource_Abstract
7
+ {
8
+
9
+ public function getAmosoftInvoices($ids) {
10
+
11
+ $allInvoices['flag'] = 'false';
12
+ $i = 0;
13
+ if(!empty($ids)){
14
+ foreach($ids as $key => $increment_id){
15
+ $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($increment_id);
16
+ $order = $invoice->getOrder();
17
+
18
+ $OrderIncrementid = $order->getIncrementId();
19
+ $order_created_date = $order->getCreatedAt();
20
+ if ($order->hasInvoices()) {
21
+ $invoices = $invoice->getData();
22
+ $allInvoices['flag'] = 'true';
23
+ $allInvoices['status'] = '1';
24
+ $allInvoices['invoices'][] = $invoices;
25
+ $allInvoices['invoices'][$i]['OrderIncrementid'] = $OrderIncrementid;
26
+ $allInvoices['invoices'][$i]['order_created_at'] = $order_created_date;
27
+ $i++;
28
+ }
29
+ else{
30
+ $allInvoices['status'] = '0';
31
+ $allInvoices['message'] = "No new invoice found";
32
+ }
33
+ }
34
+ }
35
+ else{
36
+ $allInvoices['status'] = '0';
37
+ $allInvoices['message'] = "No new invoice found";
38
+ }
39
+ return $allInvoices;
40
+ }
41
+
42
+ /* Load invoices using order*/
43
+ public function getAmosoftInvoices2($ids) {
44
+
45
+ $allInvoices['flag'] = 'false';
46
+ $i = 0;
47
+ foreach($ids as $key => $increment_id){
48
+
49
+ $order = Mage::getModel('sales/order')->loadByIncrementId($increment_id);
50
+ $OrderIncrementid = $order->getIncrementId();
51
+ $order_created_date = $order->getCreatedAt();
52
+ if ($order->hasgetAmosoftInvoices2Invoices()) {
53
+ foreach ($order->getInvoiceCollection() as $inv) {
54
+ $invoices = $inv->getData();
55
+ $allInvoices['flag'] = 'true';
56
+ $allInvoices['status'] = '1';
57
+ $allInvoices['invoices'][] = $invoices;
58
+ $allInvoices['invoices'][$i]['OrderIncrementid'] = $OrderIncrementid;
59
+ $allInvoices['invoices'][$i]['order_created_at'] = $order_created_date;
60
+ $i++;
61
+ }
62
+ }
63
+ else{
64
+ $allInvoices['status'] = '0';
65
+ $allInvoices['message'] = "No new invoice found";
66
+ }
67
+ }
68
+ return $allInvoices;
69
+
70
+ }
71
+
72
+ public function getAmosoftShipments($ids) {
73
+
74
+ $allShipments['flag'] = 'false';
75
+ $i = 0;
76
+ if(!empty($ids)){
77
+ foreach($ids as $key => $increment_id){
78
+ $shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($increment_id);
79
+ $order = $shipment->getOrder();
80
+
81
+ $OrderIncrementid = $order->getIncrementId();
82
+ $order_created_date = $order->getCreatedAt();
83
+ $shipmentCollection = $order->getShipmentsCollection();
84
+ if($shipmentCollection){
85
+ $shipments = $shipment->getData();
86
+ $allShipments['flag'] = 'true';
87
+ $allShipments['status'] = '1';
88
+ $allShipments['shipments'][] = $shipments;
89
+ $allShipments['shipments'][$i]['OrderIncrementid'] = $OrderIncrementid;
90
+ $allShipments['shipments'][$i]['order_created_at'] = $order_created_date;
91
+ $i++;
92
+ }
93
+ else{
94
+ $allShipments['status'] = '0';
95
+ $allShipments['message'] = "No new shipment found";
96
+ }
97
+ }
98
+ }
99
+ else{
100
+ $allShipments['status'] = '0';
101
+ $allShipments['message'] = "No new shipment found";
102
+ }
103
+ return $allShipments;
104
+ }
105
+
106
+ /* Load invoices using order*/
107
+ public function getAmosoftShipments2($ids) {
108
+
109
+ $allShipments['flag'] = 'false';
110
+ $i = 0;
111
+ foreach($ids as $key => $increment_id){
112
+
113
+ $order = Mage::getModel('sales/order')->loadByIncrementId($increment_id);
114
+ $OrderIncrementid = $order->getIncrementId();
115
+ $order_created_date = $order->getCreatedAt();
116
+
117
+ $shipmentCollection = $order->getShipmentsCollection();
118
+ if($shipmentCollection){
119
+ foreach($shipmentCollection as $shipment){
120
+ $shipments = $shipment->getData();
121
+ $allShipments['flag'] = 'true';
122
+ $allShipments['status'] = '1';
123
+ $allShipments['shipments'][] = $shipments;
124
+ $allShipments['shipments'][$i]['OrderIncrementid'] = $OrderIncrementid;
125
+ $allShipments['shipments'][$i]['order_created_at'] = $order_created_date;
126
+ $i++;
127
+ }
128
+ }
129
+ else{
130
+ $allShipments['status'] = '0';
131
+ $allShipments['message'] = "No new shipment found";
132
+ }
133
+ }
134
+ return $allShipments;
135
+ }
136
+
137
+ public function createAmosoftShipment($orderId, $comment, $importData) {
138
+
139
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
140
+
141
+ $orderShip = $order->prepareShipment(); // can take sku => qty array
142
+ $orderShip->register();
143
+ $orderShip->sendEmail();
144
+
145
+ $tracker = Mage::getModel( 'sales/order_shipment_track' );
146
+ $tracker->setShipment( $orderShip );
147
+ $tracker->setData( 'title', $importData['title'] );
148
+ $tracker->setData( 'number', $importData['number'] );
149
+ $tracker->setData( 'carrier_code', $importData['carrier_code'] );
150
+ $tracker->setData( 'order_id', $orderId );
151
+
152
+ $orderShip->addTrack($tracker);
153
+ $orderShip->save();
154
+
155
+ $order->setData('state', "complete");
156
+ $order->setStatus("complete");
157
+ $history = $order->addStatusHistoryComment($comment, false);
158
+ $history->setIsCustomerNotified(false);
159
+ $order->save();
160
+ return "complete";
161
+ }
162
+
163
+ /**
164
+ * Collect invoice tax amount
165
+ *
166
+ * @param Mage_Sales_Model_Order_Invoice $invoice
167
+ * @return Mage_Sales_Model_Order_Invoice_Total_Tax
168
+ */
169
+ public function addShippingTaxCharges($invoice_id, $shipping_cost)
170
+ {
171
+ $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoice_id);
172
+ $totalTax = 0;
173
+ $baseTotalTax = 0;
174
+ $totalHiddenTax = 0;
175
+ $baseTotalHiddenTax = 0;
176
+
177
+ $order = $invoice->getOrder();
178
+
179
+ /** @var $item Mage_Sales_Model_Order_Invoice_Item */
180
+ foreach ($invoice->getAllItems() as $item) {
181
+ $orderItem = $item->getOrderItem();
182
+ $orderItemQty = $orderItem->getQtyOrdered();
183
+
184
+ if (($orderItem->getTaxAmount() || $orderItem->getHiddenTaxAmount()) && $orderItemQty) {
185
+ if ($item->getOrderItem()->isDummy()) {
186
+ continue;
187
+ }
188
+
189
+ /**
190
+ * Resolve rounding problems
191
+ */
192
+ $tax = $orderItem->getTaxAmount() - $orderItem->getTaxInvoiced();
193
+ $baseTax = $orderItem->getBaseTaxAmount() - $orderItem->getBaseTaxInvoiced();
194
+ $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxInvoiced();
195
+ $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxInvoiced();
196
+ if (!$item->isLast()) {
197
+ $availableQty = $orderItemQty - $orderItem->getQtyInvoiced();
198
+ $tax = $invoice->roundPrice($tax / $availableQty * $item->getQty());
199
+ $baseTax = $invoice->roundPrice($baseTax / $availableQty * $item->getQty(), 'base');
200
+ $hiddenTax = $invoice->roundPrice($hiddenTax / $availableQty * $item->getQty());
201
+ $baseHiddenTax = $invoice->roundPrice($baseHiddenTax / $availableQty * $item->getQty(), 'base');
202
+ }
203
+
204
+ $item->setTaxAmount($tax);
205
+ $item->setBaseTaxAmount($baseTax);
206
+ $item->setHiddenTaxAmount($hiddenTax);
207
+ $item->setBaseHiddenTaxAmount($baseHiddenTax);
208
+
209
+ $totalTax += $tax;
210
+ $baseTotalTax += $baseTax;
211
+ $totalHiddenTax += $hiddenTax;
212
+ $baseTotalHiddenTax += $baseHiddenTax;
213
+ }
214
+ }
215
+
216
+ $totalTax += $order->getShippingTaxAmount();
217
+ $baseTotalTax += $order->getBaseShippingTaxAmount();
218
+ $totalHiddenTax += $order->getShippingHiddenTaxAmount();
219
+ $baseTotalHiddenTax += $order->getBaseShippingHiddenTaxAmount();
220
+
221
+ $invoice->setShippingTaxAmount($order->getShippingTaxAmount());
222
+ $invoice->setBaseShippingTaxAmount($order->getBaseShippingTaxAmount());
223
+ $invoice->setShippingHiddenTaxAmount($order->getShippingHiddenTaxAmount());
224
+ $invoice->setBaseShippingHiddenTaxAmount($order->getBaseShippingHiddenTaxAmount());
225
+
226
+ $allowedTax = $order->getTaxAmount() - $order->getTaxInvoiced();
227
+ $allowedBaseTax = $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced();;
228
+ $allowedHiddenTax = $order->getHiddenTaxAmount() + $order->getShippingHiddenTaxAmount()
229
+ - $order->getHiddenTaxInvoiced() - $order->getShippingHiddenTaxInvoiced();
230
+ $allowedBaseHiddenTax = $order->getBaseHiddenTaxAmount() + $order->getBaseShippingHiddenTaxAmount()
231
+ - $order->getBaseHiddenTaxInvoiced() - $order->getBaseShippingHiddenTaxInvoiced();
232
+
233
+ if ($invoice->isLast()) {
234
+ $totalTax = $allowedTax;
235
+ $baseTotalTax = $allowedBaseTax;
236
+ $totalHiddenTax = $allowedHiddenTax;
237
+ $baseTotalHiddenTax = $allowedBaseHiddenTax;
238
+ } else {
239
+ $totalTax = min($allowedTax, $totalTax);
240
+ $baseTotalTax = min($allowedBaseTax, $baseTotalTax);
241
+ $totalHiddenTax = min($allowedHiddenTax, $totalHiddenTax);
242
+ $baseTotalHiddenTax = min($allowedBaseHiddenTax, $baseTotalHiddenTax);
243
+ }
244
+
245
+ $invoice->setTaxAmount($totalTax);
246
+ $invoice->setBaseTaxAmount($baseTotalTax);
247
+ $invoice->setHiddenTaxAmount($totalHiddenTax);
248
+ $invoice->setBaseHiddenTaxAmount($baseTotalHiddenTax);
249
+ $invoice->setShippingAmount($shipping_cost);
250
+ $invoice->setBaseShippingAmount($shipping_cost);
251
+ $invoice->setGrandTotal($invoice->getGrandTotal() + $shipping_cost + $totalTax + $totalHiddenTax);
252
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $shipping_cost + $baseTotalTax + $baseTotalHiddenTax);
253
+ //$invoice->save();
254
+ return 'shipping_cost_added';
255
+ }
256
+
257
+ /**
258
+ * Add custom supplier shipping charges to each invoice
259
+ *
260
+ * @param invoice id, shipping cost
261
+ * @return response
262
+ */
263
+ public function addShippingCharges($invoice_id, $shipping_cost)
264
+ {
265
+ $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoice_id);
266
+ $order = $invoice->getOrder();
267
+
268
+ $invoice->setShippingAmount(0);
269
+ $invoice->setBaseShippingAmount(0);
270
+
271
+ $orderShippingAmount = $shipping_cost;
272
+ $baseOrderShippingAmount = $shipping_cost;
273
+ $shippingInclTax = $shipping_cost;
274
+ $baseShippingInclTax = $shipping_cost;
275
+
276
+ if ($orderShippingAmount) {
277
+ $invoice->setShippingAmount($orderShippingAmount);
278
+ $invoice->setBaseShippingAmount($baseOrderShippingAmount);
279
+ $invoice->setShippingInclTax($shippingInclTax);
280
+ $invoice->setBaseShippingInclTax($baseShippingInclTax);
281
+
282
+ $grandTotal = $invoice->getGrandTotal();
283
+ $baseGrandTotal = $invoice->getBaseGrandTotal();
284
+
285
+ /*else{
286
+ $grandTotal = $invoice->getGrandTotal() - $invoice->getOrder()->getShippingAmount();
287
+ $baseGrandTotal = $invoice->getBaseGrandTotal() - $invoice->getOrder()->getShippingAmount();
288
+ }*/
289
+
290
+ $invoice->setGrandTotal($grandTotal+$orderShippingAmount);
291
+ $invoice->setBaseGrandTotal($baseGrandTotal+$baseOrderShippingAmount);
292
+
293
+ $order->setTotalPaid($order->getTotalPaid()+$orderShippingAmount); //update total order due
294
+
295
+ //$order->setBaseTotalPaid($order->getBaseTotalPaid()+$baseGrandTotal);
296
+ //Mage::helper('dropship')->setCustomShipping($shipping_cost);
297
+ //$invoice->setCustomShipping($shipping_cost);
298
+
299
+ $invoice->save();
300
+ $order->save();
301
+ }
302
+ return 'shipping_cost_added';
303
+ }
304
+
305
+ public function getAmosoftSupplierInventory($supplier_code) {
306
+
307
+ $dataCollection = Mage::getModel('dropship/inventory');
308
+ $collection = null;
309
+ $allInventory['flag'] = 'false';
310
+ $collection = $dataCollection->getCollection()->addFieldToFilter('amosoft_vendor_code',$supplier_code);
311
+ if($collection->getSize() == 0){
312
+ $errorMsg = 'Can not import supplier inventory';
313
+ $allInventory['status'] = '1';
314
+ //$allInventory['message'] = $errorMsg;
315
+ $allInventory['data'] = $collection;
316
+ }
317
+ else{
318
+ $allInventory['status'] = '1';
319
+ $allInventory['flag'] = 'true';
320
+ //$allInventory['message'] = "Inventory sync successful";
321
+ $allInventory['data'] = $collection->getData();
322
+ }
323
+ return $allInventory;
324
+ }
325
+
326
+ public function updateAmosoftInventory($id, $request) {
327
+
328
+ $model = Mage::getModel('dropship/inventory')->load($id)->addData($request);
329
+ try {
330
+ //save the data
331
+ $model->setId($id)->save();
332
+ //show success msg
333
+ return "record updated successfully.";
334
+ } catch (Exception $e){
335
+ return $e->getMessage();
336
+ }
337
+ }
338
+
339
+ public function addSupplierToProduct($request) {
340
+
341
+ $model = Mage::getModel('dropship/inventory')->addData($request);
342
+ try {
343
+ //save the data
344
+ $model->save();
345
+ //show success msg
346
+ return "record updated successfully.";
347
+ } catch (Exception $e){
348
+ return $e->getMessage();
349
+ }
350
+ }
351
+
352
+ }
app/code/local/Amosoft/Dropship/Model/Order/Invoice.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Amosoft_Dropship_Model_Order_Invoice extends Mage_Sales_Model_Order_Invoice
3
+ {
4
+
5
+ public function __construct(){
6
+ parent::__construct();
7
+ }
8
+
9
+ /**
10
+ * Invoice totals collecting
11
+ *
12
+ * @return Mage_Sales_Model_Order_Invoice
13
+ */
14
+ public function collectTotals()
15
+ {
16
+ $order = $this->getOrder();
17
+
18
+ foreach($this->getConfig()->getTotalModels() as $model) {
19
+ if($order['shipping_method'] == "suppliershippingcostperproduct_suppliershippingcostperproduct"){
20
+ if($model->getData('code') != 'shipping'){
21
+ //Mage::log(Mage::helper('dropship')->getCustomShipping(), null, "ship.log", 1);
22
+ $model->collect($this);
23
+ }
24
+ }
25
+ else{
26
+ $model->collect($this);
27
+ }
28
+ }
29
+ return $this;
30
+ }
31
+ }
app/code/local/Amosoft/Dropship/Model/Orderitems.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Orderitems extends Mage_Core_Model_Abstract
11
+ {
12
+ protected function _construct(){
13
+ $this->_init("dropship/orderitems");
14
+ }
15
+
16
+ public function prepareOrderItemData($item){
17
+ $productSku = $item->getSku();
18
+ $ruletype = Mage::getStoreConfig( 'amosoft_sourcing/rank/ranktype' );
19
+
20
+ if ($ruletype == 'default')
21
+ $orderBy = 'ranking ASC';
22
+ else
23
+ $orderBy = 'cost ASC';
24
+
25
+ $collectionVendor = Mage::getModel( 'dropship/inventory' )->getCollection()->addFieldToFilter ( 'product_sku', $productSku );
26
+ $collectionVendor->getSelect()->joinleft( array ('amosoftRanking' => Mage::getSingleton( 'core/resource' )->getTableName( 'dropship/ranking' )), 'amosoftRanking.amosoft_vendor_code = main_table.amosoft_vendor_code', array ('*') )->where('amosoftRanking.is_dropship = "yes" and amosoftRanking.is_active = "yes"');
27
+ $collectionVendor->getSelect()->order( $orderBy );
28
+ return $collectionVendor;
29
+ }
30
+
31
+
32
+ public function isVendorCollectionAvailable()
33
+ {
34
+ if (Mage::getModel( 'dropship/inventory' )->getCollection()->count() > 0 )
35
+ return true;
36
+ else
37
+ return false;
38
+ }
39
+
40
+ public function setItemData($orderItemInstance,$status,$item,$vendorCode,$vendorCost,$vendorSku,$itemStatusHistory)
41
+ {
42
+ $orderItemInstance->setItemId( $item->getItemId () );
43
+ $orderItemInstance->setAmosoftItemStatus( $status );
44
+ $orderItemInstance->setAmosoftVendorCode( $vendorCode );
45
+ $orderItemInstance->setAmosoftVendorSku( $vendorSku );
46
+ $orderItemInstance->setVendorCost( $vendorCost );
47
+ $orderItemInstance->setItemOrderId($item->getOrderId () );
48
+ $orderItemInstance->setSku( $item->getSku() );
49
+ $orderItemInstance->setUpdatedBy('Cron');
50
+ $orderItemInstance->setUpdatedAt(now());
51
+ $orderItemInstance->setCreatedAt( Mage::getModel('core/date')->gmtDate());
52
+ $orderItemInstance->setItemStatusHistory($itemStatusHistory);
53
+ try {
54
+ $orderItemInstance->save();
55
+ } catch ( Exception $e ) {
56
+ Mage::helper('dropship')->genrateLog(0,null,null,'Section :Error In Setting order item data: '.$e->getMessage().' sku : '.$item->getSku().','.$item->getOrderId ());
57
+ echo $e->getMessage ();
58
+ }
59
+ }
60
+ public function updateAmosoftVendorInvenory($vendorCode,$productSku,$qtyInvoiced)
61
+ {
62
+ $inventory = Mage::getModel ( 'dropship/inventory' )->getCollection()
63
+ ->addFieldToFilter('amosoft_vendor_code',$vendorCode)->addFieldToFilter('product_sku',$productSku);
64
+ $filedData = $inventory->getFirstItem()->getData();
65
+ $InventoryStock = $filedData['stock'];
66
+ $finalStock = $InventoryStock - $qtyInvoiced;
67
+ $inventory->getFirstItem()->setStock( ($finalStock > 0) ? $finalStock : 0 );
68
+ try {
69
+ $inventory->getFirstItem()->save();
70
+ Mage::getModel('dropship/inventory')->_saveInventoryLog('update',array('amosoft_vendor_name'=>$filedData['amosoft_vendor_name'],'updated_by'=>'system','product_sku'=>$productSku,'amosoft_vendor_code'=>$vendorCode,'cost'=>$filedData['cost'],'stock'=>($finalStock > 0) ? $finalStock : 0));
71
+ } catch ( Exception $e ) {
72
+ echo $e->getMessage ();
73
+ }
74
+ }
75
+
76
+ public function updateSourcingByUser($request)
77
+ {
78
+ $arrData = array();
79
+ $inventoryModel = Mage::getModel('dropship/inventory')->getCollection()->addFieldToFilter('amosoft_vendor_code',$request['amosoft_vendor_code'])->addFieldToFilter('product_sku',$request['product_sku']);
80
+ $arrData['amosoft_vendor_code'] = $request['amosoft_vendor_code'];
81
+ $arrData['amosoft_item_status'] = Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_TRANSMITTING;
82
+ $arrData['updated_by'] = 'User';
83
+ $arrData['amosoft_vendor_sku'] = $inventoryModel->getFirstItem()->getAmosoftVendorSku();
84
+ $arrData['vendor_cost'] = $request['qty']*$inventoryModel->getFirstItem()->getCost();
85
+ $arrData['item_status_history'] = $request['item_status_history'];
86
+ return $arrData;
87
+ }
88
+
89
+ public function updateOrderStatus($orderId,$itemId)
90
+ {
91
+ $arrData = array();
92
+ $orderStatus = $this->_changeAllItemStatus($orderId,$itemId);
93
+ if(is_null($orderStatus))
94
+ return;
95
+ $orderCollection = Mage::getModel('sales/order')->Load($orderId);
96
+ $orderCollection->setStatus(Mage::getStoreConfig($orderStatus));
97
+ $orderCollection->addStatusToHistory(Mage::getStoreConfig($orderStatus), 'Order status and sourcing changed by user', false);
98
+ try{
99
+ $orderCollection->save();
100
+ }catch (Exception $e) {
101
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
102
+ }
103
+ return $arrData;
104
+ }
105
+
106
+ protected function _changeAllItemStatus($orderId){
107
+ $orderItemCollection = $this->getCollection()->addFieldToFilter('item_order_id',$orderId);
108
+ $orderStatus = null;
109
+ $arrItemStatus = array();
110
+ if($orderItemCollection->count() > 0){
111
+ if($orderItemCollection->count() > 1)
112
+ {
113
+ foreach($orderItemCollection as $item){
114
+ $arrItemStatus[] = $item->getAmosoftItemStatus();
115
+ }
116
+ }else{
117
+ $arrItemStatus[] = 'Transmitting';
118
+ }
119
+ }
120
+ $arrUnique = array_unique($arrItemStatus);
121
+ if(count($arrUnique) == 1){
122
+ switch($arrUnique[0]){
123
+ case 'Backorder' :
124
+ $orderStatus = 'amosoft_sourcing/order/backorder';
125
+ break;
126
+ case 'Transmitting' :
127
+ $orderStatus = 'amosoft_sourcing/order/awaiting_transmission';
128
+ break;
129
+ case 'No Dropship' :
130
+ $orderStatus = 'amosoft_sourcing/order/sourcing_complete';
131
+ break;
132
+ }
133
+ }elseif(count($arrUnique) > 1){
134
+ if(in_array('Backorder',$arrUnique))
135
+ $orderStatus = 'amosoft_sourcing/order/backorder';
136
+ else
137
+ $orderStatus = 'amosoft_sourcing/order/awaiting_transmission';
138
+ }
139
+ return $orderStatus;
140
+ }
141
+
142
+ public function setSourcingOrderStatus($data)
143
+ {
144
+ $itemStatus = array();
145
+ $itemCollection = $this->getCollection()->addFieldToFilter('item_order_id',$data['item_order_id']);
146
+ foreach($itemCollection as $items){
147
+ if($items->getItemId() != $data['item_id'])
148
+ $itemStatus[] = $items->getAmosoftItemStatus();
149
+ }
150
+ $uniqueArray = array_unique($itemStatus);
151
+ $orderCollection = Mage::getModel('sales/order')->Load($data['item_order_id']);
152
+ switch($itemStatus)
153
+ {
154
+ case (count($uniqueArray) == 1 && $uniqueArray[0] == 'Cancelled' ) ://case : when all item status are cancelled
155
+ $orderCollection->setStatus('canceled');
156
+ $orderCollection->setState('canceled');
157
+ $orderCollection->addStatusToHistory('canceled', 'Order status changed to canceled', false);
158
+
159
+ break;
160
+ case in_array('Backorder',$itemStatus) :
161
+ $orderCollection->setStatus(Mage::getStoreConfig(Amosoft_Dropship_Model_Observer::XML_PATH_AMOSOFT_ORDER_BACKORDERED));
162
+ $orderCollection->setState('processing');
163
+ $orderCollection->addStatusToHistory(Mage::getStoreConfig(Amosoft_Dropship_Model_Observer::XML_PATH_AMOSOFT_ORDER_BACKORDERED), 'Order status changed to backorder', false);
164
+ break;
165
+ case (in_array('Transmitting', $uniqueArray)) :
166
+ $orderCollection->setStatus(Mage::getStoreConfig(Amosoft_Dropship_Model_Observer::XML_PATH_AMOSOFT_ORDER_AWAITING_TRANSMISSION));
167
+ $orderCollection->setState('processing');
168
+ $orderCollection->addStatusToHistory(Mage::getStoreConfig(Amosoft_Dropship_Model_Observer::XML_PATH_AMOSOFT_ORDER_AWAITING_TRANSMISSION), 'Order status changed to transmitting', false);
169
+ break;
170
+
171
+ default :
172
+ $orderCollection->setStatus(Mage::getStoreConfig(Amosoft_Dropship_Model_Observer::XML_PATH_AMOSOFT_ORDER_SOURCING_COMPLETE));
173
+ $orderCollection->setState('processing');
174
+ $orderCollection->addStatusToHistory(Mage::getStoreConfig(Amosoft_Dropship_Model_Observer::XML_PATH_AMOSOFT_ORDER_SOURCING_COMPLETE), 'Order status changed to sourcing complete', false);
175
+ break;
176
+ }
177
+ try{
178
+ $orderCollection->save();
179
+ return true;
180
+ }catch (Exception $e) {
181
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
182
+ return false;
183
+ }
184
+ }
185
+ }
186
+
app/code/local/Amosoft/Dropship/Model/Ordersourcing.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Ordersourcing extends Mage_Core_Model_Abstract
11
+ {
12
+ protected $_pathSourcingStart = 'amosoft/sourcing_cron/start_time';
13
+ protected $_pathSourcingComp = 'amosoft/sourcing_cron/comp_time';
14
+ protected $_pathBackorderStart = 'amosoft/backorder_cron/start_time';
15
+ protected $_pathBackorderComp = 'amosoft/backorder_cron/comp_time';
16
+ protected $_waitTIme = 30; //min
17
+ protected function _construct(){
18
+ $this->_init("dropship/ordersourcing");
19
+ }
20
+ public function prepareItemCollection($crontype,$isCronSourcing = false){
21
+ $orderItemColletion = array();
22
+ $rowObj = new Varien_Object();
23
+ $condition = ($isCronSourcing) ? array($crontype,Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_SOURCING) : array($crontype);
24
+ //$orders = $this->getOrderForProcess($condition);
25
+ $processingItem = Mage::getModel('dropship/orderitems')->getCollection();
26
+ $processingItem->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id',array('state'));
27
+ $processingItem->addFieldToFilter('state','processing');
28
+ $processingItem->addFieldToFilter('amosoft_item_status',array('in'=>$condition));
29
+ if($processingItem->getSize() > 0){
30
+ foreach ($processingItem as $item){
31
+ $var = array (
32
+ 'id' => $item->getId(),
33
+ 'item_id' => $item->getItemId(),
34
+ 'item_order_id' => $item->getItemOrderId(),
35
+ 'sku' => $item->getSku(),
36
+ 'amosoft_vendor_sku' => $item->getAmosoftVendorSku(),
37
+ 'vendor_cost' => $item->getVendorCost(),
38
+ 'amosoft_item_status' => $item->getAmosoftItemStatus(),
39
+ 'amosoft_vendor_code' => $item->getAmosoftVendorCode(),
40
+ 'updated_by' => $item->getUpdatedBy(),
41
+ 'item_status_history' => $item->getItemStatusHistory(),
42
+ 'updated_at' => $item->getUpdatedAt()
43
+ );
44
+ $rowObj = new Varien_Object();
45
+ $orderItemColletion[$item->getItemOrderId()][] = $rowObj->setData($var);
46
+ }
47
+ }
48
+ return $orderItemColletion;
49
+ }
50
+ protected function getOrderForProcess($condition){
51
+ $orderIds = array();
52
+ $processingItem = Mage::getModel('dropship/orderitems')->getCollection();
53
+ $processingItem->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id',array('state'));
54
+ $processingItem->addFieldToFilter('state','processing');
55
+ $processingItem->addFieldToFilter('amosoft_item_status',array('in'=>$condition));
56
+ $processingItem->getSelect()->group('item_order_id');
57
+ //$processingItem->getSelect()->limit('200');
58
+ $processingItem->getSelect()->order('id asc');
59
+ if($processingItem->getSize() > 0){
60
+ foreach ($processingItem as $item){
61
+ $orderIds[] = $item->getItemOrderId();
62
+ }
63
+ }
64
+ return $orderIds;
65
+ }
66
+ public function checkRunningStatus($type)
67
+ {
68
+ $path = ($type == Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
69
+ if(!Mage::getStoreConfigFlag($path)){
70
+ return false;//job not running
71
+ }
72
+ $now = time() - ($this->_waitTIme * 60);
73
+ $time = strtotime(Mage::getStoreConfig($path));
74
+ /*if ($time < $now) {
75
+ return false;//insert forcefully
76
+ }*/
77
+ return true;
78
+ }
79
+ public function sourcingStarted($type){
80
+ $path = ($type == Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
81
+ $value = strftime('%Y-%m-%d %H:%M:00', time());
82
+ Mage::getResourceModel('dropship/ordersourcing')->saveConfig($path, $value);
83
+ }
84
+ public function sourcingCompleted($type){
85
+ //$path = ($type == 'backorder') ? $this->_pathBackorderComp : $this->_pathSourcingComp;
86
+ $path = ($type == Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
87
+ $value = '';//strftime('%Y-%m-%d %H:%M:00', time());
88
+ Mage::getResourceModel('dropship/ordersourcing')->saveConfig($path, $value);
89
+ }
90
+ }
app/code/local/Amosoft/Dropship/Model/Productimport.php ADDED
@@ -0,0 +1,596 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_Productimport {
9
+ protected $conn;
10
+ protected $prePopulatedAttribute = array ();
11
+ protected $catalogTable;
12
+ protected $productCategory;
13
+ protected $allowedAttribute = array('name','short_description','description','weight','price','msrp','manufacturer','action','amosoft_upc','amosoft_manufacturer_product_number');
14
+ protected $preDefineAttribute = array (
15
+ 'status' => 2,
16
+ 'visibility' => 1,
17
+ 'tax_class_id' => 0
18
+ );
19
+ protected $cachedPreDefineAttribute = array ();
20
+
21
+ /* Initialise connection and predefine attribute which will not available in REST request */
22
+ public function _init()
23
+ {
24
+ $this->catalogTable = Mage::getSingleton("core/resource")->getTableName('catalog/product');
25
+ $this->productCategory = Mage::getSingleton("core/resource")->getTableName('catalog/category_product');
26
+ foreach ( $this->preDefineAttribute as $attrname => $attrvalue ) {
27
+ $attributeInfo = $this->getAttributeInfo ( $attrname, $attrvalue );
28
+ $this->cachedPreDefineAttribute [$attrname] = array (
29
+ 'id' => $attributeInfo ['attribute_id'],
30
+ 'option_value' => $attrvalue,
31
+ 'table_name' => $attributeInfo ['table_name'],
32
+ 'type' => $attributeInfo ['type']
33
+ );
34
+ }
35
+
36
+ $this->conn = $this->getDatabaseConnection ();
37
+ return $this;
38
+ }
39
+ public function getDatabaseConnection()
40
+ {
41
+ return Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
42
+ }
43
+ public function getEntityTypeIdByCode()
44
+ {
45
+ return Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
46
+ }
47
+ public function getAttributeCodeById($entity_type, $attribute_code)
48
+ {
49
+ return Mage::getModel ( 'eav/entity_attribute' )->loadByCode ( $entity_type, $attribute_code )->getAttributeId ();
50
+ }
51
+ public function getAttributeSetCodeById()
52
+ {
53
+ return Mage::getModel ( 'catalog/product' )->getDefaultAttributeSetId ();
54
+ }
55
+
56
+ /* Function will prepare the attribute information @return associative array */
57
+ public function getAttributeInfo($name, $value)
58
+ {
59
+ $attributeInfo = array ();
60
+ $attr = Mage::getModel('eav/config')->getAttribute($this->getEntityTypeIdByCode(),$name);
61
+ $attributeInfo ['attribute_id'] = $attr->getAttributeId ();
62
+ $attributeInfo ['table_name'] = $attr->getBackendTable ();
63
+ $attributeInfo ['type'] = $attr->getBackendType ();
64
+ if ($attr->getFrontendInput () == 'select') {
65
+ if ($attr->usesSource () && !in_array($name,array('status','visibility','tax_class_id'))) {
66
+
67
+ if($attr->getSource ()->getOptionId ( $value ))
68
+ {
69
+ $attributeInfo ['option_value'] = $attr->getSource ()->getOptionId ( $value );
70
+ }
71
+ else{
72
+
73
+ $attributeInfo ['option_value'] = $this->createAttributeOption($attr->getAttributeId (),$value);
74
+ }
75
+ } else{
76
+ $attributeInfo ['option_value'] = $value;
77
+ }
78
+ }else{
79
+ $attributeInfo ['option_value'] = $value;
80
+ }
81
+ return $attributeInfo;
82
+ }
83
+
84
+
85
+ protected function createAttributeOption($attributeId,$attributeValue)
86
+ {
87
+ $optionTable = Mage::getSingleton ( 'core/resource' )->getTableName('eav/attribute_option');
88
+ $optionValueTable = Mage::getSingleton ( 'core/resource' )->getTableName('eav/attribute_option_value');
89
+ $data = array(
90
+ 'attribute_id' => $attributeId,
91
+ 'sort_order' => 0,
92
+ );
93
+ $this->conn->insert($optionTable, $data);
94
+ $intOptionId = $this->conn->lastInsertId($optionTable);
95
+ $data = array(
96
+ 'option_id' => $intOptionId,
97
+ 'store_id' => 0,
98
+ 'value' => $attributeValue,
99
+ );
100
+ $this->conn->insert($optionValueTable, $data);
101
+ return $intOptionId;
102
+ }
103
+
104
+
105
+ /* Function will insert data using Multi-insert in catalog attribute tables */
106
+ public function insertAttributeData($lastId, $data, $sku)
107
+ {
108
+ $insvalues = '';
109
+ $i = 1;
110
+
111
+ foreach ( $data as $key => $val ) {
112
+ $countVal = count ( $val );
113
+ if ($key == 'int') {
114
+ foreach ( $val as $value ) {
115
+
116
+ if ($i < $countVal)
117
+ $comma = ',';
118
+ else
119
+ $comma = '';
120
+ $insvalues .= "(" . $value ['entity_type_id'] . ',' . $value ['attribute_id'] . ',' . $value ['store_id'] . ',' . $value ['entity_id'] . ',' . $value ['value'] . ")" . $comma;
121
+ $i++;
122
+ }
123
+ $t = $this->catalogTable . '_int';
124
+ $i = 1;
125
+ $this->conn->query ( "INSERT INTO $t (entity_type_id,attribute_id,store_id,entity_id,value) VALUES " . $insvalues );
126
+ $insvalues = '';
127
+ }
128
+
129
+ if ($key == 'varchar') {
130
+ foreach ( $val as $value ) {
131
+
132
+ if ($i < $countVal)
133
+ $comma = ',';
134
+ else
135
+ $comma = '';
136
+
137
+ $insvalues .= "(" . $value ['entity_type_id'] . ',' . $value ['attribute_id'] . ',' . $value ['store_id'] . ',' . $value ['entity_id'] . ",'" . $value ['value'] . "')" . $comma;
138
+ $i++;
139
+ }
140
+ $t = $this->catalogTable . '_varchar';
141
+ $i = 1;
142
+ $this->conn->query ( "INSERT INTO $t (entity_type_id,attribute_id,store_id,entity_id,value) VALUES " . $insvalues );
143
+ $insvalues = '';
144
+ }
145
+ if ($key == 'datetime') {
146
+ foreach ( $val as $value ) {
147
+
148
+ if ($i < $countVal)
149
+ $comma = ',';
150
+ else
151
+ $comma = '';
152
+
153
+ $insvalues .= "(" . $value ['entity_type_id'] . ',' . $value ['attribute_id'] . ',' . $value ['store_id'] . ',' . $value ['entity_id'] . ",'" . $value ['value'] . "')" . $comma;
154
+ $i++;
155
+ }
156
+ $t = $this->catalogTable . '_datetime';
157
+ $i = 1;
158
+ $this->conn->query ( "INSERT INTO $t (entity_type_id,attribute_id,store_id,entity_id,value) VALUES " . $insvalues );
159
+ $insvalues = '';
160
+ }
161
+
162
+ if ($key == 'decimal') {
163
+ foreach ( $val as $value ) {
164
+
165
+ if ($i < $countVal)
166
+ $comma = ',';
167
+ else
168
+ $comma = '';
169
+
170
+ $insvalues .= "(" . $value ['entity_type_id'] . ',' . $value ['attribute_id'] . ',' . $value ['store_id'] . ',' . $value ['entity_id'] . ",'" . $value ['value'] . "')" . $comma;
171
+
172
+ $i++;
173
+ }
174
+ $t = $this->catalogTable . '_decimal';
175
+ $i = 1;
176
+ $this->conn->query ( "INSERT INTO $t (entity_type_id,attribute_id,store_id,entity_id,value) VALUES " . $insvalues );
177
+ $insvalues = '';
178
+ }
179
+ if ($key == 'text') {
180
+ foreach ( $val as $value ) {
181
+ if ($i < $countVal)
182
+ $comma = ',';
183
+ else
184
+ $comma = '';
185
+
186
+ $insvalues .= "(" . $value ['entity_type_id'] . ',' . $value ['attribute_id'] . ',' . $value ['store_id'] . ',' . $value ['entity_id'] . ",'" . $value ['value'] . "')" . $comma;
187
+
188
+ $i++;
189
+ }
190
+ $t = $this->catalogTable . '_text';
191
+ $i = 1;
192
+ $this->conn->query ( "INSERT INTO $t (entity_type_id,attribute_id,store_id,entity_id,value) VALUES " . $insvalues );
193
+ $insvalues = '';
194
+ }
195
+ }
196
+ }
197
+
198
+ protected function assignCategory($id,$lastId)
199
+ {
200
+ $arrCategory = array(
201
+ 'category_id'=> $id,
202
+ 'product_id'=> $lastId,
203
+ 'position'=> 0
204
+ );
205
+ $this->conn->insert($this->productCategory,$arrCategory);
206
+ }
207
+
208
+ /* Function will insert the predefine array in the catalog attribute tables */
209
+ protected function insertPredefineAttribute($lastId, $sku)
210
+ {
211
+ $preAttribue = array();
212
+ $this->prepareAttributeInsertQuery ( $lastId, $val, $data ['sku'] );
213
+ foreach ( $this->preDefineAttribute as $name => $value ) {
214
+ $type = $this->prePopulatedAttribute ['attribute_detail'] [$sku] [$name] ['type'];
215
+ $preAttribue [$type] [] = $this->prepareAttributeInsertQuery ( $lastId, array (
216
+ 'name' => $name,
217
+ 'value' => $value
218
+ ), $sku );
219
+ }
220
+ $this->insertAttributeData ( $lastId, $preAttribue, $sku );
221
+ }
222
+
223
+ /* function prepare the attribute data array for multi-insert */
224
+ protected function prepareAttributeInsertQuery($lastId, $data, $sku)
225
+ {
226
+ $attributeId = $this->prePopulatedAttribute ['attribute_detail'] [$sku] [$data ['name']] ['id'];
227
+ $attrValue = $this->prePopulatedAttribute ['attribute_detail'] [$sku] [$data ['name']] ['option_value'];
228
+ $type = $this->prePopulatedAttribute ['attribute_detail'] [$sku] [$data ['name']] ['type'];
229
+ $entityTypeId = $this->prePopulatedAttribute ['entity_type_id'];
230
+ $attribute = array (
231
+
232
+ 'entity_type_id' => $entityTypeId,
233
+ 'attribute_id' => $attributeId,
234
+ 'store_id' => 0,
235
+ 'entity_id' => $lastId,
236
+ 'value' => $attrValue
237
+ );
238
+ return $attribute;
239
+ }
240
+
241
+ /* Function will collect all the attribute values which will minimize the database call */
242
+ protected function initilatizeAttributeValue($productAttributeArray)
243
+ {
244
+ $arrAttribute = array ();
245
+ $arrAttribute ['attribute_set_id'] = $this->getAttributeSetCodeById ();
246
+ $arrAttribute ['entity_type_id'] = $this->getEntityTypeIdByCode ();
247
+ $arrAttribute ['attribute_detail'] = $this->prepareAttributeDetail ( $productAttributeArray );
248
+ $this->prePopulatedAttribute = $arrAttribute;
249
+ return $this->prePopulatedAttribute;
250
+ }
251
+
252
+ protected function prepareAttributeDetail($attributeData)
253
+ {
254
+ $attributeDetails = array ();
255
+ $tempvar = array ();
256
+ foreach ( $attributeData as $name ) {
257
+ foreach ( $name ['attributeData'] as $key => $val ) {
258
+ $attributeInfo = $this->getAttributeInfo ( $val ['name'], $val ['value'] );
259
+ $tempvar [$name ['sku']] [$val ['name']] = array (
260
+ 'id' => $attributeInfo ['attribute_id'],
261
+ 'option_value' => $attributeInfo ['option_value'],
262
+ 'table_name' => $attributeInfo ['table_name'],
263
+ 'type' => $attributeInfo ['type']
264
+ );
265
+ }
266
+ $attributeDetails [$name ['sku']] = array_merge ( $this->cachedPreDefineAttribute, $tempvar [$name ['sku']] );
267
+ }
268
+ return $attributeDetails;
269
+ }
270
+
271
+ /* Execution will start from here which will process data */
272
+ public function processData($restArray)
273
+ {
274
+ $result = array();
275
+ $productAttributeArray = $this->_processRequestArray ( $restArray );
276
+
277
+ foreach ( $productAttributeArray as $product => $data ) {
278
+ //validate REST API request
279
+ $attributeValidation = $this->validateAttibute($data);
280
+ if(!$attributeValidation['is_validate'] || $attributeValidation['data_invalid']){
281
+ if($attributeValidation['data_invalid'] && $attributeValidation['error'])
282
+ $comma = ',';
283
+ $result[$data ['sku']] = array('Sku Cannot Import With Attribute : '.implode(',',$attributeValidation['error']).$comma.implode(',',$attributeValidation['data_invalid']));
284
+ continue;
285
+ }
286
+ $checkSku = trim($data ['sku']);
287
+ if(empty($checkSku)){
288
+ $result[$data ['sku']] = array('Sku Can Not Be Empty');
289
+ continue;
290
+ }
291
+
292
+ if(strtolower($data['extra']['action']) != 'a' && !$this->isSkuExsist($data ['sku']) ){
293
+ $result[$data ['sku']] = array('Sku Not Exists Please Check Action Type');
294
+ }
295
+
296
+ switch (strtolower($data['extra']['action'])) {
297
+ case 'a':
298
+ if(!$this->isSkuExsist($data ['sku']))
299
+ {
300
+ if (is_array ($productAttributeArray )) {
301
+ $this->initilatizeAttributeValue ( $productAttributeArray );
302
+ } else {
303
+ return false;
304
+ }
305
+ $result[$data ['sku']] = ($this->addProduct ( $data )) ? array('Product Added Successfully'):array('Error In Creating EntityID for '.$data ['sku']);
306
+ }else
307
+ $result[$data ['sku']] = array('Sku Already Exists Please Check Action Type');
308
+ break;
309
+
310
+ case 'u':
311
+ if($this->isSkuExsist($data ['sku']))
312
+ $result[$data ['sku']] = ($this->updateProduct ( $data ['sku'], $data ['attributeData'])) ? array('Product Updated Successfully'):array('Unspecified Error While Updating Product');
313
+ else
314
+ $result[$data ['sku']] = array('Sku does not Exists Please Check Action Type');
315
+ break;
316
+
317
+ case 'd':
318
+ if($this->isSkuExsist($data ['sku']))
319
+ $result[$data ['sku']] = ($this->deleteProduct ( $data ['sku'])) ? array('Product Deleted Successfully'):array('Unspecified Error While Deleting Product');
320
+ else
321
+ $result[$data ['sku']] = array('Sku does not Exists Please Check Action Type');
322
+ break;
323
+
324
+ default:
325
+ $result[$data ['sku']] = array('Can Not Import SKU Action Type Not Supported');
326
+ }
327
+ }
328
+ return $result;
329
+ }
330
+
331
+ protected function validateAttibute($data)
332
+ {
333
+ $validate = true;
334
+ foreach($data['attributeData'] as $attrDetail)
335
+ {
336
+ $attribute[] = $attrDetail['name'];
337
+ switch (strtolower($attrDetail['name'])) {
338
+ case 'weight':
339
+ if(!is_numeric($attrDetail['value']) || $attrDetail['value'] < 0){
340
+ if($attrDetail['value'] ==""){
341
+ $validate = true;
342
+ }else{
343
+ $data_invalid[] = 'weight';
344
+ $validate = false;
345
+ }
346
+ }
347
+ break;
348
+ case 'price':
349
+ if(!is_numeric($attrDetail['value']) || $attrDetail['value'] < 0){
350
+
351
+ if($attrDetail['value'] ==""){
352
+ $validate = true;
353
+ }else{
354
+ $data_invalid[] = 'price';
355
+ $validate = false;
356
+ }
357
+
358
+ }
359
+ break;
360
+ case 'msrp':
361
+ if(!is_numeric($attrDetail['value']) || $attrDetail['value'] < 0){
362
+
363
+ if($attrDetail['value'] ==""){
364
+ $validate = true;
365
+ }else{
366
+ $data_invalid[] = 'msrp';
367
+ $validate = false;
368
+ }
369
+ }
370
+ break;
371
+ }
372
+ }
373
+ $attribute[] = key($data['extra']);
374
+ $uniqueArray = array_diff ($attribute,$this->allowedAttribute);
375
+
376
+ if(count($uniqueArray) > 0){
377
+ $validate = false;
378
+ }
379
+ return array('is_validate'=>$validate,'error'=>$uniqueArray, 'data_invalid'=>$data_invalid);
380
+ }
381
+ protected function addProduct($data)
382
+ {
383
+ $arrMultiInsertQuery = array ();
384
+ $lastId = $this->generateProductId ( $this->catalogTable, $data ['sku'] );
385
+ if ($lastId && $lastId > 0) {
386
+ foreach ( $data ['attributeData'] as $val ) {
387
+ $type = $this->prePopulatedAttribute ['attribute_detail'] [$data ['sku']] [$val ['name']] ['type'];
388
+ $arrMultiInsertQuery [$type] [] = $this->prepareAttributeInsertQuery ( $lastId, $val, $data ['sku'] );
389
+ }
390
+ $this->insertAttributeData ( $lastId, $arrMultiInsertQuery, $data ['sku'] );
391
+
392
+ $this->insertPredefineAttribute ( $lastId, $data ['sku'] );
393
+ $categoryId = (int) Mage::getStoreConfig('amosoft_sourcing/product/category');
394
+ if($categoryId)
395
+ $this->assignCategory( $categoryId,$lastId);
396
+ $this->updateProductInventory($lastId);
397
+
398
+ $isSuccess = true;
399
+ try {
400
+ // Your db manipulations here
401
+ $this->conn->commit ();
402
+ } catch ( Exception $e ) {
403
+ Mage::logException($e);
404
+ $this->conn->rollBack ();
405
+ }
406
+ } else {
407
+ $this->conn->rollBack ();
408
+ $isSuccess = false;
409
+ }
410
+
411
+ return $isSuccess;
412
+ }
413
+
414
+ /* Before insert check for SKU exsist @return boolean */
415
+ public function isSkuExsist($sku)
416
+ {
417
+ $productCollection = Mage::getModel ( 'catalog/product' );
418
+
419
+ if ($productCollection->getIdBySku ( $sku ))
420
+ return true;
421
+ else
422
+ return false;
423
+ }
424
+
425
+ public function updateProductInventory($productId)
426
+ {
427
+
428
+ $tableNameStatus = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status' );
429
+ $tableNameItem = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_item' );
430
+ $tableNameItemIdx = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status_indexer_idx' );
431
+ if($productId){
432
+ $insertStatus = 'INSERT INTO '.$tableNameStatus.'(product_id,website_id,stock_id,qty,stock_status) VALUES ('.$productId.',1,1,0,0)';
433
+ $insertItem = 'INSERT INTO '.$tableNameItem.'(product_id,stock_id,qty) VALUES ('.$productId.',1,0)';
434
+ $insertItemIdx = 'INSERT INTO '.$tableNameItemIdx.'(product_id,website_id,stock_id,qty,stock_status) VALUES ('.$productId.',1,1,0,0)';
435
+ $this->conn->query ($insertStatus);
436
+ $this->conn->query ($insertItem);
437
+ $this->conn->query ($insertItemIdx);
438
+ }
439
+ }
440
+
441
+ /* If SKU exsist than it will simply udpate product data using magento standard way */
442
+ public function updateProduct($sku, $attributes)
443
+ {
444
+ $dataAttribute = array ();
445
+ $sucees = false;
446
+ $productObject = Mage::getModel ( 'catalog/product' );
447
+ $product = $productObject->loadByAttribute ( 'sku', $sku );
448
+ foreach ( $attributes as $name => $value ) {
449
+ if($value ['name'] == 'manufacturer')
450
+ $dataAttribute[$value ['name']] = $this->checkOptionValueExists($value ['name'], $value ['value']);
451
+ else
452
+ $dataAttribute[$value ['name']] = $value ['value'];
453
+ if($value ['name'] == 'weight' && $value ['value'] == "")
454
+ unset($dataAttribute[$value ['name']]);
455
+ if($value ['name'] == 'price' && $value ['value'] == "")
456
+ unset($dataAttribute[$value ['name']]);
457
+ if($value ['name'] == 'msrp' && $value ['value'] == "")
458
+ unset($dataAttribute[$value ['name']]);
459
+ }
460
+ $product->addData($dataAttribute);
461
+ try {
462
+ $product->save ();
463
+ $sucees = true;
464
+ } catch ( Exception $e ) {
465
+ Mage::logException($e);
466
+ echo 'Exception occurred ' . $e->getMessage ();
467
+ }
468
+ return $sucees;
469
+ }
470
+
471
+ protected function checkOptionValueExists($attribute,$value)
472
+ {
473
+ $optValue = '';
474
+ if(!array_key_exists($attribute,$this->preDefineAttribute)){
475
+ $attr = Mage::getSingleton('eav/config')->getAttribute($this->getEntityTypeIdByCode(),$attribute);
476
+ if ($attr->getFrontendInput () == 'select')
477
+ $optValue = ($attr->getSource()->getOptionId($value)) ? $attr->getSource()->getOptionId($value) : $this->createAttributeOption($attr->getAttributeId (),$value);
478
+ }
479
+ return $optValue;
480
+ }
481
+
482
+ public function deleteProduct($sku)
483
+ {
484
+ $sucees = false;
485
+ $productObject = Mage::getModel ( 'catalog/product' );
486
+ $product = $productObject->loadByAttribute ( 'sku', $sku );
487
+
488
+ try {
489
+ $product->delete ();
490
+ $sucees = true;
491
+ } catch ( Exception $e ) {
492
+ Mage::logException($e);
493
+ echo 'Exception occurred ' . $e->getMessage ();
494
+ }
495
+ return $sucees;
496
+ }
497
+ /* function insert data in catalog_prodcut_entity @return entity_id */
498
+ public function generateProductId($tableName, $data)
499
+ {
500
+ $entityTypeId = $this->prePopulatedAttribute ['entity_type_id'];
501
+ $attributeSetId = $this->prePopulatedAttribute ['attribute_set_id'];
502
+ $defaultProductArr = array (
503
+
504
+ 'entity_id' => '',
505
+ 'entity_type_id' => $entityTypeId,
506
+ 'attribute_set_id' => $attributeSetId,
507
+ 'type_id' => 'simple',
508
+ 'sku' => $data,
509
+ 'has_options' => 0,
510
+ 'required_options' => 0,
511
+ 'created_at' => now (),
512
+ 'updated_at' => now ()
513
+ );
514
+ $this->conn->beginTransaction ();
515
+ $this->conn->insert ( $tableName, $defaultProductArr );
516
+ return $this->conn->lastInsertId ();
517
+ }
518
+
519
+
520
+ protected function _processRequestArray($restResquest)
521
+ {
522
+ $arrData = array ();
523
+ if (! array_key_exists ( 'sku', $restResquest ['productdata'] )) {
524
+ $arrData = $this->processMultiRequest ( $restResquest ['productdata'] );
525
+ } else {
526
+ $arrData = $this->processSingleRequest ( $restResquest ['productdata'] );
527
+ }
528
+ return $arrData;
529
+ }
530
+
531
+ protected function processMultiRequest($restRequest)
532
+ {
533
+ $arrMultiData = array ();
534
+ foreach ( $restRequest as $keys => $data ) {
535
+ $arrMultiData [$keys] ['sku'] = $data ['sku'];
536
+ foreach ( $data ['attributes'] as $key => $value ) {
537
+ if(!array_key_exists($key,$this->preDefineAttribute) ){
538
+ switch (strtolower($key)) {
539
+ case 'quantity':
540
+ $arrMultiData [$keys] ['extra'] [trim(strtolower($key))] = trim($value);
541
+ break;
542
+ case 'action':
543
+ $arrMultiData [$keys] ['extra'] [trim(strtolower($key))] = trim($value);
544
+
545
+ break;
546
+ default:
547
+ $arrMultiData [$keys] ['attributeData'] [] = array (
548
+ 'name' => trim(strtolower($key)),
549
+ 'value' => trim($value)
550
+ );
551
+ break;
552
+ }
553
+ }
554
+ }
555
+ }
556
+ return $arrMultiData;
557
+ }
558
+
559
+ protected function processSingleRequest($restRequest) {
560
+ $arrSingleData = array ();
561
+ $test = array ();
562
+ foreach ( $restRequest as $key => $data ) {
563
+ if (is_array ( $data )) {
564
+ foreach ( $data as $name => $value ) {
565
+ if(!array_key_exists($name,$this->preDefineAttribute) ){
566
+ switch (strtolower($name)) {
567
+ case 'quantity':
568
+ $arrSingleData ['extra'] [] = array (
569
+ 'name' => trim(strtolower($name)),
570
+ 'value' => trim($value)
571
+ );
572
+ break;
573
+ case 'action':
574
+ $arrSingleData ['extra'] [] = array (
575
+ 'name' => trim(strtolower($name)),
576
+ 'value' => trim($value)
577
+ );
578
+ break;
579
+ default:
580
+ $arrSingleData ['attributeData'] [] = array (
581
+ 'name' => trim(strtolower($name)),
582
+ 'value' => trim($value)
583
+ );
584
+ break;
585
+ }
586
+ }
587
+ }
588
+ } else {
589
+ $arrSingleData [$key] = $data;
590
+ }
591
+ }
592
+ return $test [] = array (
593
+ $arrSingleData
594
+ );
595
+ }
596
+ }
app/code/local/Amosoft/Dropship/Model/Ranking.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Ranking extends Mage_Core_Model_Abstract
11
+ {
12
+ protected function _construct(){
13
+
14
+ $this->_init("dropship/ranking");
15
+ }
16
+ public function rearrangeRank($value, $rank){
17
+ if($rank > 0 && $rank < $value->getRanking() ){
18
+ $rankData = Mage::getModel('dropship/ranking')->load($value->getId());
19
+ $rankData->setRanking($rank);
20
+ $rankData->save();
21
+ $rank++;
22
+ }
23
+ }
24
+ public function getVendorCollection($type)
25
+ {
26
+ $orderBy = ($type == 'yes') ? 'ranking asc':'id asc';
27
+ $vendorCollection = $this->getCollection()->addFieldToFilter('is_dropship',$type)->addFieldToFilter('is_active','yes');
28
+ $vendorCollection->getSelect()->order($orderBy);
29
+ $arrVendor = array();
30
+ if($vendorCollection->count() > 0 ){
31
+ foreach ($vendorCollection as $vendor) {
32
+ $arrVendor[] = array('name'=>$vendor->getAmosoftVendorName(),'code'=>$vendor->getAmosoftVendorCode(),'link'=>is_null($vendor->getLinkingAttribute()) ? '' : $vendor->getLinkingAttribute());
33
+ }
34
+ }
35
+ return $arrVendor;
36
+ }
37
+
38
+ public function addPreDefineVendorList(){
39
+
40
+ $preDefinedArr = array(array('MagVendID1','Supplier 1',1),array('MagVendID2','Supplier 2',2),array('MagVendID3','Supplier 3',3),array('MagVendID4','Supplier 4',4),array('MagVendID5','Supplier 5',5),array('MagVendID6','Supplier 6',6),array('MagVendID7','Supplier 7',7),array('MagVendID8','Supplier 8',8),array('MagVendID9','Supplier 9',9),array('MagVendID10','Supplier 10',10),array('MagVendID11','Supplier 11',11),array('MagVendID12','Supplier 12',12),array('MagVendID13','Supplier 13',13),array('MagVendID14','Supplier 14',14),array('MagVendID15','Supplier 15',15));
41
+
42
+ $arrRequired = array();
43
+ foreach ($preDefinedArr as $data){
44
+ $arrRequired[] = array('amosoft_vendor_code'=>$data[0] ,'amosoft_vendor_name'=>$data[1],'ranking'=>$data[2]);
45
+ }
46
+ foreach($arrRequired as $value){
47
+ $this->saveVendorDetails($value);
48
+ }
49
+ }
50
+
51
+ protected function saveVendorDetails($value){
52
+ $vendorDetail = Mage::getModel('dropship/ranking')->load($value['amosoft_vendor_code'],'amosoft_vendor_code');
53
+ if(!$vendorDetail->getId()){
54
+ $vendorDetail->setAmosoftVendorCode($value['amosoft_vendor_code']);
55
+ $vendorDetail->setAmosoftVendorName($value['amosoft_vendor_name']);
56
+ $vendorDetail->setRanking($value['ranking']);
57
+ $vendorDetail->setIsDropship('no');
58
+ $vendorDetail->setUpdatedAt(now());
59
+ $vendorDetail->setCreatedAt(now());
60
+ $vendorDetail->save();
61
+ }
62
+ }
63
+ }
64
+
app/code/local/Amosoft/Dropship/Model/Rankinglog.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Rankinglog extends Mage_Core_Model_Abstract
11
+ {
12
+ protected function _construct(){
13
+
14
+ $this->_init("dropship/Rankinglog");
15
+ }
16
+
17
+ }
18
+
app/code/local/Amosoft/Dropship/Model/Resource/Inventory.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Inventory extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init("dropship/inventory", "id");
15
+ }
16
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Inventory/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Inventory_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/inventory");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Inventorylog.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Inventorylog extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init("dropship/inventorylog", "id");
15
+ }
16
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Inventorylog/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Inventorylog_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/inventorylog");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Orderitems.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Orderitems extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init("dropship/orderitems", "id");
15
+ }
16
+ public function saveOrderItems($itemData,$orderObj,$crontype)
17
+ {
18
+ try {
19
+ $adapter = $this->_getWriteAdapter();
20
+ $adapter->beginTransaction();
21
+ foreach ($itemData as $key => $item) {
22
+ $condition = array(
23
+ 'item_id = ?' => (int) $key,
24
+ );
25
+ unset($item['updateInventory']);
26
+ unset($item['qtyInvoiced']);
27
+ $adapter->update($this->getMainTable(),$item,$condition);
28
+ }
29
+ $adapter->commit();
30
+ foreach ($itemData as $key => $item) {
31
+ if($item ['updateInventory'])
32
+ Mage::getModel ( 'dropship/orderitems' )->updateAmosoftVendorInvenory ( $item['amosoft_vendor_code'],$item['sku'], $item['qtyInvoiced']);
33
+ if ($item['amosoft_item_status'] == Amosoft_Dropship_Helper_Data::AMOSOFT_ITEM_STATUS_TRANSMITTING)
34
+ Mage::getModel('dropship/amosoft')->setupNotification();;
35
+ $this->saveOrderItemsComments($item,$orderObj);
36
+ }
37
+ } catch (Mage_Core_Exception $e) {
38
+ $adapter->rollBack();
39
+ throw $e;
40
+ } catch (Exception $e){
41
+ $adapter->rollBack();
42
+ Mage::logException($e);
43
+ Mage::helper('dropship')->genrateLog(0,null,null,'Section :Error In saving order item data: '.$e->getMessage().' for orderid : '.$orderObj->getEntityId());
44
+ Mage::getModel('dropship/ordersourcing')->sourcingCompleted($crontype);
45
+ }
46
+ }
47
+
48
+ protected function saveOrderItemsComments($itemData,$orderObj){
49
+ try {
50
+
51
+ $orderObj->addStatusHistoryComment($itemData['sku'].': Item status changed to '.$itemData['amosoft_item_status']);
52
+ $orderObj->save();
53
+ } catch (Exception $e) {
54
+ throw $e;
55
+ }
56
+
57
+ }
58
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Orderitems/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Orderitems_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/orderitems");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Ordersourcing.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Ordersourcing extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+
13
+ protected function _construct()
14
+ {
15
+ $this->_init("dropship/ordersourcing", "id");
16
+ }
17
+
18
+ public function saveConfig($path, $value, $scope = 'default', $scopeId = 0)
19
+ {
20
+ try {
21
+
22
+ $writeAdapter = $this->_getWriteAdapter();
23
+ $select = $writeAdapter->select()
24
+ ->from( $this->getTable('core/config_data'))
25
+ ->where('path = ?', $path)
26
+ ->where('scope = ?', $scope)
27
+ ->where('scope_id = ?', $scopeId);
28
+ $row = $writeAdapter->fetchRow($select);
29
+
30
+ $newData = array(
31
+ 'scope' => $scope,
32
+ 'scope_id' => $scopeId,
33
+ 'path' => $path,
34
+ 'value' => $value
35
+ );
36
+ $writeAdapter->beginTransaction();
37
+ if ($row) {
38
+ $whereCondition = array('config_id =?' => $row['config_id']);
39
+ $writeAdapter->update($this->getTable('core/config_data'), $newData, $whereCondition);
40
+ } else {
41
+ $writeAdapter->insert($this->getTable('core/config_data'), $newData);
42
+ }
43
+ $writeAdapter->commit();
44
+ } catch (Mage_Core_Exception $e) {
45
+ $writeAdapter->rollBack();
46
+ throw $e;
47
+ } catch (Exception $e){
48
+ $adapter->rollBack();
49
+ Mage::logException($e);
50
+ }
51
+ }
52
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Ordersourcing/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Ordersourcing_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/ordersourcing");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Ranking.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Ranking extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init("dropship/ranking", "id");
15
+ }
16
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Ranking/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Ranking_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/ranking");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Rankinglog.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Rankinglog extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init("dropship/rankinglog", "id");
15
+ }
16
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Rankinglog/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Rankinglog_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/rankinglog");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Setup.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Catalog entity setup
4
+ *
5
+ * @category Amosoft
6
+ * @package Amosoft_Dropship
7
+ * @author Cybage Magento Core Team
8
+ */
9
+ class Amosoft_Dropship_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
10
+ {
11
+ /**
12
+ * Prepare catalog attribute values to save
13
+ *
14
+ * @param array $attr
15
+ * @return array
16
+ */
17
+
18
+ /**
19
+ * Default entites and attributes
20
+ *
21
+ * @return array
22
+ */
23
+ public function getDefaultEntities()
24
+ {
25
+ return array(
26
+ 'catalog_product' => array(
27
+ 'entity_model' => 'catalog/product',
28
+ 'attribute_model' => 'catalog/resource_eav_attribute',
29
+ 'table' => 'catalog/product',
30
+ 'additional_attribute_table' => 'catalog/eav_attribute',
31
+ 'entity_attribute_collection' => 'catalog/product_attribute_collection',
32
+ 'attributes' => array(
33
+
34
+ 'amosoft_manufacturer_product_number' => array(
35
+ 'attribute_set' => 'Default',
36
+ 'group' => 'Amosoft',
37
+ 'type' => 'varchar',
38
+ 'label' => 'LBManufacturerProductNumber',
39
+ 'input' => 'text',
40
+ 'required' => false,
41
+ 'user_defined' => true,
42
+ 'source' => '',
43
+ 'sort_order' => 9,
44
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
45
+ 'searchable' => false,
46
+ 'used_in_product_listing' => false,
47
+ 'visible' => true,
48
+
49
+ ),
50
+ 'amosoft_upc'=> array(
51
+ 'attribute_set' => 'Default',
52
+ 'group' => 'Amosoft',
53
+ 'type' => 'varchar',
54
+ 'label' => 'LBUPC',
55
+ 'input' => 'text',
56
+ 'required' => false,
57
+ 'user_defined' => true,
58
+ 'source' => '',
59
+ 'sort_order' => 9,
60
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
61
+ 'searchable' => false,
62
+ 'used_in_product_listing' => false,
63
+ 'visible' => true,
64
+
65
+ )
66
+ )
67
+ )
68
+ );
69
+ }
70
+
71
+
72
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Uploadvendor.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Uploadvendor extends Mage_Core_Model_Mysql4_Abstract
11
+ {
12
+ protected function _construct()
13
+ {
14
+ $this->_init("dropship/uploadvendor", "file_id");
15
+ }
16
+ }
app/code/local/Amosoft/Dropship/Model/Resource/Uploadvendor/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Uploadvendor_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
11
+ {
12
+
13
+ public function _construct(){
14
+ $this->_init("dropship/uploadvendor");
15
+ }
16
+
17
+
18
+
19
+ }
20
+
app/code/local/Amosoft/Dropship/Model/Resource/Vendorimportlog.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Resource_Vendorimportlog
11
+ {
12
+ protected $_tableVendorImportLog ;
13
+ protected $conn;
14
+
15
+ public function getDatabaseConnection()
16
+ {
17
+ return Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
18
+ }
19
+
20
+ public function insertLog($amosoft_vendor_code = null,$updated_by = null,$success = 0,$failure = 0,$ftp_error =null,$ftp_error_desc = null)
21
+ {
22
+ $this->_tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log' );
23
+ $this->conn = $this->getDatabaseConnection();
24
+ $this->conn->beginTransaction ();
25
+ $created_at = now();
26
+ $insert = 'INSERT INTO '.$this->_tableVendorImportLog.'(amosoft_vendor_code,updated_by,success,failure,ftp_error,ftp_error_desc,created_at) VALUES ("'.$amosoft_vendor_code.'","'.$updated_by.'",'.$success.','.$failure.',"'.$ftp_error.'","'.$ftp_error_desc.'","'.$created_at.'")';
27
+ $this->conn->query($insert);
28
+ try {
29
+ $this->conn->commit ();
30
+ } catch ( Exception $e ) {
31
+ $this->conn->rollBack ();
32
+ Mage::log($e->getMessage(), Zend_Log::ERR);
33
+ Mage::logException($e);
34
+ echo $e->getMessage();
35
+
36
+ }
37
+ }
38
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Oudatedinventory/Email.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+ class Amosoft_Dropship_Model_System_Config_Backend_Oudatedinventory_Email extends Mage_Core_Model_Config_Data
11
+ {
12
+ const CRON_STRING_PATH = 'crontab/jobs/amosoft_oudated_product_inventory_cron/schedule/cron_expr';
13
+ const CRON_MODEL_PATH = 'crontab/jobs/amosoft_oudated_product_inventory_cron/run/model';
14
+
15
+ /**
16
+ * Cron settings after save
17
+ *
18
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
19
+ */
20
+ protected function _afterSave()
21
+ {
22
+ $enabled = $this->getData('groups/inventory_notification/fields/enabled/value');
23
+ $time = $this->getData('groups/inventory_notification/fields/cron_setting/value');
24
+ $cronExprString = '';
25
+ if ($enabled) {
26
+ if($time[0] == -2){
27
+ $cronExprArray = array(
28
+ ($time[1] == -1) ? '*' : '*/'.intval($time[1]),
29
+ '*',
30
+ '*', # Day of the Month
31
+ '*', # Month of the Year
32
+ '*', # Day of the Week
33
+ );
34
+ }else{
35
+ $cronExprArray = array(
36
+ ($time[1] == -1) ? '*' : intval($time[1]), # Minute
37
+ ($time[0] == -1) ? '*' : intval($time[0]), # Hour
38
+ '*', # Day of the Month
39
+ '*', # Month of the Year
40
+ '*', # Day of the Week
41
+ );
42
+ }
43
+ $cronExprString = join(' ', $cronExprArray);
44
+ }
45
+ try {
46
+ Mage::getModel('core/config_data')
47
+ ->load(self::CRON_STRING_PATH, 'path')
48
+ ->setValue($cronExprString)
49
+ ->setPath(self::CRON_STRING_PATH)
50
+ ->save();
51
+
52
+ Mage::getModel('core/config_data')
53
+ ->load(self::CRON_MODEL_PATH, 'path')
54
+ ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
55
+ ->setPath(self::CRON_MODEL_PATH)
56
+ ->save();
57
+ } catch (Exception $e) {
58
+ Mage::throwException(Mage::helper('adminhtml')->__('Unable to save the cron expression.'));
59
+ }
60
+ }
61
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Sourcing/Cronbackorder.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+ class Amosoft_Dropship_Model_System_Config_Backend_Sourcing_Cronbackorder extends Mage_Core_Model_Config_Data
11
+ {
12
+ const CRON_STRING_PATH = 'crontab/jobs/amosoft_backorder/schedule/cron_expr';
13
+ const CRON_MODEL_PATH = 'crontab/jobs/amosoft_backorder/run/model';
14
+
15
+ /**
16
+ * Cron settings after save
17
+ *
18
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
19
+ */
20
+ protected function _afterSave()
21
+ {
22
+ $enabled = true;
23
+ $time = $this->getData('groups/cron_settings/fields/backorder_time/value');
24
+ $cronExprString = '';
25
+ if ($enabled) {
26
+ if($time[0] == -2){
27
+ $cronExprArray = array(
28
+ ($time[1] == -1) ? '*' : '*/'.intval($time[1]),
29
+ '*',
30
+ '*', # Day of the Month
31
+ '*', # Month of the Year
32
+ '*', # Day of the Week
33
+ );
34
+ }else{
35
+ $cronExprArray = array(
36
+ ($time[1] == -1) ? '*' : intval($time[1]), # Minute
37
+ ($time[0] == -1) ? '*' : intval($time[0]), # Hour
38
+ '*', # Day of the Month
39
+ '*', # Month of the Year
40
+ '*', # Day of the Week
41
+ );
42
+ }
43
+ $cronExprString = join(' ', $cronExprArray);
44
+ try {
45
+ Mage::getModel('core/config_data')
46
+ ->load(self::CRON_STRING_PATH, 'path')
47
+ ->setValue($cronExprString)
48
+ ->setPath(self::CRON_STRING_PATH)
49
+ ->save();
50
+
51
+ Mage::getModel('core/config_data')
52
+ ->load(self::CRON_MODEL_PATH, 'path')
53
+ ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
54
+ ->setPath(self::CRON_MODEL_PATH)
55
+ ->save();
56
+ Mage::log($cronExprString, null, 'cron.log');
57
+ }
58
+ catch (Exception $e) {
59
+ Mage::throwException(Mage::helper('adminhtml')->__('Unable to save the cron expression.'));
60
+ }
61
+ }
62
+ }
63
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Sourcing/Cronsourcing.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+ class Amosoft_Dropship_Model_System_Config_Backend_Sourcing_Cronsourcing extends Mage_Core_Model_Config_Data
11
+ {
12
+ const CRON_STRING_PATH = 'crontab/jobs/amosoft_dropship/schedule/cron_expr';
13
+ const CRON_MODEL_PATH = 'crontab/jobs/amosoft_dropship/run/model';
14
+
15
+ /**
16
+ * Cron settings after save
17
+ *
18
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
19
+ */
20
+ protected function _afterSave()
21
+ {
22
+ $enabled = true;
23
+ $time = $this->getData('groups/cron_settings/fields/sourcing_time/value');
24
+ $cronExprString = '';
25
+ if ($enabled) {
26
+ if($time[0] == -2){
27
+ $cronExprArray = array(
28
+ ($time[1] == -1) ? '*' : '*/'.intval($time[1]),
29
+ '*',
30
+ '*', # Day of the Month
31
+ '*', # Month of the Year
32
+ '*', # Day of the Week
33
+ );
34
+ }else{
35
+ $cronExprArray = array(
36
+ ($time[1] == -1) ? '*' : intval($time[1]), # Minute
37
+ ($time[0] == -1) ? '*' : intval($time[0]), # Hour
38
+ '*', # Day of the Month
39
+ '*', # Month of the Year
40
+ '*', # Day of the Week
41
+ );
42
+ }
43
+ $cronExprString = join(' ', $cronExprArray);
44
+ }
45
+ try {
46
+ Mage::getModel('core/config_data')
47
+ ->load(self::CRON_STRING_PATH, 'path')
48
+ ->setValue($cronExprString)
49
+ ->setPath(self::CRON_STRING_PATH)
50
+ ->save();
51
+
52
+ Mage::getModel('core/config_data')
53
+ ->load(self::CRON_MODEL_PATH, 'path')
54
+ ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
55
+ ->setPath(self::CRON_MODEL_PATH)
56
+ ->save();
57
+ } catch (Exception $e) {
58
+ Mage::throwException(Mage::helper('adminhtml')->__('Unable to save the cron expression.'));
59
+ }
60
+ }
61
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Backend/Uploadvendor/Cron.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+ class Amosoft_Dropship_Model_System_Config_Backend_Uploadvendor_Cron extends Mage_Core_Model_Config_Data
11
+ {
12
+ const CRON_STRING_PATH = 'crontab/jobs/amosoft_uploadvendor/schedule/cron_expr';
13
+ const CRON_MODEL_PATH = 'crontab/jobs/amosoft_uploadvendor/run/model';
14
+
15
+ /**
16
+ * Cron settings after save
17
+ *
18
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
19
+ */
20
+ protected function _afterSave()
21
+ {
22
+ $enabled = $this->getData('groups/cron_settings_upload/fields/enabled/value');
23
+ $time = $this->getData('groups/cron_settings_upload/fields/time/value');
24
+ $cronExprString = '';
25
+ if ($enabled) {
26
+ if($time[0] == -2){
27
+ $cronExprArray = array(
28
+ ($time[1] == -1) ? '*' : '*/'.intval($time[1]),
29
+ '*',
30
+ '*', # Day of the Month
31
+ '*', # Month of the Year
32
+ '*', # Day of the Week
33
+ );
34
+ }else{
35
+ $cronExprArray = array(
36
+ ($time[1] == -1) ? '*' : intval($time[1]), # Minute
37
+ ($time[0] == -1) ? '*' : intval($time[0]), # Hour
38
+ '*', # Day of the Month
39
+ '*', # Month of the Year
40
+ '*', # Day of the Week
41
+ );
42
+ }
43
+ $cronExprString = join(' ', $cronExprArray);
44
+ }
45
+ try {
46
+ Mage::getModel('core/config_data')
47
+ ->load(self::CRON_STRING_PATH, 'path')
48
+ ->setValue($cronExprString)
49
+ ->setPath(self::CRON_STRING_PATH)
50
+ ->save();
51
+
52
+ Mage::getModel('core/config_data')
53
+ ->load(self::CRON_MODEL_PATH, 'path')
54
+ ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
55
+ ->setPath(self::CRON_MODEL_PATH)
56
+ ->save();
57
+ } catch (Exception $e) {
58
+ Mage::throwException(Mage::helper('adminhtml')->__('Unable to save the cron expression.'));
59
+ }
60
+ }
61
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Attributecodes.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+
11
+ class Amosoft_Dropship_Model_System_Config_Source_Attributecodes extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
12
+ {
13
+ public function getAllOptions()
14
+ {
15
+ $vendorModel = Mage::getModel('dropship/ranking')->getCollection();
16
+ $options = array();
17
+ if($vendorModel->count() > 0 ){
18
+ foreach ($vendorModel as $vendor) {
19
+ $options[] = array(
20
+ 'label' => $vendor->getAmosoftVendorName(),
21
+ 'value' => $vendor->getAmosoftVendorCode()
22
+ );
23
+ }
24
+ }
25
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--'))
26
+ );
27
+
28
+ if (!$this->_options) {
29
+ $this->_options = $options;
30
+
31
+ }
32
+
33
+ return $this->_options;
34
+ }
35
+ }
36
+
37
+
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Category.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Model_System_Config_Source_Category
10
+ {
11
+ public function toOptionArray($addEmpty = true)
12
+ {
13
+ $collection = Mage::getResourceModel('catalog/category_collection');
14
+
15
+ $collection->addAttributeToSelect('name')->load();
16
+
17
+ $options = array();
18
+
19
+
20
+ foreach ($collection as $category) {
21
+ $options[] = array(
22
+ 'label' => $category->getName(),
23
+ 'value' => $category->getId()
24
+ );
25
+ }
26
+
27
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--'))
28
+ );
29
+
30
+ return $options;
31
+ }
32
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Ediqualifier.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+ class Amosoft_Dropship_Model_System_Config_Source_Ediqualifier {
11
+
12
+
13
+ public function toOptionArray()
14
+ {
15
+ return array(
16
+ array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')),
17
+ array('value' => Mage::helper('dropship')->__('01 Duns (Dun & Bradstreet)'), 'label' => Mage::helper('dropship')->__('01 Duns (Dun & Bradstreet)')),
18
+ array('value' => Mage::helper('dropship')->__('02 SCAC (Standard Carrier Alpha Code)'), 'label' => Mage::helper('dropship')->__('02 SCAC (Standard Carrier Alpha Code)')),
19
+ array('value' => Mage::helper('dropship')->__('03 FMC (Federal Maritime Commission)'), 'label' => Mage::helper('dropship')->__('03 FMC (Federal Maritime Commission)')),
20
+ array('value' => Mage::helper('dropship')->__('04 IATA (International Air Transport Association)'), 'label' => Mage::helper('dropship')->__('04 IATA (International Air Transport Association)')),
21
+ array('value' => Mage::helper('dropship')->__('08 UCC EDI Communications ID (Comm ID)'), 'label' => Mage::helper('dropship')->__('08 UCC EDI Communications ID (Comm ID)')),
22
+ array('value' => Mage::helper('dropship')->__('09 X.121 (CCITT)'), 'label' => Mage::helper('dropship')->__('09 X.121 (CCITT)')),
23
+ array('value' => Mage::helper('dropship')->__('10 Department of Defence (DoD) Activity Address Code'), 'label' => Mage::helper('dropship')->__('10 Department of Defence (DoD) Activity Address Code')),
24
+ array('value' => Mage::helper('dropship')->__('11 DEA (Drug Enforcement Administration)'), 'label' => Mage::helper('dropship')->__('11 DEA (Drug Enforcement Administration)')),
25
+ array('value' => Mage::helper('dropship')->__('12 Phone (Telephone Companies)'), 'label' => Mage::helper('dropship')->__('12 Phone (Telephone Companies)')),
26
+ array('value' => Mage::helper('dropship')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )'), 'label' => Mage::helper('dropship')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )')),
27
+ array('value' => Mage::helper('dropship')->__('14 Duns Plus Suffix'), 'label' => Mage::helper('dropship')->__('14 Duns Plus Suffix')),
28
+ array('value' => Mage::helper('dropship')->__('15 Petroleum Accountants Society Of Canada Company Code'), 'label' => Mage::helper('dropship')->__('15 Petroleum Accountants Society Of Canada Company Code')),
29
+ array('value' => Mage::helper('dropship')->__('16 Duns Number With 4-Character Suffix'), 'label' => Mage::helper('dropship')->__('16 Duns Number With 4-Character Suffix')),
30
+ array('value' => Mage::helper('dropship')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )'), 'label' => Mage::helper('dropship')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )')),
31
+ array('value' => Mage::helper('dropship')->__('18 Association of American Railroads (AAR) Standard Distribution Code'), 'label' => Mage::helper('dropship')->__('18 Association of American Railroads (AAR) Standard Distribution Code')),
32
+ array('value' => Mage::helper('dropship')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)'), 'label' => Mage::helper('dropship')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)')),
33
+ array('value' => Mage::helper('dropship')->__('20 Health Industry Number (HIN)'), 'label' => Mage::helper('dropship')->__('20 Health Industry Number (HIN)')),
34
+ array('value' => Mage::helper('dropship')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)'), 'label' => Mage::helper('dropship')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)')),
35
+ array('value' => Mage::helper('dropship')->__('22 Federal Interagency Commision on Education, or FICE'), 'label' => Mage::helper('dropship')->__('22 Federal Interagency Commision on Education, or FICE')),
36
+ array('value' => Mage::helper('dropship')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES'), 'label' => Mage::helper('dropship')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES')),
37
+ array('value' => Mage::helper('dropship')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP'), 'label' => Mage::helper('dropship')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP')),
38
+ array('value' => Mage::helper('dropship')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT'), 'label' => Mage::helper('dropship')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT')),
39
+ array('value' => Mage::helper('dropship')->__('26 Statistics of Canada List Of Postsecondary Institutions'), 'label' => Mage::helper('dropship')->__('26 Statistics of Canada List Of Postsecondary Institutions')),
40
+ array('value' => Mage::helper('dropship')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
41
+ array('value' => Mage::helper('dropship')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)')),
42
+ array('value' => Mage::helper('dropship')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
43
+ array('value' => Mage::helper('dropship')->__('30 U.S. Federal Tax Identification Number'), 'label' => Mage::helper('dropship')->__('30 U.S. Federal Tax Identification Number')),
44
+ array('value' => Mage::helper('dropship')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)'), 'label' => Mage::helper('dropship')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)')),
45
+ array('value' => Mage::helper('dropship')->__('32 U.S. Federal Employer Identification Number (FEIN)'), 'label' => Mage::helper('dropship')->__('32 U.S. Federal Employer Identification Number (FEIN)')),
46
+ array('value' => Mage::helper('dropship')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)'), 'label' => Mage::helper('dropship')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)')),
47
+ array('value' => Mage::helper('dropship')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in Conjunction with Health Care Financing Administration (HCFA)')),
48
+ array('value' => Mage::helper('dropship')->__('35 Statistics Canada Canadian College Student Information System Institution Codes'), 'label' => Mage::helper('dropship')->__('35 Statistics Canada Canadian College Student Information System Institution Codes')),
49
+ array('value' => Mage::helper('dropship')->__('36 Statistics Canada University Student Information System Institution codes'), 'label' => Mage::helper('dropship')->__('36 Statistics Canada University Student Information System Institution codes')),
50
+ array('value' => Mage::helper('dropship')->__('37 Society of Property Information Compilers and Analysts'), 'label' => Mage::helper('dropship')->__('37 Society of Property Information Compilers and Analysts')),
51
+ array('value' => Mage::helper('dropship')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID'), 'label' => Mage::helper('dropship')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID')),
52
+ array('value' => Mage::helper('dropship')->__('NR National Retail Merchants Association (NRMA) - Assigned'), 'label' => Mage::helper('dropship')->__('NR National Retail Merchants Association (NRMA) - Assigned')),
53
+ array('value' => Mage::helper('dropship')->__('SN Standard Address Number'), 'label' => Mage::helper('dropship')->__('SN Standard Address Number')),
54
+ array('value' => Mage::helper('dropship')->__('ZZ Mutually Defined'), 'label' => Mage::helper('dropship')->__('ZZ Mutually Defined')),
55
+ );
56
+ }
57
+
58
+ public function toArray()
59
+ {
60
+ return array(
61
+ 0 => Mage::helper('adminhtml')->__('No'),
62
+ 1 => Mage::helper('adminhtml')->__('Yes'),
63
+ );
64
+ }
65
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Optionvalues.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Amosoft
6
+ *
7
+ * @category Local
8
+ * @package Amosoft_Dropship
9
+ */
10
+ class Amosoft_Dropship_Model_System_Config_Source_Optionvalues {
11
+
12
+
13
+ public function toOptionArray()
14
+ {
15
+
16
+ $optionsArray = $this->getOptionValue();
17
+ if(is_array($optionsArray)){
18
+ array_unshift($optionsArray,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')));
19
+ array_push($optionsArray,array('value' => 'addnew', 'label' => Mage::helper('dropship')->__('Add new code')));
20
+ }
21
+ else
22
+ {
23
+ $optionsArray = array(array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')),
24
+ array('value' => 'addnew', 'label' => Mage::helper('dropship')->__('Add new code')));
25
+ }
26
+ // echo '<pre>';
27
+ // print_r($optionsArray);
28
+ // die('save ememm');
29
+ return $optionsArray;
30
+
31
+ }
32
+
33
+ public function getOptionValue()
34
+ {
35
+ $integration = Mage::getStoreConfig('amosoft_integration/integration/supplier_attribute');
36
+ $amosoftCollection = Mage::getModel('dropship/supplier')->getCollection();
37
+ $attributeArray = array();
38
+ if($integration != null && $integration)
39
+ {
40
+ $attributeDetails = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $integration);
41
+ $options = $attributeDetails->getSource()->getAllOptions(false);
42
+ foreach ($options as $option) {
43
+
44
+ $attributeArray[] = array('value'=>$option["label"],'label' => Mage::helper('dropship')->__(strtolower($option["label"])));
45
+ }
46
+ }else
47
+ {
48
+ $amosoftCollection ->addFieldToFilter(array('is_update', 'verified'), array('1', '0'))->addFieldToFilter('status','')
49
+ ->addFieldToSelect(array('company_id', 'magento_vendor_code'));
50
+ $comapnyIds = $amosoftCollection->getData();
51
+ if (count($comapnyIds) > 0) {
52
+ foreach ($comapnyIds as $key=>$value) {
53
+ $attributeArray[] = array('value'=>$value['magento_vendor_code'],'label' => Mage::helper('dropship')->__(strtolower($value['magento_vendor_code'])));
54
+ }
55
+ }
56
+ }
57
+
58
+ return $attributeArray;
59
+
60
+ }
61
+ }
62
+
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Ranktype.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Model_System_Config_Source_Ranktype
10
+ {
11
+ public function toOptionArray($addEmpty = true)
12
+ {
13
+
14
+ return array(
15
+ array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')),
16
+ array('value' => 'default', 'label' => Mage::helper('dropship')->__('Ranked Based')),
17
+ array('value' => 'cost', 'label' => Mage::helper('dropship')->__('Cost Based'))
18
+
19
+ );
20
+ }
21
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Store.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_System_Config_Source_Store
9
+ {
10
+ protected $_options;
11
+
12
+
13
+ public function toOptionArray()
14
+ {
15
+ $options = array();
16
+ if (!$this->_options) {
17
+ $this->_options = Mage::getResourceModel('core/store_collection')
18
+ ->load();
19
+
20
+ foreach ($this->_options as $val){
21
+ $options[] =array(
22
+ 'label' => $val->getName().'-'.$val->getStoreId(),
23
+ 'value' => $val->getStoreId()
24
+ );
25
+ }
26
+ }
27
+
28
+ return $options;
29
+ }
30
+ }
31
+
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Time.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_System_Config_Source_Time
9
+ {
10
+ public function toOptionArray()
11
+ {
12
+ /*return array(
13
+ array(
14
+ 'value' => 'key1',
15
+ 'label' => 'Value 1',
16
+ ),
17
+ array(
18
+ 'value' => 'key2',
19
+ 'label' => 'Value 2',
20
+ ),
21
+ );*/
22
+ $j = 0;
23
+ for( $i=10;$i<=60;$i++ ) {
24
+ if($i >= $j+10 ){
25
+ $hour[$i] = str_pad($i, 2, '0', STR_PAD_LEFT);
26
+ $j = $j+10;
27
+ }
28
+
29
+ }
30
+ return $hour;
31
+
32
+ }
33
+ }
app/code/local/Amosoft/Dropship/Model/System/Config/Source/Vendorlist.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Model_System_Config_Source_Vendorlist
10
+ {
11
+ public function toOptionArray($addEmpty = true)
12
+ {
13
+ $options =array();
14
+ $collectionVendor = Mage::getModel ( 'dropship/inventory' )->getCollection ();
15
+
16
+
17
+ $collectionVendor->getSelect ()->joinleft ( array (
18
+ 'amosoftRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/ranking' )
19
+ ), 'amosoftRanking.amosoft_vendor_code = main_table.amosoft_vendor_code', array (
20
+ '*'
21
+ ) )->where('amosoftRanking.is_dropship = ?','yes');
22
+
23
+ $collectionVendor->getSelect ()->group('main_table.amosoft_vendor_code');
24
+ if($collectionVendor->count() > 0){
25
+ foreach ($collectionVendor as $vendor) {
26
+ $options[] = array(
27
+ 'label' => $vendor->getAmosoftVendorName(),
28
+ 'value' => $vendor->getAmosoftVendorCode()
29
+ );
30
+ }
31
+ }
32
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')),array('value' => 'none', 'label' => Mage::helper('dropship')->__('None')));
33
+ return $options;
34
+ }
35
+
36
+ public function vendorList($addEmpty = true,$sku)
37
+ {
38
+ $vendorModel = Mage::getModel('dropship/ranking')->getCollection();
39
+ $vendorModel->getSelect ()->where('main_table.amosoft_vendor_code not in (select amosoft_vendor_code from '.Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/inventory' ).' where product_sku = ?)',$sku);
40
+ $options = array();
41
+ if($vendorModel->count() > 0 ){
42
+ foreach ($vendorModel as $vendor) {
43
+ $options[] = array(
44
+ 'label' => $vendor->getAmosoftVendorCode().'--'.$vendor->getAmosoftVendorName(),
45
+ 'value' => $vendor->getAmosoftVendorCode()
46
+ );
47
+ }
48
+ }
49
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--'))
50
+ );
51
+ return $options;
52
+ }
53
+
54
+ public function vendorListSourcing($addEmpty = true,$sku)
55
+ {
56
+ $options =array();
57
+ $collectionVendor = Mage::getModel ( 'dropship/inventory' )->getCollection ()->addFieldToFilter('product_sku',$sku);
58
+ $collectionVendor->getSelect ()->joinleft ( array (
59
+ 'amosoftRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/ranking' )
60
+ ), 'amosoftRanking.amosoft_vendor_code = main_table.amosoft_vendor_code', array (
61
+ '*'
62
+ ) )->where('amosoftRanking.is_dropship = ?','yes');
63
+
64
+ $collectionVendor->getSelect ()->group('main_table.amosoft_vendor_code');
65
+
66
+ if($collectionVendor->count() > 0){
67
+ foreach ($collectionVendor as $vendor) {
68
+ $options[] = array(
69
+ 'label' => $vendor->getAmosoftVendorName(),
70
+ 'value' => $vendor->getAmosoftVendorCode()
71
+ );
72
+ }
73
+ }
74
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')));
75
+ return $options;
76
+ }
77
+
78
+ public function getAllVendor($addEmpty = true)
79
+ {
80
+ $options =array();
81
+ $collectionVendor = Mage::getModel ( 'dropship/ranking' )->getCollection ();
82
+
83
+ if($collectionVendor->count() > 0){
84
+ foreach ($collectionVendor as $vendor) {
85
+ $options[] = array(
86
+ 'label' => $vendor->getAmosoftVendorCode().'--'.$vendor->getAmosoftVendorName(),
87
+ 'value' => $vendor->getAmosoftVendorCode()
88
+ );
89
+ }
90
+ }
91
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship')->__('--Please Select--')));
92
+ return $options;
93
+ }
94
+ }
app/code/local/Amosoft/Dropship/Model/Uploadvendor.php ADDED
@@ -0,0 +1,1540 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Model_Uploadvendor extends Mage_Core_Model_Abstract
11
+ {
12
+
13
+ const FIELD_NAME_SOURCE_FILE = 'import_file';
14
+ protected $_isProductSetupMode = false;
15
+ protected $sendBadFileAlert = false;
16
+ protected $_haderError = array();
17
+ protected $_FtpErrors = array();
18
+ protected $_UploadCsvErrors = array();
19
+ protected $_inventoryModel;
20
+ protected $_vendorSkuFlag = array();
21
+ protected $conn;
22
+ protected $ftpRequestPram = array();
23
+ protected $_errors = array();
24
+ const XML_PATH_UPLOAD_ENABLED = 'amosoft_sourcing/cron_settings_upload/enabled';
25
+ const XML_PATH_UPLOAD_FTP_SITE = 'amosoft_sourcing/cron_settings_upload/ftp_site';
26
+ const XML_PATH_UPLOAD_FTP_USERNAME = 'amosoft_sourcing/cron_settings_upload/ftp_username';
27
+ const XML_PATH_UPLOAD_FTP_PASSWORD = 'amosoft_sourcing/cron_settings_upload/ftp_password';
28
+ const XML_PATH_UPLOAD_FTP_TYPE = 'amosoft_sourcing/cron_settings_upload/ftp_type';
29
+ const XML_PATH_UPLOAD_FTP_ACCNUMBER = 'amosoft_sourcing/cron_settings_upload/ftp_accnumber';
30
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL = 'amosoft_sourcing/inventory_notification/email';
31
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED = 'amosoft_sourcing/inventory_notification/enabled';
32
+ protected $ftpCSVFormat = array('vendor_code','vendor_sku','qty','cost');
33
+ protected $manualCSVFormat = array('vendor_sku','qty','cost');
34
+ protected $productSetupCSVFormat = array('magento_sku','vendor_sku','','');
35
+ protected $_csvDataCache;
36
+ protected $_vendorCode;
37
+ protected $_csvParserObj;
38
+ protected $emptyRecords = array(); //checkDataIntigrity fnction store empty records from CSV
39
+ protected $result = array(); //checkDataIntigrity fnction store final result for error
40
+ protected $supplierName = '';
41
+
42
+ protected function _construct()
43
+ {
44
+ $this->_inventoryModel = Mage::getModel('dropship/inventory');
45
+ $this->conn = $this->getDatabaseConnection ();
46
+ $this->_init("dropship/uploadvendor");
47
+ $this->_csvParserObj = Mage::getModel('dropship/csvparser');
48
+
49
+ }
50
+
51
+ public function getDatabaseConnection()
52
+ {
53
+ return Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
54
+ }
55
+
56
+ protected function _getSession()
57
+ {
58
+ return Mage::getSingleton('adminhtml/session');
59
+ }
60
+
61
+ protected function _getCsvData($fileName,$header = false)
62
+ {
63
+ $csvObject = new Varien_File_Csv();
64
+
65
+ if(!$this->_csvDataCache){
66
+ $this->_csvDataCache = $this->_csvParserObj->getChangedValue($csvObject->getData($fileName),$this->_vendorCode);
67
+ }else
68
+ {
69
+ if($header){
70
+ return array($this->_csvDataCache[0]);
71
+ }else
72
+ {
73
+ $this->_csvDataCache;
74
+ }
75
+ }
76
+ return $this->_csvDataCache;
77
+ }
78
+
79
+
80
+
81
+ /**
82
+ * Import working directory
83
+ *
84
+ * @return string
85
+ */
86
+
87
+ public static function getWorkingDir()
88
+ {
89
+ return Mage::getBaseDir('var') . DS . 'amosoftvendorproduct' . DS;
90
+ }
91
+
92
+ public function insertCronEntry($filename,$data = null){
93
+
94
+ $this->setFileName($filename);
95
+ $this->setUpdatedBy('manually');
96
+ $this->setUpdatedAt(now());
97
+ $this->setAmosoftVendorCode(Mage::app()->getRequest()->getPost('vendor'));
98
+ try{
99
+ $this->save();
100
+ }catch(Exception $e){
101
+ $this->_getSession()->addError(Mage::helper('dropship')->__($e->getMessage()));
102
+ }
103
+ }
104
+
105
+ public function uploadSource()
106
+ {
107
+ $error = false;
108
+ $this->_vendorCode = $this->getVendor();
109
+ $this->_isProductSetupMode = $this->getProductsetupmode();
110
+ $entity = 'vendor_product_'.date('ymdHis');
111
+ $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);
112
+ $uploader->skipDbProcessing(true);
113
+ $result = $uploader->save(self::getWorkingDir());
114
+ $extension = pathinfo($result['file'], PATHINFO_EXTENSION);
115
+ $uploadedFile = $result['path'] . $result['file'];
116
+ $error = $this->validateCsv($uploadedFile);
117
+ if($error){
118
+ $this->fileObj()->rm($uploadedFile);
119
+ $this->_getSession()->addNotice(Mage::helper('dropship')->__('Please fix errors and re-upload file'));
120
+ return $error;
121
+ }
122
+
123
+ $sourceFile = self::getWorkingDir() . $entity;
124
+
125
+ $sourceFile .= '.' . strtolower($extension);
126
+ $fileName = $entity.'.'.strtolower($extension);
127
+
128
+ if(strtolower($uploadedFile) != strtolower($sourceFile)) {
129
+ if (file_exists($sourceFile)) {
130
+ $this->fileObj()->rm($sourceFile);
131
+ }
132
+
133
+ if (!@rename($uploadedFile, $sourceFile)) {
134
+ Mage::throwException(Mage::helper('importexport')->__('Source file moving failed'));
135
+ }
136
+ }
137
+ Mage::register('file_name',$fileName);
138
+ if(!$error)
139
+ $this->insertCronEntry($fileName);
140
+
141
+ return $error;
142
+ }
143
+
144
+
145
+ public function validateCsv($fileName)
146
+ {
147
+ //$fileName
148
+ $isError = false;
149
+ $csvData = $this->_getCsvData($fileName,true);
150
+
151
+ /** checks columns */
152
+
153
+ if($this->validateCsvHeader($csvData)){
154
+ $isError = false;
155
+ }else{
156
+ $this->_getSession()->addError(Mage::helper('dropship')->__('CSV header %s is invalid ',implode(',',$this->_haderError)));
157
+ $isError = true;
158
+ $this->_csvDataCache = array();
159
+ }
160
+ return $isError;
161
+ }
162
+
163
+ protected function validateCsvHeader($csvData,$isFtp = false)
164
+ {
165
+ $result = true;
166
+ if(empty($csvData))
167
+ {
168
+ return false;
169
+ }
170
+ if ($this->_isProductSetupMode && !$isFtp ){
171
+ $csvFields = $this->productSetupCSVFormat;
172
+ }else{
173
+ $csvFields = (!$isFtp) ? $this->manualCSVFormat : $this->ftpCSVFormat;
174
+ }
175
+ $cvsDataNum = count($csvData[0]);
176
+
177
+ if(!$this->validateManualCsvHeader($cvsDataNum,$csvData,$isFtp))
178
+ return false;
179
+ if(!$this->validateFtpCsvHeader($cvsDataNum,$csvData))
180
+ return false;
181
+ if(!$this->validateProductSetupCsvHeader($cvsDataNum,$csvData))
182
+ return false;
183
+ for ($i = 0; $i < $cvsDataNum; $i++) {
184
+ if( $isFtp && ($csvData[0][0] == 'vendor_code' || $csvData[0][0] == 'vendor_sku')){
185
+ continue;
186
+ }
187
+ if($csvData[0][$i] == $csvFields[$i]){
188
+ continue;
189
+ }else{
190
+ (!$isFtp) ? $this->_haderError[] = $csvData[0][$i] : '';
191
+ $result = false;
192
+ }
193
+ }
194
+ return $result;
195
+ }
196
+
197
+ protected function validateManualCsvHeader($cvsDataNum,$csvData,$isFtp)
198
+ {
199
+ if(!$isFtp && !$this->_isProductSetupMode ){
200
+ if($cvsDataNum != 3){
201
+ foreach ($csvData[0] as $val){
202
+ if(!in_array($val,array('vendor_sku','cost','qty')))
203
+ {
204
+ $this->_haderError[] = $val;
205
+ }
206
+ }
207
+ return false;
208
+ }
209
+ }
210
+ return true;
211
+ }
212
+ protected function validateFtpCsvHeader($cvsDataNum,$csvData)
213
+ {
214
+ $validation = true;
215
+ if($cvsDataNum == 3 || $cvsDataNum == 4){
216
+ foreach ($csvData[0] as $val){
217
+ if(!in_array($val,($cvsDataNum == 3) ? array('vendor_sku','qty', 'cost') : array('vendor_code','vendor_sku','qty', 'cost'))){
218
+ $this->_haderError[] = $val;
219
+ $validation = false;
220
+ }
221
+ }
222
+ return $validation;
223
+ }
224
+ return true;
225
+ }
226
+ protected function validateProductSetupCsvHeader($cvsDataNum,$csvData)
227
+ {
228
+ if($this->_isProductSetupMode ){
229
+ if($cvsDataNum != 2){
230
+ foreach ($csvData[0] as $val){
231
+ if(!in_array($val,array('vendor_sku','magento_sku')))
232
+ {
233
+ $this->_haderError[] = $val;
234
+ }
235
+ }
236
+ return false;
237
+ }
238
+ }
239
+ return true;
240
+ }
241
+ protected function checkDataIntigrity($csvData,$isFtp = false){
242
+
243
+ //patch for FTP backward compatibility header
244
+ (count($csvData[0]) <= 3) ? array_unshift($csvData[0], "") : $csvData[0];
245
+ foreach($csvData as $row => $csvRowData)
246
+ {
247
+ if($row == 0)
248
+ continue;
249
+ if(!$this->_isProductSetupMode && !$isFtp){
250
+ array_unshift($csvRowData, "");
251
+ }
252
+ //patch for FTP backward compatibility data
253
+ if($isFtp)
254
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
255
+ $this->getErrorRowNumber($csvRowData,$row);
256
+ }
257
+ $this->generateMsg($isFtp,$this->result,$this->emptyRecords);
258
+ return in_array(true,$this->result) ? true : false;
259
+ }
260
+ protected function getErrorRowNumber($csvRowData,$row)
261
+ {
262
+
263
+ foreach($csvRowData as $key => $data){
264
+ $data = trim($data);
265
+ switch($key){
266
+ case is_numeric($key) ? 0 : 'magento_sku' :
267
+ if($this->_isProductSetupMode){
268
+ if(empty($data)){
269
+ $this->emptyRecords['magento_sku'][] = $row;
270
+ $this->result[] = true;
271
+ } else {
272
+ $this->result[] = false;
273
+ }
274
+ }else{
275
+ continue;
276
+ }
277
+ break;
278
+ case is_numeric($key) ? 1 : 'vendor_sku':
279
+ if(empty($data)){
280
+ $this->emptyRecords['vendor_sku'][] = $row;
281
+ $this->result[] = true;
282
+ }
283
+ else
284
+ $this->result[] = false;
285
+ break;
286
+ case is_numeric($key) ? 2 : 'qty':
287
+ if(!is_numeric($data) || $data < 0 )
288
+ {
289
+ if($data!=""){
290
+ $this->emptyRecords['qty'][] = $row;
291
+ $this->result[] = true;
292
+ }
293
+ }
294
+ else
295
+ $this->result[] = false;
296
+ break;
297
+ case is_numeric($key) ? 3 : 'cost':
298
+ if(!is_numeric($data) || $data < 0 ){
299
+ if($data!=""){
300
+ $this->emptyRecords['cost'][] = $row;
301
+ $this->result[] = true;
302
+ }
303
+ }
304
+ else
305
+ $this->result[] = false;
306
+ break;
307
+ }
308
+ }
309
+ return;
310
+ }
311
+ protected function generateMsg($isFtp,$result,$emptyRecords){
312
+
313
+ $error = in_array(true,$result) ? true : false;
314
+ if($error){
315
+ foreach($emptyRecords as $key=>$value){
316
+ if($this->_isProductSetupMode){
317
+ if($key == 'magento_sku'){
318
+ $string = implode(';',$value);
319
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_magento_sku','value'=>$string);
320
+ }
321
+ }
322
+ if($key == 'vendor_sku'){
323
+ $string = implode(';',$value);
324
+ if($isFtp){
325
+ $this->_FtpErrors[] = array('error_type'=>'row_vendor_sku','value'=>$string);
326
+ $this->sendBadFileAlert = true;
327
+ }else{
328
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_vendor_sku','value'=>$string);
329
+ }
330
+ }
331
+ if($key == 'qty'){
332
+ $string = implode(';',$value);
333
+ if($isFtp){
334
+ $this->_FtpErrors[] = array('error_type'=>'row_qty','value'=>$string);
335
+ $this->sendBadFileAlert = true;
336
+ }else{
337
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_qty','value'=>$string);
338
+ }
339
+ }
340
+ if($key == 'cost'){
341
+ $string = implode(';',$value);
342
+ if($isFtp){
343
+ $this->_FtpErrors[] = array('error_type'=>'row_cost','value'=>$string);
344
+ $this->sendBadFileAlert = true;
345
+ }else{
346
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_cost','value'=>$string);
347
+ }
348
+ }
349
+ }
350
+ }
351
+ return ;
352
+ }
353
+
354
+ protected function getConfigValue($path)
355
+ {
356
+ return Mage::getStoreConfig($path);
357
+ }
358
+ public function getMagentoSku($vendorCode,$vendorSku){
359
+ $sku = '';
360
+ $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$vendorCode)->addFieldTofilter('amosoft_vendor_sku',$vendorSku);
361
+ if($vendorCollection->count() > 0)
362
+ {
363
+ $sku = $vendorCollection->getFirstItem()->getProductSku();
364
+ }
365
+ return $sku;
366
+ }
367
+
368
+ /* parse uploaded csv file */
369
+ public function parseCsv($fileName = null,$amosoft_vendor_code = null)
370
+ {
371
+ $records = array();
372
+ $success = array();
373
+ $failure = array();
374
+ $counter = 0;
375
+ $foramterroroutput = array();
376
+ $this->_csvDataCache = array();
377
+ $this->_vendorCode = $amosoft_vendor_code;
378
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log' );
379
+ $csvData = $this->_getCsvData(self::getWorkingDir().$fileName);
380
+
381
+ if(count($csvData) <= 1 && Mage::getModel('dropship/csvparser')->isCsvFileEmpty())
382
+ {
383
+ $failure[$fileName] = 'Sorry,we cant find the record to update inventory';
384
+ $this->_UploadCsvErrors[] = array('error_type'=>'empty_file','value'=>'Sorry,we cant find the record to update inventory');
385
+ }
386
+
387
+ $records = Mage::getModel('dropship/csvparser')->generateManualCsvRow($csvData,$this->_isProductSetupMode,$amosoft_vendor_code);
388
+
389
+ Mage::helper('dropship')->turnOnReadUncommittedMode(); // dirty read patch
390
+ //$this->conn->beginTransaction ();
391
+ if(is_array($records) && !empty($records)){
392
+ $requestData = array_chunk($records, 1, true);
393
+
394
+ foreach($requestData as $dataArr){
395
+ foreach($dataArr as $data){
396
+ if($this->_isProductSetupMode){
397
+ $result[] = $this->validateProductSetupMode($data);
398
+ }else{
399
+ $result[] = $this->validateCsvData($data);
400
+ }
401
+ }
402
+ }
403
+ foreach($result as $successOrfail){
404
+ if($successOrfail['success']!="")
405
+ $success[] = $successOrfail['success'];
406
+ if($successOrfail['failure']!="")
407
+ $failure[] = $successOrfail['failure'];
408
+ }
409
+ try{
410
+ $updateFileStatus = Mage::getModel('dropship/uploadvendor')->load($fileName,'file_name');
411
+ $updateFileStatus->setImportStatus('done');
412
+ $updateFileStatus->save();
413
+ }catch(Exception $e){
414
+ echo $e->getMessage();
415
+ $this->_errors[] = $e->getMessage();
416
+ $this->_errors[] = $e->getTrace();
417
+ Mage::log($e->getMessage(), Zend_Log::ERR);
418
+ Mage::logException($e);
419
+ }
420
+ $this->checkDataIntigrity($csvData);
421
+ }
422
+ $finalResultCounter = (!$this->_isProductSetupMode) ? $this->logForUnprocessedRows($amosoft_vendor_code) : 0;
423
+
424
+ if(is_array($finalResultCounter))
425
+ {
426
+ $failed = count($failure)+$finalResultCounter['failure'];
427
+ $success = count($success)+$finalResultCounter['success'];
428
+ }else
429
+ {
430
+ $failed = count($failure)+$finalResultCounter;
431
+ $success = count($success)+$finalResultCounter;
432
+ }
433
+
434
+ $ftp_err = ($failed > 0) ? 'Missing/Bad Data' : '';
435
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(amosoft_vendor_code,updated_by,success,failure,ftp_error,created_at) VALUES ("'.$amosoft_vendor_code.'","'.Mage::getSingleton('admin/session')->getUser()->getUsername().'",'.$success.','.$failed.',"'.$ftp_err.'","'.now().'")';
436
+ $this->conn->beginTransaction ();
437
+ $this->conn->query($insert);
438
+ $entityId = $this->conn->lastInsertId($tableVendorImportLog);
439
+ try {
440
+ $this->conn->commit ();
441
+ $this->prepareInsertAndExeQuery($this->_UploadCsvErrors,$entityId);
442
+ $file = self::getWorkingDir() . $fileName;
443
+ $this->fileObj()->rm($file);
444
+ } catch ( Exception $e ) {
445
+ $this->conn->rollBack ();
446
+ $this->_errors[] = $e->getMessage();
447
+ $this->_errors[] = $e->getTrace();
448
+ Mage::log($e->getMessage(), Zend_Log::ERR);
449
+ Mage::logException($e);
450
+ echo $e->getMessage();
451
+
452
+ }
453
+ $this->_csvParserObj->emptyTable();
454
+ $this->_csvDataCache = array();
455
+ $this->_vendorSkuFlag = array();
456
+ Mage::helper('dropship')->turnOnReadCommittedMode(); //restore to orignal trasectional level
457
+ return $this;
458
+ }
459
+
460
+
461
+ protected function chekDuplicateCombination($data)
462
+ {
463
+ $result = true;
464
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('amosoft_vendor_sku',$data['vendor_sku']);
465
+ if($collection->count() > 0){
466
+ $existing_product_sku = $collection->getFirstItem()->getProductSku();
467
+ if(!empty($existing_product_sku)){
468
+ if($data['magento_sku'] != $existing_product_sku){
469
+ $result = false;
470
+ }
471
+ }
472
+ }
473
+ $inventoryCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('product_sku',$data['magento_sku']);
474
+ if($inventoryCollection->getSize() > 0){
475
+ $inventoryCollection = $inventoryCollection->getData();
476
+ $inventoryCollection = $inventoryCollection[0];
477
+ $existing_vendor_sku = $inventoryCollection['amosoft_vendor_sku'];
478
+ if($existing_vendor_sku != trim($data['vendor_sku']))
479
+ {
480
+ $result = false;
481
+ }
482
+ }
483
+ return $result;
484
+ }
485
+
486
+ protected function _prepareCollection()
487
+ {
488
+ $collection = $this->getCollection()->addFieldToFilter('import_status','pending');
489
+ $collection->getSelect()->limit(1);
490
+ return $collection;
491
+ }
492
+
493
+ protected function calculateProductQty($data){
494
+ $qty = 0;
495
+ $configBuffer = 0;
496
+ if(!is_numeric($data['qty']) || $data['qty'] < 0){
497
+ return array('final_qty'=> .999999999,'upload_qty'=> .999999999); // apply patch for accept empty qty row from CSV
498
+ }
499
+ $buffer = Mage::getStoreConfig('amosoft_sourcing/inventory/buffer');
500
+ $collection = $this->_inventoryModel->getCollection()->addFieldToFilter('product_sku',$data['magento_sku']);
501
+ if($collection->count() > 0){
502
+ foreach($collection as $qtyData){
503
+ if($data['amosoft_vendor_code'] != $qtyData->getAmosoftVendorCode() )
504
+ $qty += $qtyData->getStock();
505
+ }
506
+ }
507
+
508
+ if($data['qty'] <= 0){
509
+ $rQty = 0;
510
+ }else{
511
+ $rQty = $data['qty'];
512
+ }
513
+
514
+ if(!empty($buffer) && $buffer >= 0){
515
+ $configBuffer = $buffer;
516
+ }else{
517
+ $configBuffer = 0;
518
+ }
519
+
520
+ $uploadQty = $rQty - $configBuffer;
521
+ $finalUploadQty = ($uploadQty >= 0) ? $uploadQty : 0;
522
+ $finalQty = $qty+$finalUploadQty;
523
+ return array('final_qty'=> ($finalQty >= 0) ? $finalQty : 0,'upload_qty'=> $finalUploadQty);
524
+ }
525
+ protected function vendorProductInsert($data)
526
+ {
527
+ $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/inventory' );
528
+ $inventoryCollectionResult = $this->getInventoryCollection($data);
529
+ $qtyArray = $this->calculateProductQty($data);
530
+
531
+ switch($inventoryCollectionResult['operationType'])
532
+ {
533
+ case 'update':
534
+ $productId = Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']));
535
+ if($productId){
536
+
537
+ $update = $this->_prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,false);
538
+
539
+ try {
540
+ if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
541
+ {
542
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
543
+ return false;
544
+ }
545
+ if($update){
546
+ $this->conn->beginTransaction ();
547
+ $this->conn->query($update);
548
+ $this->conn->commit ();
549
+ }
550
+ return true;
551
+ } catch ( Exception $e ) {
552
+ $this->conn->rollBack ();
553
+ $this->_errors[] = $e->getMessage();
554
+ $this->_errors[] = $e->getTrace();
555
+ Mage::log($e->getMessage(), Zend_Log::ERR);
556
+ Mage::logException($e);
557
+ echo $e->getMessage();
558
+ }
559
+
560
+ }else
561
+ {
562
+ $this->_UploadCsvErrors[] = array('error_type'=>'magento_sku_exists','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
563
+ return false;
564
+ }
565
+ break;
566
+ case 'productsetup' :
567
+ $productId = Mage::getModel('catalog/product')->getIdBySku($data['magento_sku']);
568
+ if($productId){
569
+ $qtyInsert = $qtyArray['upload_qty'];
570
+ $costInsert = $data['cost'];
571
+ $insert = 'INSERT INTO '.$tableVendorInventory.' (amosoft_vendor_code,amosoft_vendor_name,product_sku,amosoft_vendor_sku,stock,cost,created_at,updated_at) VALUES ("'.$data['amosoft_vendor_code'].'","'.$this->getVendorName($data['amosoft_vendor_code']).'","'.$data['magento_sku'].'","'.$data['vendor_sku'].'",'.$qtyInsert.','.$costInsert.',"'.now().'","'.now().'")';
572
+ try {
573
+ if(!$this->updateProductInventory($data['magento_sku'],$qtyArray['final_qty']))
574
+ {
575
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_add_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
576
+ return false;
577
+ }
578
+ $this->conn->beginTransaction ();
579
+ $this->conn->query($insert);
580
+ $this->conn->commit ();
581
+ return true;
582
+ } catch ( Exception $e ) {
583
+ $this->conn->rollBack ();
584
+ $this->_errors[] = $e->getMessage();
585
+ $this->_errors[] = $e->getTrace();
586
+ Mage::log($e->getMessage(), Zend_Log::ERR);
587
+ Mage::logException($e);
588
+ echo $e->getMessage();
589
+ }
590
+ }
591
+ break;
592
+ case 'addnotallowed':
593
+
594
+ //$this->_UploadCsvErrors['general_error'][] = 'Add error: Cannot create new entry for vendor sku <b>' .$data['vendor_sku'].'</b>';
595
+ return false;
596
+ break;
597
+ }
598
+ return true;
599
+
600
+ }
601
+
602
+ protected function _prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,$isFtp)
603
+ {
604
+ $update;
605
+ (!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="") ? $costUpdate = '' : $costUpdate = 'cost ='. $data['cost'] . ',';
606
+ ($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" ) ? $qtyUpdate = '' : $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
607
+ if(!$isFtp){
608
+ ($costUpdate=='' && $qtyUpdate =='' && !$this->_isProductSetupMode) ? $timeUpdate = "" : $timeUpdate = ' updated_at = "'.now(). '",';
609
+ $vSkuUpdate = ' amosoft_vendor_sku = "'.$data['vendor_sku']. '"';
610
+ $update = 'update '.$tableVendorInventory.' set '.$costUpdate.$qtyUpdate.$timeUpdate.$vSkuUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
611
+ }else
612
+ {
613
+ if(trim($data['qty'])!='' || trim($data['cost']) !='')
614
+ $update = 'update '.$tableVendorInventory.' set '.$costUpdate. $qtyUpdate.' updated_at = "'.now().'" where id = '.$inventoryCollectionResult['vendor_id'];
615
+ }
616
+ return $update;
617
+ }
618
+ protected function getInventoryLogQuery($data,$type,$qty,$updateBy=null,$ignoreData)
619
+ {
620
+ if(count($ignoreData)>0){
621
+ if($type=='update'){
622
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Updated, Qty Ignored' : '';
623
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Updated, Cost Ignored' : '';
624
+ }else{
625
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Added, Qty Ignored' : '';
626
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Added, Cost Ignored' : '';
627
+ }
628
+ if(count($ignoreData)==2){
629
+ $type = 'ignore';
630
+ }
631
+ }
632
+ if($qty==0.999999999)
633
+ $qty = 0;
634
+ $vendorRankModel = Mage::getModel('dropship/ranking')->load($data['amosoft_vendor_code'],'amosoft_vendor_code');
635
+ $vendorName = $vendorRankModel->getAmosoftVendorName();
636
+
637
+ $tableName = Mage::getSingleton("core/resource")->getTableName('dropship/inventorylog');
638
+ if(!$updateBy){
639
+ $updateBy = Mage::getSingleton('admin/session')->getUser()->getUsername();
640
+ }
641
+ if(isset($data["pucost"]) && isset($data["puqty"])){
642
+ $data['cost']= $data["pucost"];
643
+ $qty = $data["puqty"];
644
+ }
645
+ if(isset($data["pucost"]) && isset($data["puqty"])){
646
+ $data['cost']= $data["pucost"];
647
+ $qty = $data["puqty"];
648
+ }
649
+ return 'INSERT INTO '.$tableName.' (amosoft_vendor_code,amosoft_vendor_name,product_sku,cost,stock,updated_by,activity,updated_at,created_at) VALUES ("'.$data['amosoft_vendor_code'].'","'.$vendorName.'","'.$data['magento_sku'].'","'.$data['cost'].'","'.$qty.'","'.$updateBy.'","'.$type.'","'.now().'","'.now().'")';
650
+ }
651
+
652
+ protected function getInventoryCollection($data,$isFtp = false,$log = false)
653
+ {
654
+ $spacesTrimmedSku = $this->getTrimmedSku();
655
+ $searchedSku = array_search(trim($data['vendor_sku']), $spacesTrimmedSku);
656
+ $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('amosoft_vendor_sku',trim($data['vendor_sku']));
657
+ if(isset($data['operationType'])){
658
+ if($this->_isProductSetupMode && $data['operationType'] == 'update'){
659
+ if($data['operationType'] == 'update')
660
+ $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('product_sku',trim($data['magento_sku']));
661
+ }
662
+ }
663
+ if($searchedSku){
664
+ $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('amosoft_vendor_sku',$searchedSku);
665
+ }
666
+ if($vendorCollection->getSize() > 0 || (isset($data['operationType']) && $data['operationType']=="update")){
667
+ $result = array('operationType'=> 'update','vendor_id'=>$vendorCollection->getFirstItem ()->getId(),'magento_sku'=>$vendorCollection->getFirstItem ()->getProductSku());
668
+ $data['magento_sku'] = $vendorCollection->getFirstItem ()->getProductSku();
669
+ }else{
670
+ if($log){
671
+ $isDuplicate = false;
672
+ if(in_array($data['vendor_sku'],$this->_vendorSkuFlag)){
673
+ $isDuplicate = true;
674
+ }
675
+ else{
676
+ $this->_vendorSkuFlag[] = $data['vendor_sku'];
677
+ }
678
+ if($isDuplicate){
679
+ $result = array('operationType'=> 'ignore','vendor_id'=>'');
680
+ }else{
681
+ $result = ($this->_isProductSetupMode) ? array('operationType'=> 'productsetup','vendor_id'=>'','magento_sku'=>$data['magento_sku']) :
682
+ array('operationType'=> 'addnotallowed','vendor_id'=>'','magento_sku'=>null);
683
+ }
684
+ }else{
685
+ $result = ($this->_isProductSetupMode) ? array('operationType'=> 'productsetup','vendor_id'=>'','magento_sku'=>$data['magento_sku']) :
686
+ array('operationType'=> 'addnotallowed','vendor_id'=>'','magento_sku'=>null);
687
+ }
688
+ }
689
+ return $result;
690
+ }
691
+
692
+ protected function updateProductInventory($sku,$qty)
693
+ {
694
+ if($qty == .999999999){
695
+ return true;
696
+ }
697
+ $productId = Mage::getModel('catalog/product')->getIdBySku($sku);
698
+ if($productId){
699
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
700
+ if (!$stockItem->getId()) {
701
+ $stockItem->setData('product_id', $productId);
702
+ $stockItem->setData('stock_id', 1);
703
+ }
704
+
705
+ if ($stockItem->getQty() != $qty) {
706
+ $stockItem->setData('qty', $qty);
707
+ $stockItem->setData('is_in_stock', $qty ? 1 : 0);
708
+ try {
709
+ $stockItem->save();
710
+ return true;
711
+ } catch (Exception $e) {
712
+ echo $e->getMessage();
713
+ }
714
+
715
+ }
716
+ }else{
717
+ return false;
718
+ }
719
+ return true;
720
+ }
721
+
722
+ /* prepare downloadable sample CSV file for user */
723
+ public function getCsvFile($isProductSetupMode = false)
724
+ {
725
+ $io = new Varien_Io_File();
726
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
727
+ $name = md5(microtime());
728
+ $file = $path . DS . $name;
729
+
730
+ $io->setAllowCreateFolders(true);
731
+ $io->open(array('path' => $path));
732
+ $io->streamOpen($file, 'w+');
733
+ $io->streamLock(true);
734
+ ($isProductSetupMode) ? $io->streamWriteCsv(array('magento_sku','vendor_sku')) : $io->streamWriteCsv(array('vendor_sku','qty','cost'));
735
+ $io->streamUnlock();
736
+ $io->streamClose();
737
+ return array(
738
+ 'type' => 'filename',
739
+ 'value' => $file,
740
+ 'rm' => true // can delete file after use
741
+ );
742
+ }
743
+
744
+ protected function getVendorName($vendorCode)
745
+ {
746
+ return Mage::getModel('dropship/ranking')->load($vendorCode,'amosoft_vendor_code')->getAmosoftVendorName();
747
+ }
748
+
749
+
750
+ /*
751
+ *
752
+ * logic to Import CSV file from amosoft FTP for vendor inventory cost
753
+ *
754
+ *
755
+ */
756
+ public function testFtpConnection($request,$isFtp = false)
757
+ {
758
+ $ftpServer = $request['ftp_site'];
759
+ $ftpUserName = $request['ftp_username'];
760
+ $ftpPassword = $request['ftp_password'];
761
+ $ftpType = $request['ftp_type'];
762
+ try {
763
+ if($ftpType['value'] == 'ftp'){
764
+ $ftpcon = ftp_connect($ftpServer['value']);
765
+ }else{
766
+ if(function_exists('ftp_ssl_connect'))
767
+ $ftpcon = ftp_ssl_connect($ftpServer['value']);
768
+ else
769
+ return array('error'=>true,'message' => 'System does not support secure ftp');
770
+ }
771
+ if (false === $ftpcon) {
772
+
773
+ return array('error'=>true,'message' => 'Unable to connect');
774
+ }
775
+ $loggedIn = @ftp_login($ftpcon, $ftpUserName['value'], $ftpPassword['value']);
776
+ ftp_pasv($ftpcon, true);
777
+ if (false === $loggedIn) {
778
+ return array('error'=>true,'message' => 'Unable to log in');
779
+ }
780
+ if(!$isFtp)
781
+ ftp_close($ftpcon);
782
+ } catch (Exception $e) {
783
+ return array('error'=>true,'message' => $e->getMessage());
784
+
785
+ }
786
+ if($isFtp)
787
+ return array('error'=>false,'message' => null,'object'=>$ftpcon);
788
+ else
789
+ return array('error'=>false,'message' => null);
790
+ }
791
+
792
+ /*
793
+ *
794
+ * Ftp function call by observer from where program execution started
795
+ *
796
+ */
797
+ public function ftpParseCsv()
798
+ {
799
+ if(Mage::helper('dropship')->isProcessRunning('bulk_assign')){
800
+ $message = 'Bulk product setup is currently running hence cannot run ftp import';
801
+ Mage::log($message, null, 'amosoft_log_report.log');
802
+ return;
803
+ }
804
+ $ftpfileName = array();
805
+ $this->ftpRequestPram = array('ftp_site'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_SITE)),'ftp_username'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_USERNAME)),'ftp_password'=>array('value'=> Mage::helper('core')->decrypt($this->getConfigValue(self::XML_PATH_UPLOAD_FTP_PASSWORD))),'ftp_type'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_TYPE)));
806
+
807
+ if (! Mage::getStoreConfigFlag ( self::XML_PATH_UPLOAD_ENABLED )) {
808
+ return $this;
809
+ }
810
+ $connectionResult = $this->testFtpConnection($this->ftpRequestPram,true);
811
+ if($connectionResult['error']){
812
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => 'Connection Failure','bcc'=>trim(Mage::helper('dropship')->getConfigObject('apiconfig/email/bcc'))));
813
+ $this->genrateLogEntry(array('ftp_error'=>'Connection error','ftp_error_desc'=>$connectionResult['message'],'error'=> 1));
814
+ Mage::log($connectionResult['message'], null, 'amosoft_ftp_vendor_inventory_import.log');
815
+ ftp_close($connectionResult['object']);
816
+ return $this;
817
+ }
818
+
819
+ $rankCollection = Mage::getModel('dropship/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
820
+ /* file path format <ftp site>/<Amosoft Account Number>_MagVendID<number>/Inventory/ */
821
+
822
+ if($rankCollection->getSize() > 0){
823
+ foreach($rankCollection as $ranks){
824
+ $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$ranks->getAmosoftVendorCode().'/'.'Inventory';
825
+ $ftpFiles = array();
826
+ $ftpFilesList = ftp_nlist($connectionResult['object'],$path);
827
+ //patch for sort ftp files by time
828
+ if($ftpFilesList){
829
+ foreach ($ftpFilesList as $value) {
830
+ if(preg_match("/.csv$/i", $value, $match)){
831
+ $fileTime = ftp_mdtm($connectionResult['object'], $value);
832
+ if(array_key_exists($fileTime,$ftpFiles))
833
+ $ftpFiles[$fileTime+20] = $value; // if timestamp same for files
834
+ else
835
+ $ftpFiles[$fileTime] = $value;
836
+ }
837
+ }
838
+ ksort($ftpFiles); // sort associative arrays in acending order, according to the key(time)
839
+ }
840
+ if($ftpFiles){
841
+ foreach($ftpFiles as $file){
842
+ if($this->downloadFtpFile($connectionResult['object'],$file,$path, $ranks->getAmosoftVendorCode()))
843
+ $ftpfileName[$ranks->getAmosoftVendorCode()][] = self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path);
844
+ }
845
+ }
846
+ ftp_chdir($connectionResult['object'],'/');
847
+ }
848
+ }else{
849
+ $this->genrateLogEntry(array('ftp_error'=>'Import Error','ftp_error_desc'=>'No dropship supplier found','error'=> 1));
850
+ Mage::log('No dropship supplier found', null, 'amosoft_ftp_vendor_inventory_import.log');
851
+ ftp_close($connectionResult['object']);
852
+ return $this;
853
+ }
854
+ if(!empty($ftpfileName)){
855
+ $this->initialize();
856
+ $this->_csvParserObj->emptyTable();
857
+ $this->_csvDataCache = array();
858
+ Mage::helper('dropship')->turnOnReadUncommittedMode(); //dirty read patch
859
+ foreach($ftpfileName as $vendorCode=>$fileinfo)
860
+ {
861
+ $this->_vendorCode = $vendorCode;
862
+ foreach($fileinfo as $path){
863
+ if($this->validateCsvHeader($this->_getCsvData($path,true),true)){
864
+ Mage::helper('dropship')->turnOnReadUncommittedMode(); // dirty read patch
865
+ $this->ftpUpdateVendorProduct($this->_getCsvData($path),$path,$vendorCode);
866
+ Mage::helper('dropship')->turnOnReadCommittedMode(); //restore to orignal trasectional level
867
+ $this->_csvDataCache = array();//for more than one csv file on FTP server
868
+
869
+ }else{
870
+ $this->_csvDataCache = array();
871
+ $logPath = explode('amosoftvendorproduct',str_replace("\\","/",$path));
872
+ $this->sendMail(array('isfailed'=>true,'vendor_code'=>$vendorCode,'subject'=>'dropship failed to update inventory','message' => 'Bad File header,Check header format at following FTP path '.$logPath[1]));
873
+ $this->genrateLogEntry(array('amosoft_vendor_code'=>$vendorCode,'ftp_error'=>'Bad File header','ftp_error_desc'=>'Check header format at following FTP path '.$logPath[1],'error'=> 1));
874
+ Mage::log('Please check header format', null, 'amosoft_ftp_vendor_inventory_import.log');
875
+ }
876
+ //fix move file to archive folder in all cases
877
+ $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>$path));
878
+ }
879
+ }
880
+ $this->finalize();
881
+ }else{
882
+ Mage::log('No files found on ftp server', null, 'amosoft_ftp_vendor_inventory_import.log');
883
+ ftp_close($connectionResult['object']);
884
+ return $this;
885
+ }
886
+ ftp_close($connectionResult['object']);
887
+ $this->_csvParserObj->emptyTable();
888
+ $this->_csvDataCache = array();
889
+ Mage::helper('dropship')->turnOnReadCommittedMode(); //restore to orignal transection level
890
+ return $this;
891
+ }
892
+
893
+ protected function initialize(){
894
+ Mage::helper('dropship')->startProcess('manual_upload');
895
+ Mage::log('Ftp upload started', null, 'amosoft_ftp_vendor_inventory_import.log');
896
+ }
897
+
898
+ protected function finalize(){
899
+ Mage::helper('dropship')->finishProcess('manual_upload');
900
+ Mage::log('Ftp upload finished', null, 'amosoft_ftp_vendor_inventory_import.log');
901
+ }
902
+
903
+ protected function archiveFtpFile($object)
904
+ {
905
+ $path = str_replace("\\","/",$object['path']);
906
+ $patharr = explode('amosoftvendorproduct',$path);
907
+ $dirname = pathinfo($patharr[1],PATHINFO_DIRNAME);
908
+ $basename = pathinfo($patharr[1],PATHINFO_BASENAME );
909
+ $newname = Mage::getModel('core/date')->date('Ymd-his').'_'.$basename;
910
+ $connection = $this->testFtpConnection($this->ftpRequestPram,true);
911
+ if($connection['error'])
912
+ {
913
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => "Connection Failure--Can not archive file -".$basename,'bcc'=>trim(Mage::helper('dropship')->getConfigObject('apiconfig/email/bcc'))));
914
+ Mage::log($connection['message'] ."--Can not archive file -".$basename, null, 'amosoft_ftp_vendor_inventory_import.log');
915
+ }
916
+ else
917
+ {
918
+ $object['object'] = $connection['object'];
919
+ }
920
+ ftp_chdir($object['object'],$dirname);
921
+ ftp_mkdir($object['object'], 'Archive');
922
+ ftp_chdir($object['object'],'Archive');
923
+ ftp_put($object['object'], $basename, $path, FTP_ASCII);
924
+ ftp_rename ($object['object'],$basename,$newname);
925
+ ftp_chdir($object['object'],'/');
926
+ $this->fileObj()->rm($object['path']);
927
+ ftp_delete($object['object'], $dirname.'/'.$basename);
928
+ ftp_close($connection['object']);
929
+ return;
930
+
931
+ }
932
+ protected function validateFtpFile($file, $vendorCode = null)
933
+ {
934
+ $file = str_replace("/","\\",$file);
935
+ $extension = pathinfo($file, PATHINFO_EXTENSION);
936
+ return true;
937
+ }
938
+
939
+ protected function downloadFtpFile($ftpRequest,$file,$path, $vendorCode = null)
940
+ {
941
+ if(!file_exists(self::getWorkingDir().$path)){
942
+ $patharr = explode('/',$path);
943
+ $this->fileObj()->mkdir(self::getWorkingDir().$patharr[0]);
944
+ $this->fileObj()->chmod(self::getWorkingDir().$patharr[0],0777);
945
+ $this->fileObj()->mkdir(self::getWorkingDir().$patharr[0].'/'.$patharr[1]);
946
+ $this->fileObj()->chmod(self::getWorkingDir().$patharr[0].'/'.$patharr[1],0777);
947
+ }
948
+ $fileName = explode('/',$file);
949
+
950
+ ftp_chdir($ftpRequest,'/'.$fileName[0].'/'.$fileName[1]);
951
+ $server_file = $fileName[2];
952
+ $local_file = self::getWorkingDir().$path.DS.$fileName[2];
953
+ // download server file
954
+ if (ftp_get($ftpRequest, $local_file, $server_file, FTP_ASCII)){
955
+
956
+ return $fileName[2];
957
+ }else{
958
+ return false;
959
+ }
960
+ }
961
+
962
+ protected function uploadReport($file,$vendorCode){
963
+ $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$vendorCode.'/'.'Inventory';
964
+ $reprotPath = 'report'.Mage::getModel('core/date')->date('Ymd-his').'.csv';
965
+ $connection = $this->testFtpConnection($this->ftpRequestPram,true);
966
+ if($connection['error'])
967
+ {
968
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => "Connection Failure--Can not upload report file -".$basename,'bcc'=>trim(Mage::helper('dropship')->getConfigObject('apiconfig/email/bcc'))));
969
+ Mage::log($connection['message'] ."--Can not archive file -".$basename, null, 'amosoft_ftp_vendor_inventory_import.log');
970
+ }
971
+ else
972
+ {
973
+ $object = $connection['object'];
974
+ }
975
+ ftp_chdir($object,'/');
976
+ ftp_chdir($object,$path);
977
+ ftp_mkdir($object,'Reports');
978
+ ftp_chdir($object,'Reports');
979
+ ftp_put($object, $reprotPath,$file['value'], FTP_ASCII);
980
+ ftp_chdir($object,'/');
981
+ $this->fileObj()->rm( $file['value']);
982
+ ftp_close($connection['object']);
983
+ return;
984
+ }
985
+ protected function ftpUpdateVendorProduct($csvData,$path,$vendorCode = null)
986
+ {
987
+ $records = array();
988
+ $success = array();
989
+ $failure = array();
990
+ $itemerroroutput = array();
991
+ $counter = 0;
992
+ //$vendorCode = '';
993
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log' );
994
+ if(count($csvData) <= 1 && Mage::getModel('dropship/csvparser')->isCsvFileEmpty())
995
+ {
996
+ $failure[] = 'Sorry,we cant find the record to update inventory';
997
+ $this->_FtpErrors[] = array('error_type'=>'empty_file','value'=>'Sorry,we cant find the record to update inventory');
998
+ }
999
+ $records = Mage::getModel('dropship/csvparser')->generateFtpCsvRow($csvData,$vendorCode);
1000
+ //$this->conn->beginTransaction ();
1001
+ if(is_array($records) && !empty($records)){
1002
+ $requestData = array_chunk($records, 1, true);
1003
+
1004
+ foreach($requestData as $dataArr)
1005
+ {
1006
+ foreach($dataArr as $data){
1007
+ $result[] = $this->validateCsvData($data, true);
1008
+ }
1009
+ }
1010
+ foreach($result as $successOrfail){
1011
+ if($successOrfail['success']!="")
1012
+ $success[] = $successOrfail['success'];
1013
+ if($successOrfail['failure']!="")
1014
+ $failure[] = $successOrfail['failure'];
1015
+
1016
+ }
1017
+ $this->checkDataIntigrity($this->_getCsvData($path),true);
1018
+ }
1019
+ $finalResultCounter = (!$this->_isProductSetupMode) ? $this->logForUnprocessedRows($vendorCode,true) : 0;
1020
+ if(is_array($finalResultCounter))
1021
+ {
1022
+ $failed = count($failure)+$finalResultCounter['failure'];
1023
+ $success = count($success)+$finalResultCounter['success'];
1024
+ }else
1025
+ {
1026
+ $failed = count($failure)+$finalResultCounter;
1027
+ $success = count($success)+$finalResultCounter;
1028
+ }
1029
+ $itemerroroutput = Mage::helper('core')->jsonEncode($this->_FtpErrors);
1030
+ //$failed = count($failure)+$counter;
1031
+ $ftp_err = ($failed > 0) ? 'Missing/Bad Data' : '';
1032
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(amosoft_vendor_code,updated_by,success,failure,ftp_error,created_at) VALUES ("'.$vendorCode.'","FTP",'.$success.','.$failed.',"'.$ftp_err.'","'.now().'")';
1033
+ $this->conn->beginTransaction ();
1034
+ $this->conn->query($insert);
1035
+ $entityId = $this->conn->lastInsertId($tableVendorImportLog);
1036
+ try {
1037
+ $this->conn->commit ();
1038
+ if(count($this->_FtpErrors) > 0){
1039
+ $csvFile = Mage::helper('dropship')->generateErrorList(array('ftp_error_desc'=>$itemerroroutput,'amosoft_vendor_code'=>$vendorCode),true);
1040
+ $this->uploadReport($csvFile,$vendorCode);
1041
+ }
1042
+ if($this->sendBadFileAlert){
1043
+ $logPath = explode('amosoftvendorproduct',str_replace("\\","/",$path));
1044
+ $this->sendMail(array('isfailed'=>true,'vendor_code'=>$vendorCode,'subject'=>'dropship failed to update inventory','message' => 'Missing/Bad data, check CSV data at following FTP path <br>'.$logPath[1]));
1045
+ }
1046
+ $this->prepareInsertAndExeQuery($this->_FtpErrors,$entityId);
1047
+ $itemerroroutput = array();
1048
+ $this->_FtpErrors = array();
1049
+ } catch ( Exception $e ) {
1050
+ $this->conn->rollBack ();
1051
+ Mage::log($e->getMessage(), null, 'amosoft_ftp_vendor_inventory_import.log');
1052
+ echo $e->getMessage();
1053
+
1054
+ }
1055
+ }
1056
+
1057
+ protected function ftpVendorProductUpdate($data)
1058
+ {
1059
+ $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/inventory' );
1060
+ $inventoryCollectionResult = $this->getInventoryCollection($data,true);
1061
+ $qtyArray = $this->calculateProductQty(array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'amosoft_vendor_code'=>$data['amosoft_vendor_code']));
1062
+ switch($inventoryCollectionResult['operationType'])
1063
+ {
1064
+ case 'update':
1065
+ $productId = Mage::getModel('catalog/product')->getIdBySku($inventoryCollectionResult['magento_sku']);
1066
+ if($productId){
1067
+ $update = $this->_prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,true);
1068
+ try {
1069
+ if(!$this->updateProductInventory($inventoryCollectionResult['magento_sku'],$qtyArray['final_qty']))
1070
+ {
1071
+ $this->_FtpErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));;
1072
+ $this->sendBadFileAlert = true;
1073
+ return false;
1074
+ }
1075
+ if($update){
1076
+ $this->conn->beginTransaction ();
1077
+ $this->conn->query($update);
1078
+ $this->conn->commit ();
1079
+ }
1080
+ return true;
1081
+ } catch ( Exception $e ) {
1082
+ $this->conn->rollBack ();
1083
+ Mage::log($e->getMessage(), null, 'amosoft_ftp_vendor_inventory_import.log');
1084
+ echo $e->getMessage();
1085
+ }
1086
+
1087
+ }else{
1088
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1089
+ $this->sendBadFileAlert = true;
1090
+ return false;
1091
+ }
1092
+ break;
1093
+ default :
1094
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));;
1095
+ $this->sendBadFileAlert = true;
1096
+ return false;
1097
+ }
1098
+ return true;
1099
+ }
1100
+
1101
+ protected function genrateLogEntry($message)
1102
+ {
1103
+ $vendorCode = (!empty($message['amosoft_vendor_code'])) ? $message['amosoft_vendor_code'] : '';
1104
+ $ftp_error = (!empty($message['ftp_error'])) ? $message['ftp_error'] : '';
1105
+ $ftp_error_desc = (!empty($message['ftp_error_desc'])) ? $message['ftp_error_desc'] : '';
1106
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship/vendor_import_log' );
1107
+ $this->conn->beginTransaction ();
1108
+ $now = now();
1109
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(amosoft_vendor_code,updated_by,success,failure,created_at,ftp_error,ftp_error_desc) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.$message['error'].',"'.$now.'","'.$ftp_error.'","'.$ftp_error_desc.'")';
1110
+ $this->conn->query($insert);
1111
+ try {
1112
+ $this->conn->commit ();
1113
+ } catch ( Exception $e ) {
1114
+ $this->conn->rollBack ();
1115
+ Mage::log($e->getMessage(), null, 'amosoft_ftp_vendor_inventory_import.log');
1116
+ echo $e->getMessage();
1117
+
1118
+ }
1119
+ }
1120
+
1121
+ /**
1122
+ * Check csv data for qty and cost values
1123
+ * @param array $data, bool $isFtp
1124
+ * @return array
1125
+ */
1126
+ protected function validateCsvData($data, $isFtp=false){
1127
+ $invalidData = false;
1128
+ $success = 0;
1129
+ $failure = 0;
1130
+ $ignoreData = array();
1131
+
1132
+ $inventoryCollectionResult = $this->getInventoryCollection($data,true,($isFtp) ? false : true);
1133
+ $data['magento_sku'] = $inventoryCollectionResult['magento_sku'];
1134
+
1135
+ if(Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']))){
1136
+ if(!is_numeric($data['qty']) || $data['qty'] < 0){
1137
+ $ignoreData[]= 'qty';
1138
+ }
1139
+ if(!is_numeric($data['cost']) || $data['cost'] < 0){
1140
+ $ignoreData[]= 'cost';
1141
+ }
1142
+ if((!is_numeric($data['cost']) || $data['cost'] < 0) && (!is_numeric($data['qty']) || $data['qty'] < 0)){
1143
+ if($data['cost']!="" && $data['qty']!="")
1144
+ $invalidData = true;
1145
+ }
1146
+
1147
+ if(!$duplicateCombination = $this->chekDuplicateCombination($data)){
1148
+ $invalidData = true;
1149
+ if(!$isFtp){
1150
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1151
+ }else{
1152
+ $this->_FtpErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1153
+ $this->sendBadFileAlert = true;
1154
+ }
1155
+ }
1156
+ $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('amosoft_vendor_sku',trim($data['vendor_sku']));
1157
+ if($vendorCollection->getSize() == 0){
1158
+ $spacesTrimmedSku = $this->getTrimmedSku();
1159
+ $searchedSku = array_search(trim($data['vendor_sku']), $spacesTrimmedSku);
1160
+ if($searchedSku){
1161
+ $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('amosoft_vendor_sku',$searchedSku);
1162
+ }
1163
+ }
1164
+ if($vendorCollection->getSize() > 0){
1165
+ if($data['magento_sku']!=$vendorCollection->getFirstItem ()->getProductSku()){
1166
+ $invalidData = true;
1167
+ $this->_UploadCsvErrors[] = array('error_type'=>'already_assigned','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1168
+ }
1169
+ }
1170
+ if($invalidData){
1171
+ $failure+=1;
1172
+ }else{
1173
+ if($isFtp){
1174
+ ($this->ftpVendorProductUpdate($data)) ? $success += 1 : $failure+=1;
1175
+ }else{
1176
+ ($this->vendorProductInsert($data)) ? $success += 1 : $failure+=1;
1177
+ }
1178
+
1179
+ }
1180
+ }else{
1181
+ $failure+=1;
1182
+ if(!$isFtp){
1183
+ if(trim($data['vendor_sku']))
1184
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1185
+ }else{
1186
+ if(trim($data['vendor_sku']))
1187
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1188
+ $this->sendBadFileAlert = true;
1189
+ }
1190
+ }
1191
+ if($data['magento_sku']){
1192
+ if($isFtp){
1193
+ $insertInventoryLog = $this->getInventoryLogQuery($data,'update',$data['qty'],'FTP', $ignoreData);
1194
+ }else{
1195
+ $insertInventoryLog = $this->getInventoryLogQuery($data, $inventoryCollectionResult['operationType'], $data['qty'], null,$ignoreData);
1196
+ }
1197
+ if($insertInventoryLog)
1198
+ {
1199
+ $this->conn->beginTransaction ();
1200
+ $this->conn->query($insertInventoryLog);
1201
+ try{
1202
+ $this->conn->commit ();
1203
+ }catch(Exception $e){
1204
+ $this->conn->rollBack ();
1205
+ }
1206
+ }
1207
+ }
1208
+ return array('success'=>$success, 'failure'=>$failure);
1209
+ }
1210
+
1211
+
1212
+ /**
1213
+ * Validate product setup data for manual upload
1214
+ * @param array $data, bool $isFtp
1215
+ * @return array
1216
+ */
1217
+ protected function validateProductSetupMode($data, $isFtp = false){
1218
+ $invalidData = false;
1219
+ $success = 0;
1220
+ $failure = 0;
1221
+ $type = "Product Setup";
1222
+ if(trim($data['vendor_sku'])=="" || trim($data['magento_sku'])==""){
1223
+ return array('success'=>$success =0, 'failure'=>$failure+=1);
1224
+ }
1225
+ if(Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']))){
1226
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('amosoft_vendor_sku',$data['vendor_sku']);
1227
+ if($collection->count() > 0){
1228
+ $existing_product_sku = $collection->getFirstItem()->getProductSku();
1229
+ if(!empty($existing_product_sku)){
1230
+ if($data['magento_sku'] != $existing_product_sku){
1231
+ $invalidData = true;
1232
+ $this->_UploadCsvErrors[] = array('error_type'=>'duplicate_vendor_sku','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1233
+
1234
+ }else{
1235
+ $invalidData = true;
1236
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1237
+ }
1238
+ }
1239
+ }
1240
+ $inventoryCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$data['amosoft_vendor_code'])->addFieldTofilter('product_sku',$data['magento_sku']);
1241
+ if($inventoryCollection->getSize() > 0){
1242
+ $inventoryCollection = $inventoryCollection->getData();
1243
+ $inventoryCollection = $inventoryCollection[0];
1244
+ $existing_vendor_sku = $inventoryCollection['amosoft_vendor_sku'];
1245
+ if(trim($data['vendor_sku'])!=""){
1246
+ if($existing_vendor_sku != trim($data['vendor_sku'])){
1247
+ if($existing_vendor_sku != trim($data['vendor_sku'])){
1248
+ $data['operationType'] = "update";
1249
+ $data['cost'] = "";
1250
+ $data['qty'] = "";
1251
+ $data['pucost'] = $inventoryCollection['cost'];
1252
+ $data['puqty'] = $inventoryCollection['stock'];
1253
+ $type = "Product Update";
1254
+ }
1255
+ }
1256
+ }
1257
+ }
1258
+ if($invalidData){
1259
+ $failure+=1;
1260
+ }else{
1261
+ ($this->vendorProductInsert($data)) ? $success += 1 : $failure+=1;
1262
+ if($this->vendorProductInsert($data)){
1263
+ $insertInventoryLog = $this->getInventoryLogQuery($data, $type, 0, null, null);
1264
+ if($insertInventoryLog){
1265
+ $this->conn->beginTransaction ();
1266
+ $this->conn->query($insertInventoryLog);
1267
+ try{
1268
+ $this->conn->commit ();
1269
+ }catch(Exception $e){
1270
+ $this->conn->rollBack ();
1271
+ }
1272
+ }
1273
+ }
1274
+ }
1275
+ }else{
1276
+ $failure+=1;
1277
+ $this->_UploadCsvErrors[] = array('error_type'=>'magento_sku_exists','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1278
+ }
1279
+ return array('success'=>$success, 'failure'=>$failure);
1280
+ }
1281
+
1282
+ /* method for bulk assignment of vendor code to all product*/
1283
+ public function prepareBulkassignmentCollection($vendorCode)
1284
+ {
1285
+ $numberOfRecords = 200;
1286
+ $Amosoftsku = array();
1287
+ $magentoSku = array();
1288
+ $magentoSkuCollection = Mage::getModel('catalog/product');
1289
+ if(count($Amosoftsku) > 0)
1290
+ $productCollection = $magentoSkuCollection->getCollection()->addAttributeToSelect('sku')->addAttributeToFilter('sku', array('nin' => $Amosoftsku));
1291
+ else
1292
+ $productCollection = $magentoSkuCollection->getCollection()->addAttributeToSelect('sku')->addAttributeToFilter('type_id','simple');
1293
+
1294
+ if($productCollection->getSize() > 0){
1295
+ $chunkSkus = array_chunk($productCollection->getData(), $numberOfRecords);
1296
+
1297
+ foreach($chunkSkus as $skus)
1298
+ {
1299
+ foreach($skus as $mageSku){
1300
+ $magentoSku[] = $mageSku['sku'];
1301
+ }
1302
+ }
1303
+ }
1304
+ return $magentoSku;
1305
+ }
1306
+
1307
+ /**
1308
+ * Get Varien I/O File class object
1309
+ * @return object
1310
+ */
1311
+ protected function fileObj()
1312
+ {
1313
+ $fileObj = new Varien_Io_File();
1314
+ return $fileObj;
1315
+ }
1316
+
1317
+ /**
1318
+ * Get vendor skus with satrting and trailing spaces
1319
+ * @return array
1320
+ */
1321
+ protected function getTrimmedSku()
1322
+ {
1323
+ $read = Mage::getSingleton ('core/resource')->getConnection ('core_read');
1324
+ $tableName = Mage::getSingleton ('core/resource')->getTableName('amosoft_vendor_inventory');
1325
+ $trimSpacesQuery = 'SELECT amosoft_vendor_sku FROM '.$tableName.' WHERE amosoft_vendor_sku LIKE '. '"% %"';
1326
+ $result = $read->fetchAll($trimSpacesQuery);
1327
+ $trimmedSkus = array();
1328
+ if(count($result) > 0){
1329
+ foreach($result as $k=>$v){
1330
+ foreach($v as $sku)
1331
+ $trimmedSkus[$sku] = trim($sku);
1332
+ }
1333
+ }
1334
+ return $trimmedSkus;
1335
+ }
1336
+
1337
+ protected function sendMail($mailData = array()){
1338
+ if (!Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED)) {
1339
+ return $this;
1340
+ }
1341
+ $mailData['datetime'] = Mage::getModel('core/date')->date();
1342
+ $postObject = new Varien_Object();
1343
+ $postObject->setData($mailData);
1344
+ $email = trim(Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL));
1345
+ $templateId = 'amosoft_ftp_con_fail';
1346
+ $isMailSent = Mage::helper('dropship')->sendMail($postObject,$email,$templateId);
1347
+ if(!$isMailSent)
1348
+ Mage::log('Notification email not sent :'.$email, null, 'amosoft_debug.log');
1349
+ }
1350
+ protected function logForUnprocessedRows($vendorCode,$isFtp = false){
1351
+ $msg = '';
1352
+ $error = 0;
1353
+ $success = 0;
1354
+ $proObj = Mage::getModel('dropship/ranking')->load($vendorCode,'amosoft_vendor_code');
1355
+ $proLinkAttr = $proObj->getLinkingAttribute();
1356
+ $proLinkAttr = empty($proLinkAttr) ? 'none' : $proLinkAttr;
1357
+ $this->supplierName = $proObj->getAmosoftVendorName();
1358
+ $helper = Mage::helper('dropship');
1359
+ $csvData = Mage::getModel('dropship/csvparser')->getUnprocessedCsvRows($vendorCode,$isFtp);
1360
+ if(count($csvData) > 0 ){
1361
+ foreach($csvData as $data){
1362
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('amosoft_vendor_code',$vendorCode)->addFieldTofilter('amosoft_vendor_sku',$data['vendor_sku']);
1363
+ if($collection->getSize() > 0)
1364
+ {
1365
+ $msg = array('error_type'=>'data_notchnage','value'=>array('magento_sku'=> $collection->getFirstItem()->getProductSku(),'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1366
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1367
+ $error++;
1368
+ }else
1369
+ {
1370
+ switch ($proLinkAttr) {
1371
+ case 'none':
1372
+ $msg = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1373
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1374
+ $error++;
1375
+ break;
1376
+ default:
1377
+ $proCol = Mage::getModel('catalog/product')->getCollection();
1378
+ if(!$this->checkAttributeAval($proLinkAttr,$proCol)){
1379
+ $msg = array('error_type'=>'attribute_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1380
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1381
+ $error++;
1382
+ }else{
1383
+ $product = $proCol->addAttributeToFilter($proLinkAttr,$data['vendor_sku']);
1384
+ if($this->validateGenerateProduct($product,$data,$proLinkAttr,$isFtp)){
1385
+ $tempArray = $this->genNonExistPro($product,$data,$isFtp);
1386
+ !empty($tempArray['success']) ? $success++ : '';
1387
+ !empty($tempArray['failure']) ? $error++ : '';
1388
+ }else
1389
+ {
1390
+ $error++;
1391
+ }
1392
+ }
1393
+ break;
1394
+ }
1395
+ }
1396
+ }
1397
+ $csvData[0] = $this->_csvDataCache[0];
1398
+ $this->emptyRecords = array();
1399
+ $this->result = array();
1400
+ $this->checkDataIntigrity($csvData,$isFtp);
1401
+ }
1402
+ return array('success'=>$success,'failure'=>$error);
1403
+ }
1404
+ protected function prepareInsertAndExeQuery($csvData,$entityId){
1405
+ if(count($csvData) <= 0 || empty($entityId))
1406
+ return ;
1407
+ $tableName = Mage::getSingleton ( 'core/resource' )->getTableName ('dropship/vendor_import_log_desc');
1408
+
1409
+ foreach($csvData as $data)
1410
+ {
1411
+ try {
1412
+ $this->conn->insertArray($tableName,array('error_id','description'),array(array($entityId,Mage::helper('core')->jsonEncode($data))));
1413
+ } catch ( Exception $e ) {
1414
+ Mage::logException($e);
1415
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1416
+ }
1417
+
1418
+ }
1419
+ return ;
1420
+ }
1421
+ protected function validateGenerateProduct($product,$data,$attr,$isFtp){
1422
+ $isValid = true;
1423
+ $helper = Mage::helper('dropship');
1424
+ if($product->getSize() == 0)
1425
+ {
1426
+ $errorType = ($attr == $helper::AMOSOFT_PRODUCT_LINK_CODE_SKU) ? 'magento_sku_exists' : $attr.'_notexist';
1427
+ $msg = array('error_type'=>$errorType,'value'=>array('magento_sku'=>$data['vendor_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1428
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1429
+ $isValid = false;
1430
+ }elseif($product->getSize() > 1)
1431
+ {
1432
+ $msg = array('error_type'=>$attr.'_multiple','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1433
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1434
+ $isValid = false;
1435
+ }else{
1436
+ $data['magento_sku'] = $product->getFirstItem()->getSku();
1437
+ if(!$this->chekDuplicateCombination($data))
1438
+ {
1439
+ $msg = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1440
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1441
+ $isValid = false;
1442
+ }
1443
+ }
1444
+
1445
+ return $isValid;
1446
+ }
1447
+
1448
+ protected function genNonExistPro($proObj,$data,$isFtp){
1449
+ $invalidData = false;
1450
+ $failure = 0;
1451
+ $success = 0;
1452
+ $ignoreData = array();
1453
+ $data['magento_sku'] = $proObj->getFirstItem()->getSku();
1454
+ /* LBN - 935 change */
1455
+ $data['qty'] = (is_numeric($data['qty'])) ? Mage::helper('dropship')->getIsQtyDecimal($data['magento_sku'],$data['qty']) : $data['qty'];
1456
+ if(!is_numeric($data['qty']) || $data['qty'] < 0){
1457
+ $ignoreData[]= 'qty';
1458
+ }
1459
+ if(!is_numeric($data['cost']) || $data['cost'] < 0){
1460
+ $ignoreData[]= 'cost';
1461
+ }
1462
+ if((!is_numeric($data['cost']) || $data['cost'] < 0) && (!is_numeric($data['qty']) || $data['qty'] < 0)){
1463
+ if($data['cost']!="" && $data['qty']!="")
1464
+ $invalidData = true;
1465
+ }
1466
+
1467
+ if($invalidData){
1468
+ $failure+=1;
1469
+ }else{
1470
+ ($this->insertNonExistPro($proObj,$data,$isFtp)) ? $success += 1 : $failure += 1;
1471
+ }
1472
+
1473
+ $this->insertInventoryLog($ignoreData,$data,$isFtp);
1474
+
1475
+ return array('success'=>$success,'failure'=>$failure);
1476
+ }
1477
+
1478
+ protected function insertNonExistPro($proObj,$data,$isFtp = false){
1479
+
1480
+ $vendorCode = ($isFtp) ? $data['amosoft_vendor_code'] : $this->_vendorCode;
1481
+ $tableVendorInventory = Mage::getSingleton ('core/resource')->getTableName('dropship/inventory');
1482
+ $qtyArray = $this->calculateProductQty($data);
1483
+ $costInsert = (!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="") ? 0 : $data['cost'] ;
1484
+ $qtyInsert = ($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" ) ? 0 : $qtyArray['upload_qty'];
1485
+ $dbFields = array('amosoft_vendor_code','amosoft_vendor_name','product_sku','amosoft_vendor_sku','stock','cost','created_at','updated_at');
1486
+ $dbFieldVal = array(
1487
+ array($vendorCode,$this->supplierName,$data['magento_sku'],$data['vendor_sku'],$qtyInsert,$costInsert,now(),now())
1488
+ );
1489
+ try {
1490
+ if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
1491
+ {
1492
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1493
+ return false;
1494
+ }
1495
+ $this->conn->insertArray($tableVendorInventory,$dbFields,$dbFieldVal);
1496
+ return true;
1497
+ } catch ( Exception $e ) {
1498
+ Mage::logException($e);
1499
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1500
+ }
1501
+
1502
+
1503
+ }
1504
+ protected function insertInventoryLog($ignoreData,$data,$isFtp)
1505
+ {
1506
+ $type = 'add';
1507
+ $vendorCode = ($isFtp) ? $data['amosoft_vendor_code'] : $this->_vendorCode;
1508
+ if(count($ignoreData)>0){
1509
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Added, Qty Ignored' : '';
1510
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Added, Cost Ignored' : '';
1511
+
1512
+ if(count($ignoreData)==2){
1513
+ $type = 'ignore';
1514
+ }
1515
+ }
1516
+ if($data['qty']==0.999999999)
1517
+ $data['qty'] = 0;
1518
+ $tableName = Mage::getSingleton("core/resource")->getTableName('dropship/inventorylog');
1519
+ $updatedBy = (!$isFtp) ? Mage::getSingleton('admin/session')->getUser()->getUsername() : 'FTP';
1520
+ $dbFields = array('amosoft_vendor_code','amosoft_vendor_name','product_sku','cost','stock','updated_by','activity','updated_at','created_at');
1521
+ $dbFieldVal = array(
1522
+ array($vendorCode,$this->supplierName,$data['magento_sku'],$data['cost'],$data['qty'],$updatedBy,$type,now(),now())
1523
+ );
1524
+ try {
1525
+ $this->conn->insertArray($tableName,$dbFields,$dbFieldVal);
1526
+ return true;
1527
+ } catch ( Exception $e ) {
1528
+ Mage::logException($e);
1529
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1530
+ }
1531
+
1532
+ }
1533
+ protected function checkAttributeAval($attr,$object){
1534
+ $isExist = false;
1535
+ $attrEav = Mage::getResourceModel('catalog/eav_attribute')->loadByCode('catalog_product',$attr);
1536
+ if ($attrEav->getId())
1537
+ $isExist = true;
1538
+ return $isExist;
1539
+ }
1540
+ }
app/code/local/Amosoft/Dropship/Model/Versions/Api.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_Versions_Api extends Mage_Api_Model_Resource_Abstract
9
+ {
10
+ public function getdropshipversion() {
11
+ $magento_edition = Mage::getEdition();
12
+ $dropship_version = Mage::getStoreConfig('amosoft_integration/integration/ds360_version',Mage::app()->getStore());
13
+ $magento_version = Mage::getStoreConfig('amosoft_integration/integration/magento_version',Mage::app()->getStore());
14
+ $moduleName = 'Amosoft_Dropship';
15
+ $moduleVersion = Mage::getConfig()->getNode('modules/' . $moduleName . '/version');
16
+ $versions = array();
17
+ $versions['magentoVer'] = $magento_edition ." ".$magento_version;
18
+ $versions['dropshipVer'] = $dropship_version;
19
+ $versions['dropshipDbScriptVer'] = $moduleVersion;
20
+ return $versions;
21
+ }
22
+
23
+ }
app/code/local/Amosoft/Dropship/Model/Versions/Api/V2.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ class Amosoft_Dropship_Model_Versions_Api_V2 extends Amosoft_Dropship_Model_Versions_Api
9
+ {
10
+ //empty
11
+ }
app/code/local/Amosoft/Dropship/controllers/Adminhtml/AmosoftController.php ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Adminhtml_AmosoftController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ protected function _initAction() {
14
+ $this->loadLayout()
15
+ ->_setActiveMenu('dropship/suppliers')
16
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Vendor Manager'), Mage::helper('adminhtml')->__('Vendor Manager'));
17
+
18
+ return $this;
19
+ }
20
+
21
+ public function indexAction() {
22
+ $this->_initAction()->renderLayout();
23
+ }
24
+
25
+ public function getapidetailsAction() {
26
+ $this->loadLayout();
27
+ $this->getLayout()->getBlock('amosoftnotification')->setConfigValue(array(
28
+ 'scope' => 'default',
29
+ 'scope_id' => '0',
30
+ 'path' => 'amosoft_integration/integration/notificationstatus',
31
+ 'value' => '0',
32
+ ));
33
+ Mage::app()->getCacheInstance()->cleanType('config');
34
+ Mage::getSingleton('adminhtml/session')->setNotification(false);
35
+ $this->_redirectReferer();
36
+ }
37
+
38
+ public function sourcinggridAction() {
39
+
40
+ $this->getLayout()->createBlock('dropship/adminhtml_sourcing_grid')->toHtml();
41
+ $this->loadLayout()->renderLayout();
42
+
43
+ }
44
+
45
+ public function gridAction() {
46
+ $this->getResponse()->setBody(
47
+ $this->getLayout()->createBlock('dropship/adminhtml_amosoft_grid')->toHtml());
48
+ }
49
+ public function editAction() {
50
+ $id = $this->getRequest()->getParam('vendor_id');
51
+ $model = Mage::getModel('dropship/supplier')->load($id);
52
+
53
+ if ($model->getVendorId() || $id == 0) {
54
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
55
+ if (!empty($data)) {
56
+ $model->setData($data);
57
+
58
+ }
59
+ Mage::register('amosoft_data', $model);
60
+
61
+ $this->loadLayout();
62
+ $this->_setActiveMenu('dropship/suppliers');
63
+
64
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Vendor Manager'), Mage::helper('adminhtml')->__('Vendor Manager'));
65
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
66
+
67
+ $this->_addContent($this->getLayout()->createBlock('dropship/adminhtml_amosoft_edit'))
68
+ ->_addLeft($this->getLayout()->createBlock('dropship/adminhtml_amosoft_edit_tabs'));
69
+
70
+ $this->renderLayout();
71
+ } else {
72
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Vendor does not exist'));
73
+ $this->_redirect('*/*/');
74
+ }
75
+ }
76
+
77
+ public function newAction()
78
+ {
79
+ $this->loadLayout();
80
+ $this->_setActiveMenu('dropship/suppliers');
81
+ $this->_addContent($this->getLayout()->createBlock('dropship/adminhtml_amosoft_edit'))
82
+ ->_addLeft($this->getLayout()->createBlock('dropship/adminhtml_amosoft_edit_tabs'));
83
+ $this->renderLayout();
84
+
85
+ }
86
+
87
+ public function saveAction()
88
+ {
89
+ if ($data = $this->getRequest()->getPost()) {
90
+ $model = Mage::getModel('dropship/supplier');
91
+ if ($id = $this->getRequest()->getParam('vendor_id')) {//the parameter name may be different
92
+ $model->load($id);
93
+ }
94
+ $companyid = $this->getRequest()->getParam('company_id');
95
+ $message = '';
96
+ $result = array();
97
+ if(empty($companyid) || strcmp($model->getCompanyId(),$companyid) == 0 )
98
+ $validate = 0;
99
+ else{
100
+ $result = $model->validateCompany($companyid,$data);
101
+ $validate = $result['validate'];
102
+ $data = $result['data'];
103
+ if(!$validate){
104
+ $model->load($data['id']);
105
+ }
106
+ }
107
+ $message = ($result['message']) ? 'Vendor Recovered Successfully -'.$data['company_id'] : 'Vendor was successfully saved';
108
+ $model->addData($data);
109
+ try {
110
+ if(!empty($data['addnewoption'])){
111
+ $model->setData('magento_vendor_code',strtolower($data['addnewoption']));
112
+ }
113
+ //validate compny id as unique
114
+ if($validate == 1){
115
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Duplicate Company ID'));
116
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
117
+ $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
118
+ return;
119
+ }
120
+ $model->save();
121
+
122
+ if(!empty($data['addnewoption'])){
123
+ Mage::getModel('dropship/amosoft')->createOptionValueOnSave($model->getMagentoVendorCode());
124
+ }
125
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
126
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__($message));
127
+
128
+ if ($this->getRequest()->getParam('back')) {
129
+ $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
130
+ return;
131
+ }
132
+ $this->_redirect('*/*/');
133
+ return;
134
+ } catch (Exception $e) {
135
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
136
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
137
+ $this->_redirect('*/*/edit', array('vendor_id'=>$model->getVendorId(), '_current'=>true));
138
+ return;
139
+ }
140
+ }
141
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Unable to find Vendor to save'));
142
+ $this->_redirect('*/*/');
143
+ }
144
+
145
+ public function deleteAction()
146
+ {
147
+ if ($id = $this->getRequest()->getParam('vendor_id')) {
148
+ try {
149
+ $model = Mage::getModel('dropship/supplier');
150
+ $model->load($id);
151
+ $model->setData('status','deleted');
152
+ $model->save();
153
+ $collection = Mage::getModel('dropship/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
154
+ $collection->getSelect()->order('ranking asc');
155
+ $rank = Mage::getModel('dropship/ranking')->load($id)->getRanking();
156
+ foreach($collection as $value){
157
+ Mage::getModel('dropship/ranking')->rearrangeRank($value, $rank);
158
+ }
159
+ Mage::getModel('dropship/ranking')->load($id,'amosoft_vendor_id')->setRanking('')->setIsDropship('no')->setIsActive('no')->save();
160
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('The Vendor has been deleted.'));
161
+ $this->_redirect('*/*/');
162
+ return;
163
+
164
+ } catch (Exception $e) {
165
+
166
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
167
+
168
+ $this->_redirect('*/*/edit', array('vendor_id' => $id));
169
+ return;
170
+ }
171
+ }
172
+
173
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Unable to find a Vendor to delete.'));
174
+
175
+ $this->_redirect('*/*/');
176
+ }
177
+
178
+
179
+ /**
180
+ * Export vendor in csv format
181
+ */
182
+ public function exportCsvAction()
183
+ {
184
+ $fileName = 'supplier.csv';
185
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_amosoft_grid')->getCsvFile();
186
+ $this->_prepareDownloadResponse($fileName, $content);
187
+ }
188
+
189
+ /**
190
+ * Export vendor in Excel format
191
+ */
192
+ public function exportXmlAction()
193
+ {
194
+ $fileName = 'supplier.xml';
195
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_amosoft_grid')->getExcelFile($fileName);
196
+ $this->_prepareDownloadResponse($fileName, $content);
197
+ }
198
+
199
+ public function validateajaxrequestAction()
200
+ {
201
+ $paramsArray = $this->getRequest()->getParams();
202
+ $validation = Mage::getModel('dropship/amosoft');
203
+ $result = $validation->validation($paramsArray['groups']['integration']['fields']);
204
+ $result = Mage::helper('core')->jsonEncode($result);
205
+ Mage::app()->getResponse()->setBody($result);
206
+ }
207
+
208
+ /**
209
+ * Change dropship order item status through Ajax request
210
+ */
211
+ public function changeStatusAjaxAction()
212
+ {
213
+ $data = $this->getRequest()->getPost();
214
+ //print_r($data); exit;
215
+ if($data){
216
+ if($data['amosoft_item_status']!=""){
217
+ $order = Mage::getModel('sales/order')->load($data['order_id']);
218
+ $orderStatus = $order->getStatus();
219
+ $OrderItemInstance = Mage::getModel('dropship/orderitems')->getCollection()->addFieldToFilter('item_id', $data['amosoft_item_id']);
220
+ try{
221
+ if($OrderItemInstance->count() > 0){
222
+ foreach($OrderItemInstance as $item){
223
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($item, $data['amosoft_item_status'], $orderStatus);
224
+ $item->setAmosoftItemStatus($data['amosoft_item_status']);
225
+ $item->setItemStatusHistory($itemStatusHistory);
226
+ $item->setUpdatedBy('User');
227
+ $item->setUpdatedAt(Mage::getModel('core/date')->gmtDate());
228
+ $item->save();
229
+ if($data['amosoft_item_status']==$item->getAmosoftItemStatus()){
230
+ $data['msg'] = $item->getSku().' status successfully changed to '.$data['amosoft_item_status'];
231
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__($data['msg']));
232
+ }else{
233
+ $data['msg'] = $item->getSku().' status unable to change to '.$data['amosoft_item_status'];
234
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__($data['msg']));
235
+ }
236
+
237
+ }
238
+ }
239
+ if($data['amosoft_item_status'] == 'Transmitting'){
240
+ Mage::getModel('dropship/amosoft')->setupNotification();
241
+ }
242
+ $result = Mage::helper('core')->jsonEncode($data);
243
+ echo $result; exit;
244
+ Mage::app()->getResponse()->setBody($result);
245
+ }catch(Exception $e){
246
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
247
+ }
248
+ }
249
+ }else{
250
+ $data['msg'] = 'Unable to perform the required operation';
251
+ }
252
+ }
253
+
254
+ /**
255
+ * Acl check for admin
256
+ *
257
+ * @return bool
258
+ */
259
+ protected function _isAllowed()
260
+ {
261
+ return Mage::getSingleton('admin/session')->isAllowed('dropship/inventory');
262
+ }
263
+
264
+ }
app/code/local/Amosoft/Dropship/controllers/Adminhtml/InventoryController.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Adminhtml_InventoryController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ protected function _initAction()
14
+ {
15
+ $this->loadLayout()
16
+ ->_setActiveMenu('dropship/inventory')
17
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Inventory Manager'), Mage::helper('adminhtml')->__('Inventory Manager'));
18
+ return $this;
19
+ }
20
+
21
+ public function indexAction()
22
+ {
23
+ $this->_redirect('dropship/adminhtml_upload/index');
24
+ $this->_initAction()->renderLayout();
25
+ }
26
+
27
+ public function vendorsAction()
28
+ {
29
+ $this->loadLayout();
30
+ $this->getLayout()->getBlock("vendors_product_tab")->setProductId($this->getRequest()->getParam('id'));
31
+ $this->renderLayout();
32
+ }
33
+
34
+ public function vendorshistoryAction()
35
+ {
36
+ $this->loadLayout();
37
+ $this->getLayout()->getBlock("vendors_product_tab_history")->setProductId($this->getRequest()->getParam('id'));
38
+ $this->renderLayout();
39
+ }
40
+
41
+ /**
42
+ * suppplier grid for AJAX request
43
+ */
44
+ public function gridAction()
45
+ {
46
+ $this->getResponse()->setBody(
47
+ $this->getLayout()->createBlock('dropship/adminhtml_inventory_grid')->toHtml()
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Export vendor in csv format
53
+ */
54
+ public function exportCsvAction()
55
+ {
56
+ $fileName = 'vendor_inventory.csv';
57
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_inventory_grid')->getCsvFile();
58
+ $this->_prepareDownloadResponse($fileName, $content);
59
+ }
60
+
61
+ /**
62
+ * Export vendor in Excel format
63
+ */
64
+ public function exportXmlAction()
65
+ {
66
+ $fileName = 'vendor_inventory.xml';
67
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_inventory_grid')->getExcelFile($fileName);
68
+ $this->_prepareDownloadResponse($fileName, $content);
69
+ }
70
+
71
+ /**
72
+ * Acl check for admin
73
+ *
74
+ * @return bool
75
+ */
76
+ protected function _isAllowed()
77
+ {
78
+ return Mage::getSingleton('admin/session')->isAllowed('dropship/inventory');
79
+ }
80
+
81
+ }
app/code/local/Amosoft/Dropship/controllers/Adminhtml/RankingController.php ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+ class Amosoft_Dropship_Adminhtml_RankingController extends Mage_Adminhtml_Controller_Action {
10
+
11
+ protected function _initAction() {
12
+ $this->loadLayout ()->_setActiveMenu ( 'dropship/vendor_ranking' )->_addBreadcrumb ( Mage::helper ( 'adminhtml' )->__ ( 'Vendor Management' ), Mage::helper ( 'adminhtml' )->__ ( 'Vendor Management' ) );
13
+ return $this;
14
+ }
15
+
16
+ public function indexAction() {
17
+ $layout = $this->_initAction()->_title($this->__('Vendor Management'));
18
+ $layout->getLayout()->getBlock('head')->setCanLoadExtJs(false);
19
+ $layout->renderLayout();
20
+ }
21
+
22
+ public function popupAction() {
23
+ $this->loadLayout ();
24
+ $this->renderLayout ();
25
+ }
26
+
27
+ /**
28
+ * Ranking grid
29
+ */
30
+ public function gridAction() {
31
+ $this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'dropship/adminhtml_ranking_grid' )->toHtml () );
32
+ }
33
+
34
+ public function showhistoryAction() {
35
+ $this->loadLayout ();
36
+ $this->renderLayout ();
37
+ }
38
+
39
+ public function addNewVendorAction() {
40
+ $isSuccess = false;
41
+ $data = $this->getRequest ()->getPost ();
42
+ $arrVendor = array();
43
+ $vendorRankCollection = Mage::getModel ( 'dropship/ranking' );
44
+ $genrateVendorCode = $vendorRankCollection->getCollection()->addFieldToFilter('amosoft_vendor_code',array('like'=>'%MagVendID%'));
45
+
46
+ foreach($genrateVendorCode as $vendorCode)
47
+ {
48
+ if(preg_match('!\d+!', $vendorCode->getAmosoftVendorCode(), $matches)){
49
+ $arrVendor[] = (int) $matches[0];
50
+ }
51
+
52
+ }
53
+ $suffix = ((int) max($arrVendor) + 1);
54
+ $code = 'MagVendID'.$suffix;
55
+ $vendorRankCollection->setAmosoftVendorCode($code);
56
+ $vendorRankCollection->setRanking($data['rank']);
57
+ $vendorRankCollection->setAmosoftVendorName($data['name']);
58
+ $vendorRankCollection->setAmosoftVendorType('user');
59
+ $vendorRankCollection->setCreatedAt(now());
60
+ $vendorRankCollection->setUpdatedAt(now());
61
+ try{
62
+ $vendorRankCollection->save();
63
+ $isSuccess = true;
64
+ }catch ( Exception $e ) {
65
+ Mage::getSingleton ( 'adminhtml/session' )->addError( $e->getMessage () );
66
+ $isSuccess = false;
67
+ }
68
+ $result = array('success'=>$isSuccess,'message'=>$code);
69
+ $result = Mage::helper('core')->jsonEncode($result);
70
+ Mage::app()->getResponse()->setBody($result);
71
+ return;
72
+ }
73
+
74
+
75
+ public function saverankingAction() {
76
+ $vendorName = array();
77
+ $data = $this->getRequest ()->getPost ();
78
+
79
+ $tableName = $data['partent_save_table_input'];
80
+ $dropShip = json_decode((urldecode($data['dropship_data'])),true);
81
+ $nonDropShip = json_decode((urldecode($data['nondropship_data'])),true);
82
+ $vendorName = json_decode((urldecode($data['vendorname_data'])),true);
83
+ $vendorProductLink = json_decode((urldecode($data['vendorproductlink_data'])),true);
84
+ $modelRanking = Mage::getModel ( 'dropship/rankinglog' )->load($tableName,'label');
85
+ if (!$tableName || $modelRanking->getId()) {
86
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'dropship' )->__ ( 'Ranking Table Name Is Empty Or Already Exists' ) );
87
+ $this->_redirect ( '*/*/' );
88
+ return;
89
+ }
90
+
91
+ foreach($dropShip as $key=>$val){
92
+ if(!empty($dropShip)){
93
+ $this->_saveVendorRanking($key, $val, true);
94
+ }
95
+ }
96
+ foreach($nonDropShip as $k=>$v){
97
+ if(!empty($nonDropShip)){
98
+ $this->_saveVendorRanking($k, $v, false);
99
+ }
100
+ }
101
+ foreach($vendorName as $key=>$val){
102
+ if(!empty($vendorName)){
103
+ $this->_updateVendorName($val);
104
+ }
105
+ }
106
+ foreach ($vendorProductLink as $value) {
107
+ $this->saveProductLinking($value);
108
+ }
109
+ $result = $this->_saveTableRanking(trim($tableName));
110
+
111
+ Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'dropship' )->__ ( 'Vendor ranking saved successfully' ) );
112
+ $this->_redirect ( '*/*/' );
113
+ return;
114
+ }
115
+ protected function _saveVendorRanking($key, $val, $rank = false) {
116
+ try {
117
+ $model = Mage::getModel ( 'dropship/ranking' )->load ( $val['code'], 'amosoft_vendor_code' );
118
+ $model->setUpdatedAt(now());
119
+
120
+ if($rank)
121
+ $model->setIsDropship ('yes');
122
+ else
123
+ $model->setIsDropship ('no');
124
+
125
+ $model->setRanking ( ($rank) ? $key+1:0 );
126
+ $model->save ();
127
+ } catch ( Exception $e ) {
128
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
129
+ }
130
+ }
131
+
132
+ protected function _updateVendorName($val) {
133
+ try {
134
+ $model = Mage::getModel ( 'dropship/ranking' )->load ( $val['code'], 'amosoft_vendor_code' );
135
+ if($model->getAmosoftVendorCode())
136
+ $model->setAmosoftVendorName ($val['name'])->save();
137
+ Mage::getModel ( 'dropship/inventory' )->upDateVendorName($val);
138
+ } catch ( Exception $e ) {
139
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
140
+ }
141
+ }
142
+
143
+ protected function _saveTableRanking($tableName) {
144
+ $serializedArray = array ();
145
+ $model = Mage::getModel ( 'dropship/ranking' );
146
+ $modelRanking = Mage::getModel ( 'dropship/rankinglog' );
147
+ $collection = $model->getCollection ();
148
+ $collection->getSelect()->order('ranking asc');
149
+ if($collection->count() > 0){
150
+ foreach ( $collection as $value ) {
151
+ $serializedArray [] = array (
152
+ $value->getAmosoftVendorName (),
153
+ $value->getAmosoftVendorCode (),
154
+ $this->getAttributeCode($value->getLinkingAttribute()),
155
+ $value->getRanking (),
156
+ $value->getIsDropship()
157
+ );
158
+ }
159
+ $modelRanking->setRankingData ( serialize ( $serializedArray ) );
160
+ $modelRanking->setLabel ( trim ( $tableName ) );
161
+ $modelRanking->setCreatedAt(now());
162
+ try {
163
+ $modelRanking->save ();
164
+ } catch ( Exception $e ) {
165
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
166
+ }
167
+ }
168
+ return;
169
+ }
170
+ protected function getAttributeCode($code)
171
+ {
172
+ $helper = Mage::helper('dropship');
173
+ switch ($code) {
174
+ case $helper::AMOSOFT_PRODUCT_LINK_CODE_UPC:
175
+ return $helper::AMOSOFT_PRODUCT_LINK_UPC;
176
+ break;
177
+ case $helper::AMOSOFT_PRODUCT_LINK_CODE_MNP:
178
+ return $helper::AMOSOFT_PRODUCT_LINK_MNP;
179
+ break;
180
+ case $helper::AMOSOFT_PRODUCT_LINK_CODE_SKU:
181
+ return $helper::AMOSOFT_PRODUCT_LINK_SKU;
182
+ break;
183
+ default:
184
+ return $helper::AMOSOFT_PRODUCT_LINK_NONE;
185
+ }
186
+ }
187
+ protected function saveProductLinking($data)
188
+ {
189
+ if(empty($data))
190
+ return ;
191
+ try {
192
+ $model = Mage::getModel ( 'dropship/ranking' )->load ( $data['code'], 'amosoft_vendor_code' );
193
+ $model->setUpdatedAt(now());
194
+ $model->setLinkingAttribute($data['attr']);
195
+ $model->save ();
196
+ } catch ( Exception $e ) {
197
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
198
+ }
199
+ }
200
+
201
+ /**
202
+ * Acl check for admin
203
+ *
204
+ * @return bool
205
+ */
206
+ protected function _isAllowed()
207
+ {
208
+ return (Mage::getSingleton('admin/session')->isAllowed('dropship/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship/vendor_ranking'));
209
+ }
210
+ }
app/code/local/Amosoft/Dropship/controllers/Adminhtml/SourcingController.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Adminhtml_SourcingController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ protected function _initAction() {
14
+ $this->loadLayout()
15
+ ->_setActiveMenu('dropship/order_sourcing')
16
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Management'), Mage::helper('adminhtml')->__('Order Management'));
17
+
18
+ return $this;
19
+ }
20
+
21
+ public function indexAction() {
22
+ $this->_initAction()->renderLayout();
23
+ }
24
+
25
+ /**
26
+ * sourcing grid
27
+ */
28
+
29
+ public function sourcinggridAction() {
30
+ $this->_initAction()->_title($this->__('Order Management'));
31
+ $this->getLayout()->createBlock('dropship/adminhtml_sourcing_grid')->toHtml();
32
+ //$this->loadLayout()->renderLayout();
33
+ $this->renderLayout();
34
+
35
+ }
36
+ public function editAction() {
37
+ $id = $this->getRequest()->getParam('amosoft_item_id');
38
+ $model = Mage::getModel('dropship/orderitems')->load($id);
39
+
40
+ if ($model->getId()) {
41
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
42
+ if (!empty($data)) {
43
+ $model->setData($data);
44
+ }
45
+ Mage::register('sourcing_data', $model);
46
+
47
+ $this->loadLayout();
48
+ $this->_setActiveMenu('dropship/order_sourcing');
49
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
50
+ $this->_addContent($this->getLayout()->createBlock('dropship/adminhtml_sourcing_edit'))
51
+ ->_addLeft($this->getLayout()->createBlock('dropship/adminhtml_sourcing_edit_tabs'));
52
+ $this->renderLayout();
53
+ } else {
54
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Sourcing does not exist'));
55
+ $this->_redirect('*/*/sourcinggrid');
56
+ }
57
+ }
58
+ public function saveAction() {
59
+ if ($data = $this->getRequest()->getPost()) {
60
+ $vendorCode = $data['amosoft_vendor_code'];
61
+ $sku = $data['sku'];
62
+ $model = Mage::getModel('dropship/orderitems');
63
+ $model->load($this->getRequest()->getParam('amosoft_item_id'));
64
+ $order = Mage::getModel('sales/order')->load($model->getItemOrderId());
65
+ $orderStatus = $order->getStatus();
66
+ if($this->getRequest()->getParam('cancel') == 'item'){
67
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($model->load($this->getRequest()->getParam('amosoft_item_id')), 'Cancelled', $orderStatus);
68
+ $model->setAmosoftItemStatus('Cancelled');
69
+ $model->setUpdatedBy('User');
70
+ $model->setItemStatusHistory($itemStatusHistory);
71
+ try{
72
+ $model->save();
73
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('Item %s Cancelled Successfully ',$model->getSku()));
74
+
75
+ }catch(Exception $e){
76
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
77
+ }
78
+ $this->_redirect('*/*/sourcinggrid');
79
+ return;
80
+ }
81
+ if ($id = $this->getRequest()->getParam('amosoft_item_id')) {//the parameter name may be different
82
+ $model->load($id);
83
+ }
84
+
85
+ if(!$data['amosoft_vendor_code']){
86
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Under Processing By Amosoft Can Not Update %s Sku',$model->getSku()));
87
+ $this->_redirect('*/*/sourcinggrid');
88
+ return;
89
+ }
90
+ $itemStatusHistory = Mage::helper('dropship')->getSerialisedData($model->load($this->getRequest()->getParam('amosoft_item_id')), 'Transmitting', $orderStatus);
91
+ $arrData = $model->updateSourcingByUser(array('amosoft_vendor_code'=>$vendorCode,'product_sku'=>$sku, 'qty'=>$this->getRequest()->getParam('qty'), 'item_status_history'=>$itemStatusHistory));
92
+ $model->addData($arrData);
93
+ try {
94
+ $model->save();
95
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
96
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('Sourcing Updated For %s',$model->getSku()));
97
+
98
+ if ($this->getRequest()->getParam('back')) {
99
+ $this->_redirect('*/*/edit', array('amosoft_item_id' => $model->getId()));
100
+ return;
101
+ }
102
+ $this->_redirect('*/*/sourcinggrid');
103
+ return;
104
+ } catch (Exception $e) {
105
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
106
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
107
+ $this->_redirect('*/*/edit', array('amosoft_item_id' => $model->getId(), '_current'=>true));
108
+ return;
109
+ }
110
+ }
111
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Unable to save sourcing'));
112
+ $this->_redirect('*/*/sourcinggrid');
113
+ }
114
+
115
+ public function saveSoapApiAction()
116
+ {
117
+ $paramsArray = $this->getRequest()->getParams();
118
+ if(!empty($paramsArray['user_id']) && !empty($paramsArray['api_key'])){
119
+ Mage::getModel('api/user')->load($paramsArray['user_id'])->setApiKey($paramsArray['api_key'])->save();
120
+ if(is_null(Mage::getSingleton('adminhtml/session')->getNotification()))
121
+ Mage::getModel('dropship/amosoft')->send(null,array());
122
+ $result['message'] = 'password save successfully';
123
+ }else{
124
+ $result['message'] = 'can not save password';
125
+ }
126
+ $result['success'] = 1;
127
+ $result = Mage::helper('core')->jsonEncode($result);
128
+ Mage::app()->getResponse()->setBody($result);
129
+ }
130
+
131
+
132
+ /**
133
+ * Export vendor in csv format
134
+ */
135
+ public function exportCsvAction()
136
+ {
137
+ $fileName = 'sourcing.csv';
138
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_sourcing_grid')->getCsvFile();
139
+ $this->_prepareDownloadResponse($fileName, $content);
140
+ }
141
+
142
+ /**
143
+ * Export vendor in Excel format
144
+ */
145
+ public function exportXmlAction()
146
+ {
147
+ $fileName = 'sourcing.xml';
148
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_sourcing_grid')->getExcelFile($fileName);
149
+ $this->_prepareDownloadResponse($fileName, $content);
150
+ }
151
+
152
+ public function viewOrderItemHistoryAction()
153
+ {
154
+ $this->_title($this->__('dropship'))->_title($this->__('View History'));
155
+
156
+ $this->_initAction();
157
+ $itemId = $this->getRequest()->getParam('amosoft_item_id');
158
+ $orderItems = Mage::getModel( 'dropship/orderitems' )->load($itemId, 'item_id');
159
+
160
+ $this->_title(sprintf("Item Sku %s", $orderItems->getSku()));
161
+
162
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
163
+
164
+ $this->_addContent($this->getLayout()->createBlock('dropship/adminhtml_sourcing_history_view'))
165
+ ->_addLeft($this->getLayout()->createBlock('dropship/adminhtml_sourcing_history_view_tabs'));
166
+
167
+ $this->renderLayout();
168
+
169
+ }
170
+
171
+ /**
172
+ * Acl check for admin
173
+ *
174
+ * @return bool
175
+ */
176
+ protected function _isAllowed()
177
+ {
178
+ return Mage::getSingleton('admin/session')->isAllowed('dropship/order_sourcing');
179
+ }
180
+
181
+
182
+ }
app/code/local/Amosoft/Dropship/controllers/Adminhtml/UploadController.php ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ class Amosoft_Dropship_Adminhtml_UploadController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+
13
+ protected function _initAction()
14
+ {
15
+ $this->loadLayout()
16
+ ->_setActiveMenu('dropship/upload_vendor_product')
17
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('dropship'), Mage::helper('adminhtml')->__('Vendor Inventory'));
18
+ return $this;
19
+ }
20
+
21
+ public function indexAction()
22
+ {
23
+ $maxUploadSize = Mage::helper('importexport')->getMaxUploadSize();
24
+ $this->_getSession()->addNotice(
25
+ $this->__('Total size of uploadable files must not exceed %s', $maxUploadSize)
26
+ );
27
+ $this->_initAction()
28
+ ->_title($this->__('Vendor Inventory'))
29
+ ->_addBreadcrumb($this->__('Amosoft'), $this->__('Vendor Inventory'));
30
+ $this->renderLayout();
31
+ }
32
+ /**
33
+ * sourcing grid
34
+ */
35
+ public function gridAction()
36
+ {
37
+ $this->getResponse()->setBody(
38
+ $this->getLayout()->createBlock('dropship/adminhtml_inventory_grid')->toHtml()
39
+ );
40
+ }
41
+ public function uploadFileAction()
42
+ {
43
+ $data = $this->getRequest()->getPost();
44
+ $productSetupMode = ($data['productsetupmode']) ? $data['productsetupmode'] : 0;
45
+ if($productSetupMode)
46
+ {
47
+ $redirectUrl = '*/adminhtml_ranking/index';
48
+ }
49
+ else
50
+ {
51
+ $redirectUrl = '*/*/index';
52
+ }
53
+ if(Mage::helper('dropship')->isProcessRunning('bulk_assign')){
54
+ $this->_getSession()->addError($this->__('Bulk product setup is currently running please try again later'));
55
+ $this->_redirect($redirectUrl);
56
+ return;
57
+ }
58
+ if ($data) {
59
+ try {
60
+ $import = Mage::getModel('dropship/uploadvendor');
61
+ $validationResult = $import->setData($data)->uploadSource();
62
+ if(!$validationResult){
63
+ $this->initialize();
64
+ $import->parseCsv(Mage::registry('file_name'),$data['vendor']);
65
+ $this->_getSession()->addSuccess(Mage::helper('dropship')->__('File upload successfully '));
66
+ $this->finalize();
67
+ }else{
68
+ $this->_getSession()->addError(Mage::helper('dropship')->__('File cannot be uploaded '));
69
+ }
70
+ } catch (Exception $e) {
71
+ $this->_getSession()->addError($e->getMessage());
72
+ $this->_redirect($redirectUrl);
73
+ }
74
+ } elseif ($this->getRequest()->isPost() && empty($_FILES)) {
75
+ $this->_getSession()->addError($this->__('File was not uploaded'));
76
+ } else {
77
+ $this->_getSession()->addError($this->__('Data is invalid or file is not uploaded'));
78
+ }
79
+ $this->_redirect($redirectUrl);
80
+ }
81
+
82
+ protected function initialize(){
83
+ Mage::helper('dropship')->startProcess('manual_upload');
84
+ }
85
+
86
+ protected function finalize(){
87
+ Mage::helper('dropship')->finishProcess('manual_upload');
88
+ }
89
+
90
+ public function vendorsuploadhistoryAction()
91
+ {
92
+ $this->loadLayout();
93
+ $this->getLayout()->getBlock("vendors_product_upload_history");
94
+ $this->renderLayout();
95
+ }
96
+
97
+
98
+ public function editAction()
99
+ {
100
+ $id = $this->getRequest()->getParam('amosoft_item_id');
101
+ $model = Mage::getModel('dropship/orderitems')->load($id);
102
+ if ($model->getId()) {
103
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
104
+ if (!empty($data)) {
105
+ $model->setData($data);
106
+ }
107
+ Mage::register('sourcing_data', $model);
108
+ $this->loadLayout();
109
+ $this->_setActiveMenu('dropship/order_sourcing');
110
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
111
+ $this->_addContent($this->getLayout()->createBlock('dropship/adminhtml_sourcing_edit'))
112
+ ->_addLeft($this->getLayout()->createBlock('dropship/adminhtml_sourcing_edit_tabs'));
113
+ $this->renderLayout();
114
+ } else {
115
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Sourcing does not exist'));
116
+ $this->_redirect('*/*/sourcinggrid');
117
+ }
118
+ }
119
+
120
+
121
+ public function validateftpconnectionAction()
122
+ {
123
+ $paramsArray = $this->getRequest()->getParams();
124
+ $validateConnection = Mage::getModel('dropship/uploadvendor');
125
+ $result = $validateConnection->testFtpConnection($paramsArray['groups']['cron_settings_upload']['fields']);
126
+ $result = Mage::helper('core')->jsonEncode($result);
127
+ Mage::app()->getResponse()->setBody($result);
128
+
129
+ }
130
+
131
+ public function saveAction()
132
+ {
133
+ if ($data = $this->getRequest()->getPost()) {
134
+ $vendorCode = $data['amosoft_vendor_code'];
135
+ $sku = $data['sku'];
136
+ $model = Mage::getModel('dropship/orderitems');
137
+
138
+ if($this->getRequest()->getParam('cancel') == 'item'){
139
+ $model->load($this->getRequest()->getParam('amosoft_item_id'));
140
+ $model->setAmosoftItemStatus('Cancelled');
141
+ try{
142
+ $model->save();
143
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('Item %s Cancelled Successfully ',$model->getSku()));
144
+
145
+ }catch(Exception $e){
146
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
147
+ }
148
+ $this->_redirect('*/*/sourcinggrid');
149
+ return;
150
+ }
151
+ if ($id = $this->getRequest()->getParam('amosoft_item_id')) {//the parameter name may be different
152
+ $model->load($id);
153
+ }
154
+
155
+ if(!$data['amosoft_vendor_code']){
156
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Under Processing By Amosoft Can Not Update %s Sku',$model->getSku()));
157
+ $this->_redirect('*/*/sourcinggrid');
158
+ return;
159
+ }
160
+ $arrData = $model->updateSourcingByUser(array('amosoft_vendor_code'=>$vendorCode,'product_sku'=>$sku));
161
+ $model->addData($arrData);
162
+ try {
163
+ $model->save();
164
+ $model->updateOrderStatus($model->getItemOrderId(),$model->getItemId());
165
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
166
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship')->__('Sourcing Updated For %s',$model->getSku()));
167
+ if ($this->getRequest()->getParam('back')) {
168
+ $this->_redirect('*/*/edit', array('amosoft_item_id' => $model->getId()));
169
+ return;
170
+ }
171
+ $this->_redirect('*/*/sourcinggrid');
172
+ return;
173
+ } catch (Exception $e) {
174
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
175
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
176
+ $this->_redirect('*/*/edit', array('amosoft_item_id' => $model->getId(), '_current'=>true));
177
+ return;
178
+ }
179
+ }
180
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship')->__('Unable to save sourcing'));
181
+ $this->_redirect('*/*/sourcinggrid');
182
+ }
183
+
184
+ public function saveSoapApiAction()
185
+ {
186
+ $paramsArray = $this->getRequest()->getParams();
187
+ if(!empty($paramsArray['user_id']) && !empty($paramsArray['api_key'])){
188
+ $data = array(
189
+ 'scope' => 'default',
190
+ 'scope_id' => '0',
191
+ 'path' => 'amosoft_integration/integration/apipassword',
192
+ 'value' => $paramsArray['api_key'],
193
+
194
+ );
195
+ Mage::getModel('api/user')->load($paramsArray['user_id'])->setApiKey($paramsArray['api_key'])->save();
196
+ Mage::getModel('core/config_data')->setData($data)->save();
197
+ $result['message'] = 'password save successfully';
198
+ }else{
199
+ $result['message'] = 'can not save password';
200
+
201
+ }
202
+ $result['success'] = 1;
203
+ $result = Mage::helper('core')->jsonEncode($result);
204
+ Mage::app()->getResponse()->setBody($result);
205
+
206
+ }
207
+
208
+ /**
209
+ * download vendor product import file in csv format
210
+ */
211
+ public function DownloadAction()
212
+ {
213
+ $paramsArray = $this->getRequest()->getParams();
214
+ $isProductSetupMode = (isset($paramsArray['isproductsetupmode']) && $paramsArray['isproductsetupmode']) ? true : false;
215
+ $type = ($isProductSetupMode) ? 'setup' : 'upload';
216
+ $fileName = 'amosoft_supplier_product_'.$type.'.csv';
217
+ $content = Mage::getModel('dropship/uploadvendor')->getCsvFile($isProductSetupMode);
218
+ $this->_prepareDownloadResponse($fileName, $content);
219
+ $this->_redirect('*/*/index');
220
+
221
+ }
222
+
223
+ /* Bulk assignment vendor code to all product */
224
+
225
+ protected function _initSystem()
226
+ {
227
+ $this->_title($this->__('dropship'))
228
+ ->_title($this->__('Bulk vendor assignment'));
229
+ $vendorCode = $this->getRequest()->getParam('amosoft_vendor_code');
230
+ if (!$vendorCode) {
231
+ Mage::getSingleton('adminhtml/session')->addError(
232
+ $this->__('Please select a supplier code'));
233
+ $this->_redirect('*/*');
234
+ return false;
235
+ }
236
+ Mage::register('bulk_vendor_Code', $vendorCode);
237
+ return $this;
238
+ }
239
+ public function runAction()
240
+ {
241
+ $this->_initSystem();
242
+ $this->loadLayout();
243
+ $this->renderLayout();
244
+ }
245
+ public function batchRunAction()
246
+ {
247
+ if ($this->getRequest()->isPost()) {
248
+ $vendorCode = $this->getRequest()->getPost('vendor_code');
249
+ $rowIds = $this->getRequest()->getPost('rows');
250
+ if (!is_array($rowIds) || count($rowIds) < 1) {
251
+ return;
252
+ }
253
+ $vendorName = Mage::getModel('dropship/ranking')->load($vendorCode,'amosoft_vendor_code');
254
+ $errors = array();
255
+ $saved = 0;
256
+ $skuError = array();
257
+ $skuSuccuess = array();
258
+ if(!Mage::getSingleton('adminhtml/session')->getTerminateExecution()){
259
+ Mage::helper('dropship')->startProcess('bulk_assign');
260
+ }else
261
+ {
262
+ return;
263
+ }
264
+ foreach($rowIds as $sku){
265
+ $collection = Mage::getModel('dropship/inventory')->getCollection()->addFieldToFilter('product_sku',$sku)->addFieldToFilter('amosoft_vendor_code',$vendorCode);
266
+ $inventoryId = ($collection->getSize() > 0) ? $collection->getFirstItem()->getId() : '';
267
+ if(!$inventoryId)
268
+ {
269
+ $inventoryCollection = Mage::getModel('dropship/inventory');
270
+ $inventoryCollection->setAmosoftVendorCode($vendorCode);
271
+ $inventoryCollection->setAmosoftVendorName(($vendorName) ? $vendorName->getAmosoftVendorName() : '');
272
+ $inventoryCollection->setProductSku($sku);
273
+ $inventoryCollection->setAmosoftVendorSku($sku);
274
+ $inventoryCollection->setStock(0);
275
+ $inventoryCollection->setCost(0);
276
+ $inventoryCollection->setUpdatedAt(now());
277
+ $inventoryCollection->setCreatedAt(now());
278
+ try {
279
+ $inventoryCollection->save();
280
+ Mage::getModel('dropship/inventory')->_saveInventoryLog('add',array('amosoft_vendor_code'=>$vendorCode,'amosoft_vendor_name'=>($vendorName) ? $vendorName->getAmosoftVendorName() : '','product_sku'=>$sku,'cost'=>0,'stock'=>0,'updated_by'=>'bulk_setup'));
281
+ $saved ++;
282
+ $skuSuccuess[] = $sku;
283
+ } catch (Exception $e) {
284
+ $errors[] = $e->getMessage();
285
+ $skuError[] = $sku;
286
+ continue;
287
+ }
288
+ }else
289
+ {
290
+ $errors[] = Mage::helper('dropship')->__('Skip %s as supplier %s already assigned.',$sku,$vendorCode);
291
+ $skuError[] = $sku;
292
+ continue;
293
+ }
294
+ }
295
+ $result = array(
296
+ 'savedRows' => $saved,
297
+ 'errors' => $errors,
298
+ 'skuError' => $skuError,
299
+ 'skuSuccess'=>$skuSuccuess
300
+ );
301
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
302
+ }
303
+ }
304
+ public function batchFinishAction()
305
+ {
306
+ $exeuctionTerminated = $this->getRequest()->getParam('exeuctionTerminated');
307
+ if($exeuctionTerminated){
308
+ Mage::getSingleton('adminhtml/session')->setTerminateExecution(true);
309
+ Mage::helper('dropship')->finishProcess('bulk_assign');
310
+ }else
311
+ {
312
+ Mage::helper('dropship')->finishProcess('bulk_assign');
313
+ }
314
+ $result = array();
315
+ $data = $this->getRequest()->getPost();
316
+ Mage::getResourceModel('dropship/vendorimportlog')->insertlog($data['amosoft_vendor_code'],'Bulk-product-setup',$data['sucees_sku'],$data['errorSkuCount']);
317
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
318
+ }
319
+
320
+
321
+ public function terminateAction(){
322
+
323
+ Mage::helper('dropship')->finishProcess('manual_upload');
324
+ $result = array();
325
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
326
+ }
327
+
328
+ /**
329
+ * Export vendor in csv format
330
+ */
331
+ public function exportCsvAction()
332
+ {
333
+ $fileName = 'inventory.csv';
334
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_inventory_grid')->getCsvFile();
335
+ $this->_prepareDownloadResponse($fileName, $content);
336
+ }
337
+
338
+ /**
339
+ * Export vendor in Excel format
340
+ */
341
+ public function exportXmlAction()
342
+ {
343
+ $fileName = 'inventory.xml';
344
+ $content = $this->getLayout()->createBlock('dropship/adminhtml_inventory_grid')->getExcelFile($fileName);
345
+ $this->_prepareDownloadResponse($fileName, $content);
346
+ }
347
+
348
+ public function exportErrorCsvAction()
349
+ {
350
+ $params = $this->getRequest()->getParams();
351
+ $filename = 'upload_error.csv';
352
+ $content = Mage::helper('dropship')->generateErrorList($params);
353
+ if($content['error'])
354
+ return $this->getResponse()->setRedirect($this->getUrl('*/*/vendorsuploadhistory'));
355
+ $this->_prepareDownloadResponse($filename, $content);
356
+ }
357
+
358
+ /**
359
+ * Delete log action
360
+ */
361
+ public function deleteAction()
362
+ {
363
+ if ($id = $this->getRequest()->getParam('id')) {
364
+ $tableName = Mage::getSingleton ( 'core/resource' )->getTableName ('dropship/vendor_import_log');
365
+ $connection = Mage::getSingleton ('core/resource')->getConnection ('core_read');
366
+ $select = $connection->select()->from($tableName)->where('error_id=?', $id);
367
+ $connection->fetchRow($select);
368
+ try {
369
+ $connection->delete($tableName,array('error_id'=>$id));
370
+ $this->_getSession()->addSuccess($this->__('The log has been deleted.'));
371
+ } catch (Exception $e) {
372
+ $this->_getSession()->addError($e->getMessage());
373
+ }
374
+ }
375
+ $this->getResponse()
376
+ ->setRedirect($this->getUrl('*/*/vendorsuploadhistory', array('store'=>$this->getRequest()->getParam('store'))));
377
+ }
378
+
379
+ /**
380
+ * Acl check for admin
381
+ *
382
+ * @return bool
383
+ */
384
+ protected function _isAllowed()
385
+ {
386
+ return Mage::getSingleton('admin/session')->isAllowed('dropship/inventory');
387
+ }
388
+
389
+ }
app/code/local/Amosoft/Dropship/data/dropship_setup/data-install-1.0.3.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ $coreConfigData = array(
10
+ array(
11
+ 'scope' => 'default',
12
+ 'scope_id' => '0',
13
+ 'path' => 'amosoft_integration/integration/notificationstatus',
14
+ 'value' => '0',
15
+
16
+ ),
17
+ array(
18
+ 'scope' => 'default',
19
+ 'scope_id' => '0',
20
+ 'path' => 'amosoft_integration/integration/dateofinstalltion',
21
+ 'value' => date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())),
22
+
23
+ ),
24
+ array(
25
+ 'scope' => 'default',
26
+ 'scope_id' => '0',
27
+ 'path' => 'amosoft_integration/integration/magento_version',
28
+ 'value' => Mage::getVersion()
29
+
30
+ ));
31
+
32
+ /**
33
+ * Insert default blocks
34
+ */
35
+ foreach ($coreConfigData as $data) {
36
+
37
+ Mage::getModel('core/config_data')->setData($data)->save();
38
+ }
39
+
40
+ /* Add attribute to catalog default set */
41
+
42
+ /*
43
+ $eavModel=Mage::getModel('eav/entity_setup','core_setup');
44
+ $attributeId=$eavModel->getAttribute('catalog_product','manufacturer');
45
+ $attributeSetId=$eavModel->getAttributeSetId('catalog_product','Default');
46
+ //Get attribute group info
47
+ $attributeGroupId=$eavModel->getAttributeGroup('catalog_product',$attributeSetId,'General');
48
+ //add attribute to a set
49
+ if(!empty($attributeId) && !empty($attributeId) && $attributeSetId)
50
+ $eavModel->addAttributeToSet('catalog_product',$attributeSetId,$attributeGroupId['attribute_group_id'],$attributeId['attribute_id']);
51
+ */
52
+ Mage::getModel('dropship/ranking')->addPreDefineVendorList();
53
+
54
+
55
+
app/code/local/Amosoft/Dropship/data/dropship_setup/data-upgrade-1.0.3-1.0.4.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+
9
+ $updateddata = array(
10
+ 'scope' => 'default',
11
+ 'scope_id' => '0',
12
+ 'path' => 'amosoft_integration/integration/magento_base_url',
13
+ 'value' => Mage::getBaseUrl()
14
+
15
+ );
16
+
17
+ try {
18
+
19
+ Mage::getModel('core/config_data')->load('amosoft_integration/integration/magento_base_url','path')->setData($updateddata)->save();
20
+ }
21
+ catch (Exception $e) {
22
+ echo $e->getMessage();
23
+ return;
24
+ }
25
+
26
+ /* update order state */
27
+
28
+ /* $orderStatuses = array('lb_ready_to_source'=>'Ready to Source');
29
+ Mage::getModel('dropship/amosoft')->updateOrderState($orderStatuses); */
30
+
31
+
32
+
33
+ /* If compiler is enabled than we need to run the compilation */
34
+
35
+ /*if (defined('COMPILER_INCLUDE_PATH')) {
36
+ try {
37
+ Mage::getModel('compiler/process')->run();
38
+ Mage::getSingleton('adminhtml/session')->addSuccess(
39
+ Mage::helper('compiler')->__('The compilation has completed.')
40
+ );
41
+ } catch (Mage_Core_Exception $e) {
42
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
43
+ } catch (Exception $e) {
44
+ Mage::getSingleton('adminhtml/session')->addError(
45
+ Mage::helper('compiler')->__('Compilation error')
46
+ );
47
+ }
48
+ }
49
+ */
50
+ /* Load default values of Sourcing Schedule Cron Jobs*/
51
+ $coreConfigData = array(
52
+ array(
53
+ 'scope' => 'default',
54
+ 'scope_id' => '0',
55
+ 'path' => 'amosoft_sourcing/cron_settings/sourcing_time',
56
+ 'value' => '-2,10',
57
+
58
+ ),
59
+ array(
60
+ 'scope' => 'default',
61
+ 'scope_id' => '0',
62
+ 'path' => 'amosoft_sourcing/cron_settings/backorder_time',
63
+ 'value' => '-2,15',
64
+
65
+ ),
66
+ array(
67
+ 'scope' => 'default',
68
+ 'scope_id' => '0',
69
+ 'path' => 'crontab/jobs/amosoft_dropship/schedule/cron_expr',
70
+ 'value' => '*/10 * * * *',
71
+
72
+ ),
73
+ array(
74
+ 'scope' => 'default',
75
+ 'scope_id' => '0',
76
+ 'path' => 'crontab/jobs/amosoft_dropship/run/model',
77
+ 'value' => 'dropship/observer::amosoftSourcing',
78
+ ),
79
+ array(
80
+ 'scope' => 'default',
81
+ 'scope_id' => '0',
82
+ 'path' => 'crontab/jobs/amosoft_backorder/schedule/cron_expr',
83
+ 'value' => '*/15 * * * *',
84
+ ),
85
+ array(
86
+ 'scope' => 'default',
87
+ 'scope_id' => '0',
88
+ 'path' => 'crontab/jobs/amosoft_backorder/run/model',
89
+ 'value' => 'dropship/observer::amosoftBackorder',
90
+ )
91
+
92
+
93
+
94
+ );
95
+
96
+ /**
97
+ * Insert default blocks
98
+ */
99
+ foreach ($coreConfigData as $data) {
100
+ if(!Mage::getModel('core/config_data')->load($data['path'],'path')->getData()){
101
+ Mage::getModel('core/config_data')->setData($data)->save();
102
+ }
103
+ }
104
+
app/code/local/Amosoft/Dropship/data/dropship_setup/data-upgrade-1.0.4-1.0.5.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ $coreConfigData = array(
9
+ array(
10
+ 'scope' => 'default',
11
+ 'scope_id' => '0',
12
+ 'path' => 'amosoft_sourcing/cron_settings/backorder_time',
13
+ 'value' => '-1,0',
14
+
15
+ ),
16
+ array(
17
+ 'scope' => 'default',
18
+ 'scope_id' => '0',
19
+ 'path' => 'amosoft_sourcing/cron_settings_upload/time',
20
+ 'value' => '23,59',
21
+
22
+ ),
23
+ array(
24
+ 'scope' => 'default',
25
+ 'scope_id' => '0',
26
+ 'path' => 'crontab/jobs/amosoft_backorder/schedule/cron_expr',
27
+ 'value' => '0 * * * *',
28
+ ),
29
+ array(
30
+ 'scope' => 'default',
31
+ 'scope_id' => '0',
32
+ 'path' => 'crontab/jobs/amosoft_uploadvendor/schedule/cron_expr',
33
+ 'value' => '59 23 * * *',
34
+ ),
35
+ array(
36
+ 'scope' => 'default',
37
+ 'scope_id' => '0',
38
+ 'path' => 'crontab/jobs/amosoft_uploadvendor/run/model',
39
+ 'value' => 'dropship/observer::ftpParseCsv',
40
+ )
41
+
42
+ );
43
+
44
+ /**
45
+ * Insert default blocks
46
+ */
47
+ foreach ($coreConfigData as $data) {
48
+ Mage::getModel('core/config_data')->setData($data)->save();
49
+ }
app/code/local/Amosoft/Dropship/data/dropship_setup/data-upgrade-1.0.5-1.0.6.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ $collectionSize = (Mage::getModel('dropship/inventory')->getCollection()->getSize() >= 1) ? 1 : '';
9
+ $coreConfigData = array(
10
+ array(
11
+ 'scope' => 'default',
12
+ 'scope_id' => '0',
13
+ 'path' => 'amosoft/notification/vendor_setup',
14
+ 'value' => $collectionSize,
15
+
16
+ )
17
+
18
+ );
19
+
20
+ /**
21
+ * Insert default blocks
22
+ */
23
+ foreach ($coreConfigData as $data) {
24
+ Mage::getModel('core/config_data')->setData($data)->save();
25
+ }
app/code/local/Amosoft/Dropship/etc/adminhtml.xml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <amosoft_integration translate="title" module="dropship">
12
+ <title>General Information</title>
13
+ <sort_order>1</sort_order>
14
+ </amosoft_integration>
15
+ <amosoft_sourcing translate="title" module="dropship">
16
+ <title>Sourcing Section</title>
17
+ <sort_order>2</sort_order>
18
+ </amosoft_sourcing>
19
+ <amosoft_cron translate="title" module="dropship">
20
+ <title>Cron Settings</title>
21
+ <sort_order>2</sort_order>
22
+ </amosoft_cron>
23
+ </children>
24
+ </config>
25
+ </children>
26
+ </system>
27
+ <dropship translate="title" module="dropship">
28
+ <title>amosoft</title>
29
+ <sort_order>91</sort_order>
30
+ <children>
31
+ <suppliers translate="title">
32
+ <title>Vendor</title>
33
+ </suppliers>
34
+ <inventory translate="title">
35
+ <title>Vendor/Supplier Inventory</title>
36
+ </inventory>
37
+ <vendor_ranking translate="title">
38
+ <title>Vendor/Supplier Ranking</title>
39
+ </vendor_ranking>
40
+ <order_sourcing translate="title">
41
+ <title>Vendor/Supplier Sourcing</title>
42
+ </order_sourcing>
43
+ <!-- <bar_report>
44
+ <title>Activity Report</title>
45
+ </bar_report> -->
46
+ <integration translate="title">
47
+ <title>Vendor/Supplier Information</title>
48
+ </integration>
49
+ </children>
50
+ </dropship>
51
+ </children>
52
+ </admin>
53
+ </resources>
54
+ </acl>
55
+
56
+ <menu>
57
+ <dropship translate="title" module="dropship">
58
+ <title>NET Dropship</title>
59
+ <sort_order>91</sort_order>
60
+ <children>
61
+ <inventory translate="title">
62
+ <title>Vendor/Supplier Inventory</title>
63
+ <action>amosoft/adminhtml_upload</action>
64
+ <sort_order>12</sort_order>
65
+ </inventory>
66
+ <vendor_ranking translate="title">
67
+ <title>Vendor/Supplier Management</title>
68
+ <action>amosoft/adminhtml_ranking</action>
69
+ <sort_order>13</sort_order>
70
+ </vendor_ranking>
71
+ <order_sourcing translate="title">
72
+ <title>Order Management</title>
73
+ <action>amosoft/adminhtml_sourcing/sourcinggrid</action>
74
+ <sort_order>11</sort_order>
75
+ </order_sourcing>
76
+ <!-- <bar_report translate="title">
77
+ <title>Activity Monitor</title>
78
+ <action>amosoft/adminhtml_report/activitymonitor</action>
79
+ <sort_order>14</sort_order>
80
+ </bar_report> -->
81
+ <amosoft_integration translate="title">
82
+ <title>Getting Started</title>
83
+ <action>adminhtml/system_config/edit/section/amosoft_integration</action>
84
+ <sort_order>16</sort_order>
85
+ </amosoft_integration>
86
+ <amosoft_sourcing translate="title">
87
+ <title>Configuration/Setup</title>
88
+ <action>adminhtml/system_config/edit/section/amosoft_sourcing</action>
89
+ <sort_order>15</sort_order>
90
+ </amosoft_sourcing>
91
+ <!-- <upload_vendor_product translate="title">
92
+ <title>Upload Vendor Product</title>
93
+ <action>dropship/adminhtml_upload/index</action>
94
+ <sort_order>17</sort_order>
95
+ </upload_vendor_product> -->
96
+ </children>
97
+ </dropship>
98
+ </menu>
99
+ </config>
app/code/local/Amosoft/Dropship/etc/api.xml ADDED
@@ -0,0 +1,442 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * @category Mage
7
+ * @package Mage_Sales
8
+ */
9
+ -->
10
+ <config>
11
+ <api>
12
+ <resources>
13
+ <sales_order translate="title" module="sales">
14
+ <model>sales/order_api</model>
15
+ <title>Order API</title>
16
+ <acl>sales/order</acl>
17
+ <methods>
18
+ <list translate="title" module="sales">
19
+ <title>Retrieve list of orders by filters</title>
20
+ <method>items</method>
21
+ <acl>sales/order/info</acl>
22
+ </list>
23
+ <info translate="title" module="sales">
24
+ <title>Retrieve order information</title>
25
+ <acl>sales/order/info</acl>
26
+ </info>
27
+ <addComment translate="title" module="sales">
28
+ <title>Add comment to order</title>
29
+ <acl>sales/order/change</acl>
30
+ </addComment>
31
+ <hold translate="title" module="sales">
32
+ <title>Hold order</title>
33
+ <acl>sales/order/change</acl>
34
+ </hold>
35
+ <unhold translate="title" module="sales">
36
+ <title>Unhold order</title>
37
+ <acl>sales/order/change</acl>
38
+ </unhold>
39
+ <updateItemStatus translate="title" module="fulfillment">
40
+ <title>updateItemStatus</title>
41
+ <acl>sales/order/updateitemstatus</acl>
42
+ </updateItemStatus>
43
+ <getAmosoftOrderByItemStatus>
44
+ <title>getAmosoftOrderByItemStatus</title>
45
+ <acl>sales/order/getamosoftorderbyitemstatus</acl>
46
+ </getAmosoftOrderByItemStatus>
47
+ <setAmosoftOrderItemStatus>
48
+ <title>setAmosoftOrderItemStatus</title>
49
+ <acl>sales/order/setamosoftorderitemstatus</acl>
50
+ </setAmosoftOrderItemStatus>
51
+
52
+ </methods>
53
+ <faults module="sales">
54
+ <not_exists>
55
+ <code>100</code>
56
+ <message>Requested order not exists.</message>
57
+ </not_exists>
58
+ <filters_invalid>
59
+ <code>101</code>
60
+ <message>Invalid filters given. Details in error message.</message>
61
+ </filters_invalid>
62
+ <data_invalid>
63
+ <code>102</code>
64
+ <message>Invalid data given. Details in error message.</message>
65
+ </data_invalid>
66
+ <status_not_changed>
67
+ <code>103</code>
68
+ <message>Order status not changed. Details in error message.</message>
69
+ </status_not_changed>
70
+ <invaild_store>
71
+ <code>104</code>
72
+ <message>Invaild Store Id</message>
73
+ </invaild_store>
74
+ </faults>
75
+ </sales_order>
76
+ <dropship translate="title" module="dropship">
77
+ <model>dropship/order_dropship_api</model>
78
+ <title>Custom API </title>
79
+ <methods>
80
+ <getAmosoftInvoices translate="title" module="dropship">
81
+ <title>Amosoft Invoices</title>
82
+ <method>getAmosoftInvoices</method>
83
+ </getAmosoftInvoices>
84
+ <createAmosoftShipment translate="title" module="dropship">
85
+ <title>Amosoft Shipment</title>
86
+ </createAmosoftShipment>
87
+ <getAmosoftShipments translate="title" module="dropship">
88
+ <title>Amosoft Shipment</title>
89
+ </getAmosoftShipments>
90
+ <addShippingCharges translate="title" module="dropship">
91
+ <title>Amosoft Invoice</title>
92
+ </addShippingCharges>
93
+ <getAmosoftSupplierInventory translate="title" module="dropship">
94
+ <title>Amosoft Supplier Inventory</title>
95
+ </getAmosoftSupplierInventory>
96
+ <updateAmosoftInventory translate="title" module="dropship">
97
+ <title>Amosoft Update Supplier Inventory</title>
98
+ </updateAmosoftInventory>
99
+ <addSupplierToProduct translate="title" module="dropship">
100
+ <title>Amosoft Add Supplier to Product</title>
101
+ </addSupplierToProduct>
102
+ </methods>
103
+ <faults module="dropship">
104
+ <data_invalid>100
105
+ <message>Invalid data</message>
106
+ </data_invalid>
107
+ </faults>
108
+ </dropship>
109
+ <sales_order_shipment>
110
+ <title>Shipment API</title>
111
+ <model>sales/order_shipment_api</model>
112
+ <acl>sales/order/shipment</acl>
113
+ <methods>
114
+ <list translate="title" module="sales">
115
+ <title>Retrieve list of shipments by filters</title>
116
+ <method>items</method>
117
+ <acl>sales/order/shipment/info</acl>
118
+ </list>
119
+ <info translate="title" module="sales">
120
+ <title>Retrieve shipment information</title>
121
+ <acl>sales/order/shipment/info</acl>
122
+ </info>
123
+ <sendInfo translate="title" module="sales">
124
+ <title>Send shipment info</title>
125
+ <acl>sales/order/shipment/send</acl>
126
+ </sendInfo>
127
+ <create translate="title" module="sales">
128
+ <title>Create new shipment for order</title>
129
+ <acl>sales/order/shipment/create</acl>
130
+ </create>
131
+ <addComment translate="title" module="sales">
132
+ <title>Add new comment to shipment</title>
133
+ <acl>sales/order/shipment/comment</acl>
134
+ </addComment>
135
+ <addTrack translate="title" module="sales">
136
+ <title>Add new tracking number</title>
137
+ <acl>sales/order/shipment/track</acl>
138
+ </addTrack>
139
+ <removeTrack translate="title" module="sales">
140
+ <title>Remove tracking number</title>
141
+ <acl>sales/order/shipment/track</acl>
142
+ </removeTrack>
143
+ <getCarriers>
144
+ <title>Retrieve list of allowed carriers for order</title>
145
+ </getCarriers>
146
+ </methods>
147
+ <faults module="sales">
148
+ <not_exists>
149
+ <code>100</code>
150
+ <message>Requested shipment not exists.</message>
151
+ </not_exists>
152
+ <filters_invalid>
153
+ <code>101</code>
154
+ <message>Invalid filters given. Details in error message.</message>
155
+ </filters_invalid>
156
+ <data_invalid>
157
+ <code>102</code>
158
+ <message>Invalid data given. Details in error message.</message>
159
+ </data_invalid>
160
+ <order_not_exists>
161
+ <code>103</code>
162
+ <message>Requested order not exists.</message>
163
+ </order_not_exists>
164
+ <track_not_exists>
165
+ <code>104</code>
166
+ <message>Requested tracking not exists.</message>
167
+ </track_not_exists>
168
+ <track_not_deleted>
169
+ <code>105</code>
170
+ <message>Tracking not deleted. Details in error message.</message>
171
+ </track_not_deleted>
172
+ </faults>
173
+ </sales_order_shipment>
174
+ <sales_order_invoice>
175
+ <title>Invoice API</title>
176
+ <model>sales/order_invoice_api</model>
177
+ <acl>sales/order/invoice</acl>
178
+ <methods>
179
+ <list translate="title" module="sales">
180
+ <title>Retrieve list of invoices by filters</title>
181
+ <method>items</method>
182
+ <acl>sales/order/invoice/info</acl>
183
+ </list>
184
+ <info translate="title" module="sales">
185
+ <title>Retrieve invoice information</title>
186
+ <acl>sales/order/invoice/info</acl>
187
+ </info>
188
+ <create translate="title" module="sales">
189
+ <title>Create new invoice for order</title>
190
+ <acl>sales/order/invoice/create</acl>
191
+ </create>
192
+ <addComment translate="title" module="sales">
193
+ <title>Add new comment to shipment</title>
194
+ <acl>sales/order/invoice/comment</acl>
195
+ </addComment>
196
+ <capture translate="title" module="sales">
197
+ <title>Capture invoice</title>
198
+ <acl>sales/order/invoice/capture</acl>
199
+ </capture>
200
+ <void translate="title" module="sales">
201
+ <title>Void invoice</title>
202
+ <acl>sales/order/invoice/void</acl>
203
+ </void>
204
+ <cancel translate="title" module="sales">
205
+ <title>Cancel invoice</title>
206
+ <acl>sales/order/invoice/cancel</acl>
207
+ </cancel>
208
+ </methods>
209
+ <faults module="sales">
210
+ <not_exists>
211
+ <code>100</code>
212
+ <message>Requested invoice does not exist.</message>
213
+ </not_exists>
214
+ <invalid_filter>
215
+ <code>101</code>
216
+ <message>Invalid filter given. Details in error message.</message>
217
+ </invalid_filter>
218
+ <data_invalid>
219
+ <code>102</code>
220
+ <message>Invalid data given. Details in error message.</message>
221
+ </data_invalid>
222
+ <order_not_exists>
223
+ <code>103</code>
224
+ <message>Requested order not exists.</message>
225
+ </order_not_exists>
226
+ <status_not_changed>
227
+ <code>104</code>
228
+ <message>Invoice status not changed</message>
229
+ </status_not_changed>
230
+ </faults>
231
+ </sales_order_invoice>
232
+ <sales_order_creditmemo>
233
+ <title>Credit memo API</title>
234
+ <model>sales/order_creditmemo_api</model>
235
+ <acl>sales/order/creditmemo</acl>
236
+ <methods>
237
+ <list translate="title" module="sales">
238
+ <title>Retrieve list of credit memos by filters</title>
239
+ <method>items</method>
240
+ <acl>sales/order/creditmemo/list</acl>
241
+ </list>
242
+ <info translate="title" module="sales">
243
+ <title>Retrieve credit memo information</title>
244
+ <acl>sales/order/creditmemo/info</acl>
245
+ </info>
246
+ <create translate="title" module="sales">
247
+ <title>Create new credit memo for order</title>
248
+ <acl>sales/order/creditmemo/create</acl>
249
+ </create>
250
+ <addComment translate="title" module="sales">
251
+ <title>Add new comment to credit memo</title>
252
+ <acl>sales/order/creditmemo/comment</acl>
253
+ </addComment>
254
+ <cancel translate="title" module="sales">
255
+ <title>Cancel credit memo</title>
256
+ <acl>sales/order/creditmemo/cancel</acl>
257
+ </cancel>
258
+ </methods>
259
+ <faults module="sales">
260
+ <not_exists>
261
+ <code>100</code>
262
+ <message>Requested credit memo does not exist</message>
263
+ </not_exists>
264
+ <invalid_filter>
265
+ <code>101</code>
266
+ <message>Invalid filter given. Details in error message</message>
267
+ </invalid_filter>
268
+ <data_invalid>
269
+ <code>102</code>
270
+ <message>Invalid data given. Details in error message</message>
271
+ </data_invalid>
272
+ <order_not_exists>
273
+ <code>103</code>
274
+ <message>Requested order does not exist</message>
275
+ </order_not_exists>
276
+ <status_not_changed>
277
+ <code>104</code>
278
+ <message>Credit memo status not changed</message>
279
+ </status_not_changed>
280
+ <cannot_refund_to_storecredit>
281
+ <code>105</code>
282
+ <message>Money can not be refunded to the store credit account as order was created by guest</message>
283
+ </cannot_refund_to_storecredit>
284
+ <cannot_create_creditmemo>
285
+ <code>106</code>
286
+ <message>Credit memo for requested order can not be created.</message>
287
+ </cannot_create_creditmemo>
288
+ </faults>
289
+ </sales_order_creditmemo>
290
+ <dropship_versions>
291
+ <title>dropship</title>
292
+ <model>dropship/versions_api</model>
293
+ <acl>dropship/versions</acl>
294
+ <methods>
295
+
296
+ <getdropshipversion translate="title" module="dropship">
297
+ <title>getdropshipversion</title>
298
+ <title>get dropship vesion</title>
299
+ <method>getdropshipversion</method>
300
+
301
+ </getdropshipversion>
302
+
303
+ </methods>
304
+ </dropship_versions>
305
+ </resources>
306
+ <resources_alias>
307
+ <order>sales_order</order>
308
+ <order_shipment>sales_order_shipment</order_shipment>
309
+ <order_invoice>sales_order_invoice</order_invoice>
310
+ <order_creditmemo>sales_order_creditmemo</order_creditmemo>
311
+ <versions>dropship_versions</versions>
312
+ </resources_alias>
313
+ <v2>
314
+ <resources_function_prefix>
315
+ <order>salesOrder</order>
316
+ <order_shipment>salesOrderShipment</order_shipment>
317
+ <order_invoice>salesOrderInvoice</order_invoice>
318
+ <order_creditmemo>salesOrderCreditmemo</order_creditmemo>
319
+ <dropship_versions>versions</dropship_versions>
320
+ </resources_function_prefix>
321
+ </v2>
322
+ <rest>
323
+ <mapping>
324
+ <sales_order>
325
+ <delete>
326
+ <method>cancel</method>
327
+ </delete>
328
+ <post>
329
+ <resource>cart</resource>
330
+ <method>order</method>
331
+ </post>
332
+ </sales_order>
333
+ <sales_order_invoice>
334
+ <delete>
335
+ <method>cancel</method>
336
+ </delete>
337
+ </sales_order_invoice>
338
+ <sales_order_creditmemo>
339
+ <delete>
340
+ <method>cancel</method>
341
+ </delete>
342
+ </sales_order_creditmemo>
343
+ </mapping>
344
+ </rest>
345
+ <acl>
346
+ <resources>
347
+ <sales translate="title" module="sales">
348
+ <title>Sales</title>
349
+ <sort_order>2</sort_order>
350
+ <order translate="title" module="sales">
351
+ <title>Order</title>
352
+ <change translate="title" module="sales">
353
+ <title>Change status, add comments</title>
354
+ </change>
355
+ <info translate="title" module="sales">
356
+ <title>Retrieve orders info</title>
357
+ </info>
358
+ <updateitemstatus translate="title" module="sales">
359
+ <title>update Item Status</title>
360
+ </updateitemstatus>
361
+ <getamosoftorderbyitemstatus translate="title" module="sales">
362
+ <title>Retrive orders by item status</title>
363
+ </getamosoftorderbyitemstatus>
364
+ <setamosoftorderitemstatus translate="title" module="sales">
365
+ <title>Set order item status</title>
366
+ </setamosoftorderitemstatus>
367
+
368
+ <shipment translate="title" module="sales">
369
+ <title>Order shipments</title>
370
+ <create translate="title" module="sales">
371
+ <title>Create</title>
372
+ </create>
373
+ <comment translate="title" module="sales">
374
+ <title>Comments</title>
375
+ </comment>
376
+ <track translate="title" module="sales">
377
+ <title>Tracking</title>
378
+ </track>
379
+ <info translate="title" module="sales">
380
+ <title>Retrieve shipment info</title>
381
+ </info>
382
+ <send translate="title" module="sales">
383
+ <title>Send shipment info</title>
384
+ </send>
385
+
386
+ </shipment>
387
+ <invoice translate="title" module="sales">
388
+ <title>Order invoice</title>
389
+ <create translate="title" module="sales">
390
+ <title>Create</title>
391
+ </create>
392
+ <comment translate="title" module="sales">
393
+ <title>Comments</title>
394
+ </comment>
395
+ <capture translate="title" module="sales">
396
+ <title>Capture</title>
397
+ </capture>
398
+ <void translate="title" module="sales">
399
+ <title>Void</title>
400
+ </void>
401
+ <cancel translate="title" module="sales">
402
+ <title>Cancel</title>
403
+ </cancel>
404
+ <info translate="title" module="sales">
405
+ <title>Retrieve invoice info</title>
406
+ </info>
407
+ </invoice>
408
+ <creditmemo translate="title" module="sales">
409
+ <title>Order credit memo</title>
410
+ <create translate="title" module="sales">
411
+ <title>Create</title>
412
+ </create>
413
+ <comment translate="title" module="sales">
414
+ <title>Comments</title>
415
+ </comment>
416
+ <cancel translate="title" module="sales">
417
+ <title>Cancel</title>
418
+ </cancel>
419
+ <info translate="title" module="sales">
420
+ <title>Retrieve credit memo info</title>
421
+ </info>
422
+ <list translate="title" module="sales">
423
+ <title>Retrieve credit memo list</title>
424
+ </list>
425
+ </creditmemo>
426
+ </order>
427
+ </sales>
428
+ <dropship translate="title" module="dropship">
429
+ <title>dropship</title>
430
+ <sort_order>1</sort_order>
431
+ <versions translate="title" module="dropship">
432
+ <title>versions</title>
433
+ <sort_order>2000</sort_order>
434
+ <dropship translate="title" module="dropship">
435
+ <title>dropship</title>
436
+ </dropship>
437
+ </versions>
438
+ </dropship>
439
+ </resources>
440
+ </acl>
441
+ </api>
442
+ </config>
app/code/local/Amosoft/Dropship/etc/api2.xml ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * @category Mage
7
+ * @package Mage_Catalog
8
+ */
9
+ -->
10
+ <config>
11
+ <api2>
12
+ <resource_groups>
13
+ <dropship translate="title" module="api2">
14
+ <title>Amosoft</title>
15
+ <sort_order>30</sort_order>
16
+ <children>
17
+ <product_import translate="title" module="api2">
18
+ <title>Catalog</title>
19
+ <sort_order>50</sort_order>
20
+ </product_import>
21
+ <inventory_import translate="title" module="api2">
22
+ <title>Inventory</title>
23
+ <sort_order>51</sort_order>
24
+ </inventory_import>
25
+ </children>
26
+ </dropship>
27
+ </resource_groups>
28
+ <resources>
29
+ <import translate="title" module="api2">
30
+ <group>product_import</group>
31
+ <model>dropship/api2_product</model>
32
+ <working_model>catalog/product</working_model>
33
+ <title>Catalog Import</title>
34
+ <sort_order>10</sort_order>
35
+ <privileges>
36
+ <admin>
37
+ <create>1</create>
38
+ </admin>
39
+ <guest>
40
+ <create>1</create>
41
+ </guest>
42
+ </privileges>
43
+ <attributes translate="entity_id type_id attribute_set_id stock_data image_url is_saleable total_reviews_count url buy_now_url has_custom_options is_in_stock regular_price_with_tax regular_price_without_tax final_price_with_tax final_price_without_tax use_config_gift_message_available use_config_gift_wrapping_available url_key_create_redirect" module="api2">
44
+ <entity_id>Product ID</entity_id>
45
+ </attributes>
46
+ <entity_only_attributes>
47
+ <customer>
48
+ <read>
49
+ <has_custom_options>1</has_custom_options>
50
+ </read>
51
+ </customer>
52
+ <guest>
53
+ <read>
54
+ <has_custom_options>1</has_custom_options>
55
+ <tier_price>1</tier_price>
56
+ <total_reviews_count>1</total_reviews_count>
57
+ <url>1</url>
58
+ <buy_now_url>1</buy_now_url>
59
+ <has_custom_options>1</has_custom_options>
60
+ <is_in_stock>1</is_in_stock>
61
+ </read>
62
+ </guest>
63
+ </entity_only_attributes>
64
+ <exclude_attributes>
65
+ <customer>
66
+ <read>
67
+ <attribute_set_id>1</attribute_set_id>
68
+ </read>
69
+ </customer>
70
+ <guest>
71
+ <read>
72
+ <attribute_set_id>1</attribute_set_id>
73
+ </read>
74
+ </guest>
75
+ <admin>
76
+ <read>
77
+ <allow_open_amount>1</allow_open_amount>
78
+ </read>
79
+ <write>
80
+ <allow_open_amount>1</allow_open_amount>
81
+ </write>
82
+ </admin>
83
+ </exclude_attributes>
84
+ <routes>
85
+ <route_entity>
86
+ <route>/productsimport/:id</route>
87
+ <action_type>collection</action_type>
88
+ </route_entity>
89
+ <route_collection>
90
+ <route>/productsimport</route>
91
+ <action_type>collection</action_type>
92
+ </route_collection>
93
+
94
+ </routes>
95
+ <versions>1</versions>
96
+ </import>
97
+ <inventory_import translate="title" module="api2">
98
+ <group>inventory_import</group>
99
+ <model>dropship/api2_inventory</model>
100
+ <working_model>dropship/inventory</working_model>
101
+ <title>Inventory Import</title>
102
+ <sort_order>10</sort_order>
103
+ <privileges>
104
+ <admin>
105
+ <create>1</create>
106
+ </admin>
107
+ <guest>
108
+ <create>1</create>
109
+ </guest>
110
+ </privileges>
111
+ <attributes translate="entity_id type_id attribute_set_id stock_data image_url is_saleable total_reviews_count url buy_now_url has_custom_options is_in_stock regular_price_with_tax regular_price_without_tax final_price_with_tax final_price_without_tax use_config_gift_message_available use_config_gift_wrapping_available url_key_create_redirect" module="api2">
112
+ <id>id</id>
113
+ </attributes>
114
+ <entity_only_attributes>
115
+ <customer>
116
+ <read>
117
+ <has_custom_options>1</has_custom_options>
118
+ </read>
119
+ </customer>
120
+ <guest>
121
+ <read>
122
+ <has_custom_options>1</has_custom_options>
123
+ <tier_price>1</tier_price>
124
+ <total_reviews_count>1</total_reviews_count>
125
+ <url>1</url>
126
+ <buy_now_url>1</buy_now_url>
127
+ <has_custom_options>1</has_custom_options>
128
+ <is_in_stock>1</is_in_stock>
129
+ </read>
130
+ </guest>
131
+ </entity_only_attributes>
132
+ <exclude_attributes>
133
+ <customer>
134
+ <read>
135
+ <attribute_set_id>1</attribute_set_id>
136
+ </read>
137
+ </customer>
138
+ <guest>
139
+ <read>
140
+ <attribute_set_id>1</attribute_set_id>
141
+ </read>
142
+ </guest>
143
+ <admin>
144
+ <read>
145
+ <allow_open_amount>1</allow_open_amount>
146
+ </read>
147
+ <write>
148
+ <allow_open_amount>1</allow_open_amount>
149
+ </write>
150
+ </admin>
151
+ </exclude_attributes>
152
+ <routes>
153
+ <route_entity>
154
+ <route>/inventoryimport/:id</route>
155
+ <action_type>collection</action_type>
156
+ </route_entity>
157
+ <route_collection>
158
+ <route>/inventoryimport</route>
159
+ <action_type>collection</action_type>
160
+ </route_collection>
161
+
162
+ </routes>
163
+ <versions>1</versions>
164
+ </inventory_import>
165
+ </resources>
166
+ </api2>
167
+ </config>
app/code/local/Amosoft/Dropship/etc/config.xml ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Amosoft_Dropship>
5
+ <version>1.0.7</version>
6
+ </Amosoft_Dropship>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <dropship>
11
+ <class>Amosoft_Dropship_Block</class>
12
+ </dropship>
13
+ <adminhtml>
14
+ <rewrite>
15
+ <sales_order_view_items>Amosoft_Dropship_Block_Adminhtml_Sales_Order_View_Items</sales_order_view_items>
16
+ </rewrite>
17
+ </adminhtml>
18
+ </blocks>
19
+
20
+ <helpers>
21
+ <dropship>
22
+ <class>Amosoft_Dropship_Helper</class>
23
+ </dropship>
24
+ </helpers>
25
+ <models>
26
+ <dropship>
27
+ <class>Amosoft_Dropship_Model</class>
28
+ <resourceModel>dropship_resource</resourceModel>
29
+ </dropship>
30
+ <dropship_resource>
31
+ <class>Amosoft_Dropship_Model_Resource</class>
32
+ <entities>
33
+ <supplier>
34
+ <table>amosoft_vendor</table>
35
+ </supplier>
36
+ <inventory>
37
+ <table>amosoft_vendor_inventory</table>
38
+ </inventory>
39
+ <inventorylog>
40
+ <table>amosoft_vendor_inventory_log</table>
41
+ </inventorylog>
42
+ <ranking>
43
+ <table>amosoft_vendor_ranking</table>
44
+ </ranking>
45
+ <rankinglog>
46
+ <table>amosoft_vendor_rankinglog</table>
47
+ </rankinglog>
48
+ <ordersourcing>
49
+ <table>amosoft_sales_orders</table>
50
+ </ordersourcing>
51
+ <orderitems>
52
+ <table>amosoft_sales_orders_items</table>
53
+ </orderitems>
54
+ <uploadvendor>
55
+ <table>amosoft_vendor_product_import</table>
56
+ </uploadvendor>
57
+ <vendor_import_log>
58
+ <table>amosoft_vendor_product_import_log</table>
59
+ </vendor_import_log>
60
+ <tmpdata>
61
+ <table>amosoft_tmp_data</table>
62
+ </tmpdata>
63
+ <csvtmpdata>
64
+ <table>amosoft_tmp_csv_dump</table>
65
+ </csvtmpdata>
66
+ <vendor_import_log_desc>
67
+ <table>amosoft_vendor_product_import_log_description</table>
68
+ </vendor_import_log_desc>
69
+ </entities>
70
+ </dropship_resource>
71
+ <sales>
72
+ <rewrite>
73
+ <order_api>Amosoft_Dropship_Model_Order_Api</order_api>
74
+ </rewrite>
75
+ </sales>
76
+ <sales>
77
+ <rewrite>
78
+ <order_invoice>Amosoft_Dropship_Model_Order_Invoice</order_invoice>
79
+ </rewrite>
80
+ </sales>
81
+ <!-- <sales>
82
+ <rewrite>
83
+ <order_invoice_total_shipping>Amosoft_Dropship_Model_Sales_Order_Invoice_Total_Shipping</order_invoice_total_shipping>
84
+ </rewrite>
85
+ </sales> -->
86
+ </models>
87
+ <resources>
88
+ <dropship_setup>
89
+ <setup>
90
+ <module>Amosoft_Dropship</module>
91
+ <class>Amosoft_Dropship_Model_Resource_Setup</class>
92
+ </setup>
93
+ <connection>
94
+ <use>core_setup</use>
95
+ </connection>
96
+ </dropship_setup>
97
+ <dropship_write>
98
+ <connection>
99
+ <use>core_write</use>
100
+ </connection>
101
+ </dropship_write>
102
+ <dropship_read>
103
+ <connection>
104
+ <use>core_read</use>
105
+ </connection>
106
+ </dropship_read>
107
+ </resources>
108
+ <events>
109
+ <sales_order_place_after>
110
+ <observers>
111
+ <amosoft_invoice>
112
+ <class>dropship/observer</class>
113
+ <method>insertProcessOrder</method>
114
+ </amosoft_invoice>
115
+ </observers>
116
+ </sales_order_place_after>
117
+ <sales_order_shipment_save_before>
118
+ <observers>
119
+ <amosoft_shipmentemail_sales_order_shipment_save_before>
120
+ <type>singleton</type>
121
+ <class>dropship/observer</class>
122
+ <method>salesOrderShipmentSaveBefore</method>
123
+ </amosoft_shipmentemail_sales_order_shipment_save_before>
124
+ </observers>
125
+ </sales_order_shipment_save_before>
126
+ <sales_order_shipment_save_after>
127
+ <observers>
128
+ <amosoft_shipmentemail_sales_order_shipment_save_after>
129
+ <type>singleton</type>
130
+ <class>dropship/observer</class>
131
+ <method>salesOrderShipmentSaveAfter</method>
132
+ </amosoft_shipmentemail_sales_order_shipment_save_after>
133
+ </observers>
134
+ </sales_order_shipment_save_after>
135
+ <catalog_product_delete_after>
136
+ <observers>
137
+ <amosoft_catalog_product_delete_after>
138
+ <type>singleton</type>
139
+ <class>dropship/observer</class>
140
+ <method>catalogProductDeleteAfter</method>
141
+ </amosoft_catalog_product_delete_after>
142
+ </observers>
143
+ </catalog_product_delete_after>
144
+ </events>
145
+ <template>
146
+ <email>
147
+ <amosoft_email_email_template translate="label" module="dropship">
148
+ <label>amosoft</label>
149
+ <file>amosoft/amosoft.html</file>
150
+ <type>html</type>
151
+ </amosoft_email_email_template>
152
+ <amosoft_ftp_con_fail translate="label" module="dropship">
153
+ <label>amosoft ftp connection fail</label>
154
+ <file>amosoft/amosoft_ftp_con_fail.html</file>
155
+ <type>html</type>
156
+ </amosoft_ftp_con_fail>
157
+ <amosoft_order_notification translate="label" module="dropship">
158
+ <label>amosoft first order notification</label>
159
+ <file>amosoft/first_order_notification.html</file>
160
+ <type>html</type>
161
+ </amosoft_order_notification>
162
+ <amosoft_activty_report_staticstatus translate="label" module="dropship">
163
+ <label>static status report notification</label>
164
+ <file>amosoft/activity_report_staticstatus.html</file>
165
+ <type>html</type>
166
+ </amosoft_activty_report_staticstatus>
167
+ <amosoft_outdated_product_inventory>
168
+ <label>Outdated product inventory notification</label>
169
+ <file>amosoft/oudated_product_inventory_notification.html</file>
170
+ <type>html</type>
171
+ </amosoft_outdated_product_inventory>
172
+ <amosoft_productsetup_notification translate="label" module="dropship">
173
+ <label>amosoft first productsetup notification</label>
174
+ <file>amosoft/first_productsetup_notification.html</file>
175
+ <type>html</type>
176
+ </amosoft_productsetup_notification>
177
+ </email>
178
+ </template>
179
+
180
+ </global>
181
+
182
+ <admin>
183
+ <routers>
184
+ <amosoft>
185
+ <use>admin</use>
186
+ <args>
187
+ <module>Amosoft_Dropship</module>
188
+ <frontName>amosoft</frontName>
189
+ </args>
190
+ </amosoft>
191
+ </routers>
192
+ </admin>
193
+ <adminhtml>
194
+ <layout>
195
+ <updates>
196
+ <dropship>
197
+ <file>amosoftdropship.xml</file>
198
+ </dropship>
199
+ </updates>
200
+ </layout>
201
+ <translate>
202
+ <modules>
203
+ <Amosoft_Dropship>
204
+ <files>
205
+ <default>Amosoft_Dropship.csv</default>
206
+ </files>
207
+ </Amosoft_Dropship>
208
+ </modules>
209
+ </translate>
210
+ <events>
211
+ <catalog_product_save_after>
212
+ <observers>
213
+ <amosoft_save_product_data>
214
+ <type>singleton</type>
215
+ <class>dropship/observer</class>
216
+ <method>saveProductTabData</method>
217
+ </amosoft_save_product_data>
218
+ </observers>
219
+ </catalog_product_save_after>
220
+ </events>
221
+ </adminhtml>
222
+ <default>
223
+ <carriers>
224
+ <suppliershippingcostperproduct>
225
+ <active>1</active>
226
+ <model>dropship/carrier_flatrateperproduct</model>
227
+ <title>Shipping</title>
228
+ <name>Supplier Cost</name>
229
+ <price>5.00</price>
230
+ <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
231
+ </suppliershippingcostperproduct>
232
+ </carriers>
233
+ <amosoft_integration>
234
+ <integration>
235
+ <api_user_name>AmosoftIntegration</api_user_name>
236
+ <processing_status>proceesing</processing_status>
237
+ <error_status>error</error_status>
238
+ <sentto_warehouse_status>sent_to_warehouse</sentto_warehouse_status>
239
+ <ds360_version>3.1.1</ds360_version>
240
+ </integration>
241
+ </amosoft_integration>
242
+ <amosoft_cron>
243
+ </amosoft_cron>
244
+ <amosoft_sourcing>
245
+ <rank>
246
+ <ranktype>cost</ranktype>
247
+ <defaultbackorder>none</defaultbackorder>
248
+ <email_shipment>0</email_shipment>
249
+ <sourcing_type>1</sourcing_type>
250
+ </rank>
251
+ <inventory>
252
+ <buffer>0</buffer>
253
+ </inventory>
254
+ <cron_settings>
255
+ <sourcing_time>-2,10</sourcing_time>
256
+ <backorder_time>-1,0</backorder_time>
257
+ </cron_settings>
258
+ <cron_settings_upload>
259
+ <enabled>0</enabled>
260
+ <time>23,59</time>
261
+ </cron_settings_upload>
262
+ </amosoft_sourcing>
263
+ </default>
264
+
265
+
266
+ <apiconfig>
267
+ <termsandconditions>
268
+ <link>http://www.amosoft.com/magento-edi-connector-agreement/</link>
269
+ </termsandconditions>
270
+ <helpurl>
271
+ <link>http://help.netdropship.amosoft.com/</link>
272
+ </helpurl>
273
+ <email>
274
+ <toaddress>magentoext@amosoft.com</toaddress>
275
+ <bcc>support@amosoft.com</bcc>
276
+ <toname>amosoft</toname>
277
+ <subject>amosoft new extesnion Installation</subject>
278
+ </email>
279
+ <soap_role>__root__,dropship,dropship/versions,dropship/versions/dropship,core,core/magento,core/magento/info,core/store,core/store/list,core/store/info,catalog,catalog/product,catalog/product/create,catalog/product/info,catalog/product/attributes,catalog/product/update_tier_price,catalog/product/delete,catalog/product/update,catalog/product/attribute,catalog/product/attribute/info,catalog/product/attribute/option,catalog/product/attribute/option/remove,catalog/product/attribute/option/add,catalog/product/attribute/set,catalog/product/attribute/set/group_add,catalog/product/attribute/set/group_rename,catalog/product/attribute/set/group_remove,catalog/product/attribute/set/attribute_remove,catalog/product/attribute/set/attribute_add,catalog/product/attribute/set/create,catalog/product/attribute/set/remove,catalog/product/attribute/set/list,catalog/product/attribute/remove,catalog/product/attribute/update,catalog/product/attribute/write,catalog/product/attribute/types,catalog/product/attribute/create,catalog/product/attribute/read,catalog/product/link,catalog/product/link/remove,catalog/product/link/update,catalog/product/link/assign,catalog/product/media,catalog/product/media/remove,catalog/product/media/update,catalog/product/media/create,catalog/product/tag,catalog/product/tag/remove,catalog/product/tag/update,catalog/product/tag/add,catalog/product/tag/info,catalog/product/tag/list,catalog/product/option,catalog/product/option/list,catalog/product/option/remove,catalog/product/option/add,catalog/product/option/info,catalog/product/option/types,catalog/product/option/update,catalog/product/option/value,catalog/product/option/value/remove,catalog/product/option/value/update,catalog/product/option/value/add,catalog/product/option/value/info,catalog/product/option/value/list,sales,sales/order,sales/order/updateitemstatus,sales/order/getamosoftorderbyitemstatus,sales/order/setamosoftorderitemstatus,sales/order/creditmemo,sales/order/creditmemo/list,sales/order/creditmemo/info,sales/order/creditmemo/cancel,sales/order/creditmemo/comment,sales/order/creditmemo/create,sales/order/invoice,sales/order/invoice/cancel,sales/order/invoice/info,sales/order/invoice/void,sales/order/invoice/capture,sales/order/invoice/comment,sales/order/invoice/create,sales/order/info,sales/order/shipment,sales/order/shipment/send,sales/order/shipment/info,sales/order/shipment/track,sales/order/shipment/comment,sales/order/shipment/create,sales/order/change,cataloginventory,cataloginventory/update</soap_role>
280
+ </apiconfig>
281
+ <crontab>
282
+ <jobs>
283
+ <amosoft_dropship>
284
+ <run>
285
+ <model>dropship/observer::amosoftSourcing</model>
286
+ </run>
287
+ </amosoft_dropship>
288
+ <amosoft_backorder>
289
+ <run>
290
+ <model>dropship/observer::amosoftBackorder</model>
291
+ </run>
292
+ </amosoft_backorder>
293
+ <amosoft_uploadvendor>
294
+ <run>
295
+ <model>dropship/uploadvendor::ftpParseCsv</model>
296
+ </run>
297
+ </amosoft_uploadvendor>
298
+ <amosoft_report_email>
299
+ <run>
300
+ <model>dropship/report::sendNotification</model>
301
+ </run>
302
+ </amosoft_report_email>
303
+ <amosoft_oudated_product_inventory_cron>
304
+ <run>
305
+ <model>dropship/observer::notifyForProductUpdateInventory</model>
306
+ </run>
307
+ </amosoft_oudated_product_inventory_cron>
308
+ </jobs>
309
+ </crontab>
310
+ </config>
app/code/local/Amosoft/Dropship/etc/jstranslator.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * @category Mage
7
+ * @package Mage_Core
8
+ */
9
+ -->
10
+ <jstranslator>
11
+ <validate-url-amosoft translate="message" module="dropship">
12
+ <message>Please enter a valid URL. Protocol is required (http://, https:// or ftp://)</message>
13
+ </validate-url-amosoft>
14
+ <validate-one-required-by-name-amosoft translate="message" module="dropship">
15
+ <message>Please select one of the options.</message>
16
+ </validate-one-required-by-name-amosoft>
17
+ </jstranslator>
app/code/local/Amosoft/Dropship/etc/system.xml ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <carriers>
5
+ <groups>
6
+ <suppliershippingcostperproduct translate="label" module="dropship">
7
+ <label>Supplier Cost Per Product</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>99</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>2</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <name translate="label">
32
+ <label>Method Name</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>2</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </name>
39
+ <price translate="label">
40
+ <label>Price</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>3</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ </price>
47
+ <specificerrmsg translate="label">
48
+ <label>Displayed Error Message</label>
49
+ <frontend_type>textarea</frontend_type>
50
+ <sort_order>4</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </specificerrmsg>
55
+ <sallowspecific translate="label">
56
+ <label>Ship to Applicable Countries</label>
57
+ <frontend_type>select</frontend_type>
58
+ <sort_order>90</sort_order>
59
+ <frontend_class>shipping-applicable-country</frontend_class>
60
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>0</show_in_store>
64
+ </sallowspecific>
65
+ <specificcountry translate="label">
66
+ <label>Ship to Specific Countries</label>
67
+ <frontend_type>multiselect</frontend_type>
68
+ <sort_order>91</sort_order>
69
+ <source_model>adminhtml/system_config_source_country</source_model>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ <can_be_empty>1</can_be_empty>
74
+ </specificcountry>
75
+ <sort_order translate="label">
76
+ <label>Sort Order</label>
77
+ <frontend_type>text</frontend_type>
78
+ <sort_order>100</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>0</show_in_store>
82
+ </sort_order>
83
+ </fields>
84
+ </suppliershippingcostperproduct>
85
+ </groups>
86
+ </carriers>
87
+ </sections>
88
+ <tabs>
89
+ <dropship translate="label" module="dropship">
90
+ <label>dropship</label>
91
+ <sort_order>500</sort_order>
92
+ </dropship>
93
+ </tabs>
94
+ <sections>
95
+ <amosoft_integration translate="label" module="dropship">
96
+ <label>General Setup</label>
97
+ <tab>dropship</tab>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>40</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>0</show_in_website>
102
+ <show_in_store>0</show_in_store>
103
+ <groups>
104
+ <integration translate="label">
105
+ <label>Getting Started</label>
106
+ <page_heading>Suppliers</page_heading>
107
+ <expanded>1</expanded>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>10</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>0</show_in_website>
112
+ <show_in_store>0</show_in_store>
113
+ <fields>
114
+ <notificationstatus translate="label">
115
+ <frontend_type>hidden</frontend_type>
116
+ </notificationstatus>
117
+ <getstarted translate="label">
118
+ <frontend_type>text</frontend_type>
119
+ <frontend_model>dropship/adminhtml_system_config_fieldset_hint</frontend_model>
120
+ <sort_order>6</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>0</show_in_website>
123
+ <show_in_store>0</show_in_store>
124
+ </getstarted>
125
+ </fields>
126
+ </integration>
127
+ </groups>
128
+ </amosoft_integration>
129
+
130
+ <amosoft_sourcing translate="label" module="dropship">
131
+ <label>Configuration/Setup</label>
132
+ <tab>dropship</tab>
133
+ <frontend_type>text</frontend_type>
134
+ <sort_order>42</sort_order>
135
+ <show_in_default>1</show_in_default>
136
+ <show_in_website>0</show_in_website>
137
+ <show_in_store>0</show_in_store>
138
+ <groups>
139
+
140
+ <rank translate="label">
141
+ <label>Sourcing Logic</label>
142
+ <page_heading>Sourcing</page_heading>
143
+ <expanded>1</expanded>
144
+ <frontend_type>text</frontend_type>
145
+ <sort_order>1</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>0</show_in_website>
148
+ <show_in_store>0</show_in_store>
149
+ <fields>
150
+ <ranktype translate="label">
151
+ <label>Sourcing Rule</label>
152
+ <frontend_type>select</frontend_type>
153
+ <source_model>dropship/system_config_source_ranktype</source_model>
154
+ <sort_order>0</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>0</show_in_website>
157
+ <show_in_store>0</show_in_store>
158
+
159
+ </ranktype>
160
+ <defaultbackorder translate="label">
161
+ <label>Default Supplier</label>
162
+ <frontend_type>select</frontend_type>
163
+ <source_model>dropship/system_config_source_vendorlist</source_model>
164
+ <comment>Selected Supplier will override the backorder logic.</comment>
165
+ <sort_order>1</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>0</show_in_website>
168
+ <show_in_store>0</show_in_store>
169
+
170
+ </defaultbackorder>
171
+ <email_shipment translate="label">
172
+ <label>Email customer when tracking is added</label>
173
+ <frontend_type>select</frontend_type>
174
+ <source_model>adminhtml/system_config_source_yesno</source_model>
175
+ <comment>Shipping information will automatically be sent when tracking is added.</comment>
176
+ <sort_order>2</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>0</show_in_website>
179
+ <show_in_store>0</show_in_store>
180
+ </email_shipment>
181
+ <sourcing_type>
182
+ <label>Event Driven Sourcing</label>
183
+ <frontend_type>select</frontend_type>
184
+ <source_model>adminhtml/system_config_source_yesno</source_model>
185
+ <comment>Select "Yes" to trigger sourcing logic in the sales_order_place_after event.</comment>
186
+ <sort_order>3</sort_order>
187
+ <show_in_default>1</show_in_default>
188
+ <show_in_website>0</show_in_website>
189
+ <show_in_store>0</show_in_store>
190
+ </sourcing_type>
191
+
192
+ </fields>
193
+
194
+ </rank>
195
+
196
+ <inventory translate="label">
197
+ <label>Inventory</label>
198
+ <page_heading>Inventory</page_heading>
199
+ <expanded>1</expanded>
200
+ <frontend_type>text</frontend_type>
201
+ <sort_order>2</sort_order>
202
+ <show_in_default>1</show_in_default>
203
+ <show_in_website>0</show_in_website>
204
+ <show_in_store>0</show_in_store>
205
+ <fields>
206
+ <buffer translate="label">
207
+ <label>Buffer</label>
208
+ <frontend_type>text</frontend_type>
209
+ <sort_order>0</sort_order>
210
+ <comment>Buffer value will be subtracted from each Supplier's inventory</comment>
211
+ <validate>required-entry validate-digits</validate>
212
+ <show_in_default>1</show_in_default>
213
+ <show_in_website>0</show_in_website>
214
+ <show_in_store>0</show_in_store>
215
+
216
+ </buffer>
217
+
218
+ </fields>
219
+
220
+ </inventory>
221
+
222
+ <integration translate="label">
223
+ <label>Help</label>
224
+ <page_heading>Help</page_heading>
225
+ <expanded>1</expanded>
226
+ <frontend_type>text</frontend_type>
227
+ <sort_order>7</sort_order>
228
+ <show_in_default>1</show_in_default>
229
+ <show_in_website>0</show_in_website>
230
+ <show_in_store>0</show_in_store>
231
+ <fields>
232
+ <need_help>
233
+ <label>Need Help?</label>
234
+ <frontend_type>link</frontend_type>
235
+ <frontend_model>dropship/adminhtml_system_config_helplink</frontend_model>
236
+ <href>http://help.netdropship.amosoft.com/dropship</href>
237
+ <sort_order>31</sort_order>
238
+ <show_in_default>1</show_in_default>
239
+ <show_in_website>0</show_in_website>
240
+ <show_in_store>0</show_in_store>
241
+ </need_help>
242
+ </fields>
243
+ </integration>
244
+ </groups>
245
+ </amosoft_sourcing>
246
+ </sections>
247
+ </config>
app/code/local/Amosoft/Dropship/etc/wsdl.xml ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
4
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
5
+ <types>
6
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
7
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
8
+
9
+ <complexType name="salesOrderListEntity">
10
+ <all>
11
+ <element name="item_details" type="typens:salesOrderListAmosoftItemEntityArray" minOccurs="0" />
12
+ <element name="dropship_item" type="xsd:int" minOccurs="0" />
13
+ </all>
14
+ </complexType>
15
+
16
+ <complexType name="salesOrderListAmosoftItemEntityArray">
17
+ <complexContent>
18
+ <restriction base="soapenc:Array">
19
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:salesOrderListAmosoftItemEntity[]" />
20
+ </restriction>
21
+ </complexContent>
22
+ </complexType>
23
+
24
+ <complexType name="salesOrderListAmosoftItemEntity">
25
+ <all>
26
+ <element name="item_sku" type="xsd:string" minOccurs="0" />
27
+ <element name="amosoft_vendor_sku" type="xsd:string" minOccurs="0" />
28
+ <element name="amosoft_vendor_code" type="xsd:string" minOccurs="0" />
29
+ <element name="amosoft_vendor_cost" type="xsd:string" minOccurs="0" />
30
+ </all>
31
+ </complexType>
32
+
33
+ <complexType name="salesOrderItemEntity">
34
+ <all>
35
+ <element name="amosoft_item_status" type="xsd:string" minOccurs="0" />
36
+ <element name="amosoft_vendor_sku" type="xsd:string" minOccurs="0" />
37
+ <element name="amosoft_vendor_code" type="xsd:string" minOccurs="0" />
38
+ </all>
39
+ </complexType>
40
+ <complexType name="salesOrderAmosoftEntity">
41
+ <all>
42
+ <element name="ResultCount" type="xsd:int" minOccurs="0" />
43
+ <element name="orderDetails" type="typens:salesOrderAmosoftStatusEntityArray" minOccurs="0" />
44
+ <element name="error_message" type="xsd:string" minOccurs="0" />
45
+ </all>
46
+ </complexType>
47
+ <complexType name="salesOrderAmosoftStatusEntityArray">
48
+ <complexContent>
49
+ <restriction base="soapenc:Array">
50
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:salesOrderAmosoftStatusEntity[]" />
51
+ </restriction>
52
+ </complexContent>
53
+ </complexType>
54
+
55
+ <complexType name="salesOrderAmosoftStatusEntity">
56
+ <all>
57
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
58
+ <element name="error_message" type="xsd:string" minOccurs="0" />
59
+ </all>
60
+ </complexType>
61
+
62
+ <complexType name="salesOrderSetAmosoftStatusEntity">
63
+ <all>
64
+ <element name="success_message" type="xsd:string" minOccurs="0" />
65
+ <element name="error_message" type="xsd:string" minOccurs="0" />
66
+ </all>
67
+ </complexType>
68
+
69
+ <complexType name="salesOrderGetAmosoftStatusConfig">
70
+ <all>
71
+ <element name="begin_sourcing" type="xsd:string" minOccurs="0" />
72
+ <element name="awaiting_transmission" type="xsd:string" minOccurs="0" />
73
+ <element name="backorder" type="xsd:string" minOccurs="0" />
74
+ <element name="sourcing_complete" type="xsd:string" minOccurs="0" />
75
+ </all>
76
+ </complexType>
77
+
78
+ <complexType name="versionsGetdropshipversion">
79
+ <all>
80
+ <element name="magentoVer" type="xsd:string" minOccurs="0" />
81
+ <element name="dropshipVer" type="xsd:string" minOccurs="0" />
82
+ <element name="dropshipDbScriptVer" type="xsd:string" minOccurs="0" />
83
+ </all>
84
+ </complexType>
85
+ </schema>
86
+ </types>
87
+
88
+ <message name="salesOrderUpdateItemStatusRequest">
89
+ <part name="sessionId" type="xsd:string"/>
90
+ <part name="orderId" type="xsd:string"/>
91
+ <part name="items" type="typens:ArrayOfString"/>
92
+ <part name="status" type="xsd:string"/>
93
+ </message>
94
+ <message name="salesOrderUpdateItemStatusResponse">
95
+ <part name="result" type="xsd:boolean"/>
96
+ </message>
97
+
98
+ <message name="salesOrderGetAmosoftOrderByItemStatusRequest">
99
+ <part name="sessionId" type="xsd:string"/>
100
+ <part name="storeId" type="xsd:string"/>
101
+ <part name="itemStatus" type="xsd:string"/>
102
+ </message>
103
+ <message name="salesOrderGetAmosoftOrderByItemStatusResponse">
104
+ <part name="result" type="typens:salesOrderAmosoftEntity" />
105
+ </message>
106
+
107
+ <message name="salesOrderSetAmosoftOrderItemStatusRequest">
108
+ <part name="sessionId" type="xsd:string"/>
109
+ <part name="orderIncrementId" type="xsd:string"/>
110
+ <part name="itemStatus" type="xsd:string"/>
111
+ </message>
112
+ <message name="salesOrderSetAmosoftOrderItemStatusResponse">
113
+ <part name="result" type="typens:salesOrderSetAmosoftStatusEntity" />
114
+ </message>
115
+
116
+ <message name="versionsGetdropshipversionRequest">
117
+ <part name="sessionId" type="xsd:string"/>
118
+ </message>
119
+ <message name="versionsGetdropshipversionResponse">
120
+ <part name="result" type="typens:versionsGetdropshipversion" />
121
+ </message>
122
+
123
+ <portType name="{{var wsdl.handler}}PortType">
124
+ <operation name="salesOrderUpdateItemStatus">
125
+ <documentation>Update Amosoft Item Status</documentation>
126
+ <input message="typens:salesOrderUpdateItemStatusRequest"/>
127
+ <output message="typens:salesOrderUpdateItemStatusResponse"/>
128
+ </operation>
129
+ <operation name="salesOrderGetAmosoftOrderByItemStatus">
130
+ <documentation>Retrive order by item status</documentation>
131
+ <input message="typens:salesOrderGetAmosoftOrderByItemStatusRequest"/>
132
+ <output message="typens:salesOrderGetAmosoftOrderByItemStatusResponse"/>
133
+ </operation>
134
+ <operation name="salesOrderSetAmosoftOrderItemStatus">
135
+ <documentation>Set item Status </documentation>
136
+ <input message="typens:salesOrderSetAmosoftOrderItemStatusRequest"/>
137
+ <output message="typens:salesOrderSetAmosoftOrderItemStatusResponse"/>
138
+ </operation>
139
+
140
+ <operation name="versionsGetdropshipversion">
141
+ <documentation>this is an example of api method</documentation>
142
+ <input message="typens:versionsGetdropshipversionRequest"/>
143
+ <output message="typens:versionsGetdropshipversionResponse"/>
144
+ </operation>
145
+ </portType>
146
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
147
+ <operation name="salesOrderUpdateItemStatus">
148
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
149
+ <input>
150
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
151
+ </input>
152
+ <output>
153
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
154
+ </output>
155
+ </operation>
156
+ <operation name="salesOrderGetAmosoftOrderByItemStatus">
157
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
158
+ <input>
159
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
160
+ </input>
161
+ <output>
162
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
163
+ </output>
164
+ </operation>
165
+ <operation name="salesOrderSetAmosoftOrderItemStatus">
166
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
167
+ <input>
168
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
169
+ </input>
170
+ <output>
171
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
172
+ </output>
173
+ </operation>
174
+ <operation name="versionsGetdropshipversion">
175
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
176
+ <input>
177
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
178
+ </input>
179
+ <output>
180
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
181
+ </output>
182
+ </operation>
183
+ </binding>
184
+ </definitions>
app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-install-1.0.3.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amosoft
5
+ *
6
+ * @category Local
7
+ * @package Amosoft_Dropship
8
+ */
9
+
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $installer->run("
14
+ DROP TABLE IF EXISTS {$installer->getTable('dropship/supplier')};
15
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship/inventory')};
16
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/inventory')} (
17
+ id INT( 11 ) NOT NULL AUTO_INCREMENT ,
18
+ amosoft_vendor_code VARCHAR( 50 ) NOT NULL ,
19
+ amosoft_vendor_name varchar(50) NOT NULL,
20
+ product_sku VARCHAR( 64 ) NOT NULL ,
21
+ amosoft_vendor_sku varchar(64) NOT NULL,
22
+ stock INT( 11 ) NOT NULL ,
23
+ cost decimal(12,2) NOT NULL,
24
+ shipping_cost decimal(12,2) NOT NULL,
25
+ created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
26
+ updated_at TIMESTAMP NULL ,
27
+ PRIMARY KEY (id),
28
+ KEY `id` (`id`),
29
+ KEY `amosoft_vendor_code` (`amosoft_vendor_code`),
30
+ KEY `product_sku` (`product_sku`),
31
+ KEY `stock` (`stock`),
32
+ KEY `cost` (`cost`)
33
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
34
+
35
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship/ranking')};
36
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/ranking')} (
37
+ `id` int(11) NOT NULL AUTO_INCREMENT,
38
+ `amosoft_vendor_code` varchar(50) NOT NULL,
39
+ amosoft_vendor_name varchar(50) NOT NULL,
40
+ `ranking` int(11) NOT NULL DEFAULT '0',
41
+ `amosoft_vendor_type` enum('default','enhanced','user') NOT NULL DEFAULT 'default',
42
+ `is_dropship` enum('no','yes') NOT NULL DEFAULT 'yes',
43
+ `is_active` enum('no','yes') NOT NULL DEFAULT 'yes',
44
+ `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
45
+ `updated_at` timestamp NULL DEFAULT NULL,
46
+ PRIMARY KEY (`id`),
47
+ KEY `id` (`id`),
48
+ KEY `amosoft_vendor_code` (`amosoft_vendor_code`),
49
+ KEY `is_dropship` (`is_dropship`),
50
+ KEY `ranking` (`ranking`)
51
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
52
+
53
+ -- INSERT INTO `amosoft_vendor_ranking` (`amosoft_vendor_code` ,`amosoft_vendor_name`,`ranking`,`updated_at`)VALUES ('MagVendID1','Vendor 1',1,now()),('MagVendID2','Vendor 2',2,now()),('MagVendID3','Vendor 3',3,now()),('MagVendID4','Vendor 4',4,now()),('MagVendID5','Vendor 5',5,now()),('MagVendID6','Vendor 6',6,now()),('MagVendID7','Vendor 7',7,now()),('MagVendID8','Vendor 8',8,now()),('MagVendID9','Vendor 9',9,now()),('MagVendID10','Vendor 10',10,now()),('MagVendID11','Vendor 11',11,now()),('MagVendID12','Vendor12',12,now()),('MagVendID13','Vendor 13',13,now()),('MagVendID14','Vendor 14',14,now()),('MagVendID15','Vendor15',15,now());
54
+
55
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship/rankinglog')};
56
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/rankinglog')} (
57
+ id INT( 11 ) NOT NULL AUTO_INCREMENT ,
58
+ label VARCHAR( 50 ) NOT NULL ,
59
+ ranking_data text NOT NULL ,
60
+ created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
61
+ PRIMARY KEY (id),
62
+ KEY `id` (`id`)
63
+
64
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
65
+
66
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship/ordersourcing')};
67
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/ordersourcing')} (
68
+ id int(11) NOT NULL AUTO_INCREMENT,
69
+ order_id int(10) NOT NULL,
70
+ sourcing enum('new','resourcing','done') NOT NULL DEFAULT 'new',
71
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
72
+ updated_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
73
+ PRIMARY KEY (`id`),
74
+ KEY `order_id` (`order_id`),
75
+ KEY `sourcing` (`sourcing`),
76
+ KEY `id` (`id`)
77
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
78
+
79
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship/orderitems')};
80
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/orderitems')} (
81
+ id int(11) NOT NULL AUTO_INCREMENT,
82
+ item_id int(10) NOT NULL,
83
+ item_order_id varchar(11) NOT NULL,
84
+ sku varchar(64) NOT NULL,
85
+ amosoft_vendor_sku varchar(64) NOT NULL,
86
+ vendor_cost decimal(12,2) NOT NULL,
87
+ shipping_cost decimal(12,2) NOT NULL,
88
+ amosoft_item_status enum('Sourcing','Backorder','Transmitting','Sent to Vendor','Cancelled','No Dropship','Completed') NOT NULL DEFAULT 'Sourcing',
89
+ amosoft_vendor_code varchar(50) NOT NULL,
90
+ `updated_by` enum('Pending','User','Cron','Amosoft') NOT NULL DEFAULT 'Pending',
91
+ created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
92
+ updated_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
93
+ PRIMARY KEY (`id`),
94
+ KEY `item_id` (`item_id`),
95
+ KEY `amosoft_vendor_code` (`amosoft_vendor_code`),
96
+ KEY `updated_by` (`updated_by`),
97
+ KEY `id` (`id`)
98
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
99
+
100
+ ");
101
+ //$installer->installEntities();
102
+
103
+
104
+ $installer->endSetup();
105
+
app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.4-1.0.5.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/inventorylog')} (
10
+ `id` int(11) NOT NULL AUTO_INCREMENT,
11
+ `amosoft_vendor_code` varchar(50) NOT NULL,
12
+ `amosoft_vendor_name` varchar(50) NOT NULL,
13
+ `product_sku` varchar(50) NOT NULL,
14
+ `cost` decimal(12,2) NOT NULL DEFAULT '0.00',
15
+ `stock` int(10) NOT NULL DEFAULT '0',
16
+ `updated_by` varchar(50) NOT NULL,
17
+ `activity` enum('update','add','delete') NOT NULL DEFAULT 'add',
18
+ `updated_at` timestamp NULL DEFAULT NULL,
19
+ `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
20
+ PRIMARY KEY (`id`)
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
22
+
23
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/uploadvendor')} (
24
+ `file_id` int(11) NOT NULL AUTO_INCREMENT,
25
+ `file_name` varchar(50) NOT NULL,
26
+ `import_status` enum('pending','done','processing') NOT NULL DEFAULT 'pending',
27
+ `updated_by` varchar(50) NOT NULL,
28
+ `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
29
+ `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
30
+ `amosoft_vendor_code` varchar(50) NOT NULL,
31
+ PRIMARY KEY (`file_id`),
32
+ KEY `import_status` (`import_status`)
33
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
34
+
35
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship/vendor_import_log')};
36
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/vendor_import_log')} (
37
+ `amosoft_vendor_code` varchar(50) NOT NULL,
38
+ `updated_by` text NOT NULL,
39
+ `success` int(11) NOT NULL,
40
+ `failure` int(11) NOT NULL,
41
+ `ftp_error` text,
42
+ `ftp_error_desc` text,
43
+ `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
44
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
45
+ ");
46
+
47
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/inventorylog'),'cost', 'VARCHAR( 50 ) DEFAULT NULL');
48
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/inventorylog'),'stock', 'VARCHAR( 50 ) DEFAULT NULL');
49
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/inventorylog'),'activity', 'VARCHAR( 255 ) DEFAULT NULL');
50
+ $installer->endSetup();
app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.5-1.0.6.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ $installer = $this;
9
+ $installer->startSetup();
10
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/inventory'),'stock', 'VARCHAR(11) NOT NULL');
11
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/inventory'),'created_at', 'TIMESTAMP NULL');
12
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/inventorylog'),'created_at', 'TIMESTAMP NULL');
13
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/uploadvendor'),'created_at', 'TIMESTAMP NULL');
14
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/vendor_import_log'),'created_at', 'TIMESTAMP NULL');
15
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/ranking'),'created_at', 'TIMESTAMP NULL');
16
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/rankinglog'),'created_at', 'TIMESTAMP NULL');
17
+ $installer->getConnection()->addColumn($installer->getTable('dropship/orderitems'), 'item_status_history', 'TEXT NULL');
18
+ $installer->run("CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/tmpdata')} (
19
+ `id` int(10) NOT NULL AUTO_INCREMENT,
20
+ `tmpdata` varchar(255) NOT NULL,
21
+ `created_at` timestamp NULL DEFAULT NULL,
22
+ `updated_at` timestamp NULL DEFAULT NULL,
23
+ `status` varchar(255) NOT NULL DEFAULT 'active',
24
+ PRIMARY KEY (`id`)
25
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
26
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship/orderitems'),'amosoft_item_status', ' ENUM( "Sourcing", "Reprocess", "Backorder", "Transmitting", "Sent to Supplier", "Sent to Vendor", "Cancelled", "No Dropship", "Completed" ) NOT NULL DEFAULT "Sourcing" ');
27
+
28
+ $installer->endSetup();
app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.6-1.0.7.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ $installer = $this;
9
+ $importLog = $installer->getTable('dropship/vendor_import_log');
10
+ $ranking = $installer->getTable('dropship/ranking');
11
+ $installer->startSetup();
12
+ $installer->getConnection()->addColumn($importLog, 'error_id', array(
13
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
14
+ 'identity' => true,
15
+ 'nullable' => false,
16
+ 'unsigned' => true,
17
+ 'primary' => true,
18
+ 'comment' => 'Add error id row'
19
+ )
20
+ );
21
+ $installer->getConnection()->addKey($importLog, 'error_id', 'error_id');
22
+ $installer->getConnection()->addColumn($ranking, 'linking_attribute', array(
23
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
24
+ 'length' =>255,
25
+ 'nullable' => true,
26
+ 'default' => null,
27
+ 'comment' => 'linking attribute'));
28
+ $installer->run(
29
+ "DROP TABLE IF EXISTS {$installer->getTable('dropship/csvtmpdata')};
30
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/csvtmpdata')} (
31
+ `row_id` INT(11) NOT NULL AUTO_INCREMENT ,
32
+ `vendor_code` varchar(50) NOT NULL,
33
+ `csv_vendor_sku` varchar(50) NOT NULL,
34
+ `csv_stock` varchar(11) NOT NULL,
35
+ `csv_price` varchar(11) NOT NULL,
36
+ `is_processed` int(1) NOT NULL DEFAULT '0',
37
+ KEY `row_id` (`row_id`),
38
+ KEY `vendor_code` (`vendor_code`),
39
+ KEY `csv_vendor_sku` (`csv_vendor_sku`),
40
+ KEY `csv_stock` (`csv_stock`),
41
+ KEY `csv_price` (`csv_price`),
42
+ KEY `is_processed` (`is_processed`)
43
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
44
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship/vendor_import_log_desc')} (
45
+ `id` int(11) NOT NULL AUTO_INCREMENT,
46
+ `error_id` int(10) unsigned NOT NULL,
47
+ `description` varchar(255) CHARACTER SET utf8 NOT NULL,
48
+ PRIMARY KEY (`id`),
49
+ KEY `error_id` (`error_id`),
50
+ FOREIGN KEY (`error_id`) REFERENCES {$installer->getTable('dropship/vendor_import_log')} (`error_id`) ON DELETE CASCADE
51
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
52
+
53
+
54
+ $installer->endSetup();
app/code/local/Amosoft/Dropship/sql/dropship_setup/mysql4-upgrade-1.0.7-1.0.8.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ $installer = $this;
9
+ //apply patch for insert on duplicate
10
+ $csvTempData = $installer->getTable('dropship/csvtmpdata');
11
+ $installer->getConnection()->addKey($csvTempData,'csv_vendor_sku_unique','csv_vendor_sku','unique');
12
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/amosoftdropship.xml ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <reference name="notifications">
6
+ <block type="dropship/adminhtml_notification" name="amosoftnotification" as="amosoftnotification" template="amosoft/window.phtml" />
7
+ </reference>
8
+ </default>
9
+ <amosoft_adminhtml_amosoft_index>
10
+ <reference name="head">
11
+ <action method="addItem"><type>css</type><name>prototype/windows/themes/magento.css</name></action>
12
+ </reference>
13
+ <reference name="content">
14
+ <block type="dropship/adminhtml_amosoft" name="dropship" />
15
+ </reference>
16
+ <reference name="js">
17
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
18
+ </reference>
19
+ </amosoft_adminhtml_amosoft_index>
20
+
21
+ <amosoft_adminhtml_sourcing_sourcinggrid>
22
+ <reference name="head">
23
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
24
+ </reference>
25
+ <reference name="content">
26
+ <block type="dropship/adminhtml_sourcing" name="dropship" />
27
+ </reference>
28
+ <reference name="js">
29
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
30
+ </reference>
31
+ </amosoft_adminhtml_sourcing_sourcinggrid>
32
+
33
+ <amosoft_adminhtml_ranking_index>
34
+ <reference name="head">
35
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
36
+ <action method="addItem"><type>css</type><name>prototype/windows/themes/magento.css</name></action>
37
+ <action method="addItem"><type>js</type><name>amosoft/extjs/ext-all.js</name></action>
38
+ <action method="addItem"><type>js_css</type><name>amosoft/extjs/css/ext-all.css</name></action>
39
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
40
+ </reference>
41
+ <reference name="js">
42
+ <block type="core/template" template="amosoft/inline-edit.phtml" />
43
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
44
+ </reference>
45
+ <reference name="content">
46
+ <block type="dropship/adminhtml_ranking" name="ranking">
47
+ <block type="dropship/adminhtml_upload" name="upload" as="supplier.upload" template="amosoft/upload_vendor_product.phtml">
48
+ <action method="setHeaderText"><value>Setup Vendor Products</value></action>
49
+ <action method="setProductSetupMode"><value>true</value></action>
50
+ </block>
51
+ </block>
52
+ </reference>
53
+ </amosoft_adminhtml_ranking_index>
54
+
55
+ <amosoft_adminhtml_inventory_index>
56
+ <reference name="head">
57
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
58
+ </reference>
59
+ <reference name="content">
60
+ <block type="dropship/adminhtml_inventory" name="inventory" />
61
+ </reference>
62
+ <reference name="js">
63
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
64
+ </reference>
65
+ </amosoft_adminhtml_inventory_index>
66
+
67
+ <amosoft_adminhtml_inventory_vendors>
68
+ <reference name="head">
69
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
70
+ </reference>
71
+ <reference name="content">
72
+ <block type="core/text_list" name="root" output="toHtml" >
73
+ <block type="dropship/adminhtml_inventory_edit_tab_amosoftvendor" name="vendors_product_tab" template="amosoft/vendorproducttab.phtml"/>
74
+ </block>
75
+ </reference>
76
+ </amosoft_adminhtml_inventory_vendors>
77
+
78
+ <amosoft_adminhtml_inventory_vendorshistory>
79
+ <reference name="head">
80
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
81
+ </reference>
82
+ <reference name="content">
83
+ <block type="core/text_list" name="root" output="toHtml" >
84
+ <block type="dropship/adminhtml_inventory_edit_tab_vendortabhistory" name="vendors_product_tab_history" template="amosoft/vendorproducttabhistory.phtml"/>
85
+ </block>
86
+ </reference>
87
+ </amosoft_adminhtml_inventory_vendorshistory>
88
+
89
+ <amosoft_adminhtml_upload_vendorsuploadhistory>
90
+ <reference name="head">
91
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
92
+ </reference>
93
+ <reference name="content">
94
+ <block type="dropship/adminhtml_Vendorproductuploadhistory" name="vendors_product_upload_history" template="amosoft/vendor_upload_product_history.phtml"/>
95
+ </reference>
96
+ <reference name="js">
97
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
98
+ </reference>
99
+ </amosoft_adminhtml_upload_vendorsuploadhistory>
100
+
101
+ <amosoft_adminhtml_ranking_popup>
102
+ <remove name="right"/>
103
+ <remove name="left"/>
104
+ <remove name="core_profiler"/>
105
+ <block type="core/template" name="root" output="toHtml" template="amosoft/popup.phtml"/>
106
+ </amosoft_adminhtml_ranking_popup>
107
+
108
+ <amosoft_adminhtml_ranking_showhistory>
109
+ <reference name="head">
110
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
111
+ </reference>
112
+ <reference name="content">
113
+ <block type="dropship/adminhtml_showhistory" name="showhistory" template="amosoft/result.phtml"/>
114
+ </reference>
115
+ <reference name="js">
116
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
117
+ </reference>
118
+ </amosoft_adminhtml_ranking_showhistory>
119
+
120
+ <amosoft_adminhtml_upload_index>
121
+ <reference name="head">
122
+ <action method="addCss"><name>css/amosoft/dropship/custom-style.css</name></action>
123
+ </reference>
124
+ <reference name="content">
125
+ <block type="dropship/adminhtml_inventory" name="inventory" />
126
+ <block type="dropship/adminhtml_upload" name="upload" template="amosoft/upload_vendor_product.phtml">
127
+ <action method="setHeaderText"><value>Vendor/Supplier Inventory</value></action>
128
+ </block>
129
+ </reference>
130
+ <reference name="js">
131
+ <block type="core/template" template="amosoft/add_help_js.phtml"/>
132
+ </reference>
133
+ </amosoft_adminhtml_upload_index>
134
+ <amosoft_adminhtml_upload_run>
135
+ <remove name="root"/>
136
+ <block type="adminhtml/page" name="convert_root" output="toHtml" template="page.phtml">
137
+ <block type="adminhtml/page_head" name="convert_root_head" as="head" template="page/head.phtml">
138
+ <action method="addJs"><script>prototype/prototype.js</script></action>
139
+ <action method="addJs"><script>prototype/validation.js</script></action>
140
+ <action method="addJs"><script>varien/js.js</script></action>
141
+ <action method="addJs"><script>mage/translate.js</script></action>
142
+ <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
143
+ </block>
144
+ <block type="dropship/adminhtml_upload_bulkassign" name="amosoft_bulkassign" template="amosoft/process-profile.phtml" output="toHtml"/>
145
+ </block>
146
+ </amosoft_adminhtml_upload_run>
147
+
148
+ <adminhtml_sales_order_view>
149
+ <reference name="order_items">
150
+ <action method="setTemplate">
151
+ <template>amosoft/sales/items.phtml</template>
152
+ </action>
153
+ <action method="addItemRender">
154
+ <type>default</type>
155
+ <block>adminhtml/sales_order_view_items_renderer_default</block>
156
+ <template>amosoft/sales/default.phtml</template>
157
+ </action>
158
+ <action method="addItemRender">
159
+ <type>bundle</type>
160
+ <block>bundle/adminhtml_sales_order_view_items_renderer</block>
161
+ <template>amosoft/bundle/renderer.phtml</template>
162
+ </action>
163
+ <action method="addItemRender">
164
+ <type>downloadable</type>
165
+ <block>adminhtml/sales_order_view_items_renderer_default</block>
166
+ <template>amosoft/downloadable/downloadable.phtml</template>
167
+ </action>
168
+ </reference>
169
+ </adminhtml_sales_order_view>
170
+
171
+ <adminhtml_catalog_product_edit>
172
+ <reference name="product_tabs">
173
+ <block type="dropship/adminhtml_inventory_edit_vendortab" name="vendor_tab"/>
174
+ <action method="addTab">
175
+ <name>vendor_tab</name>
176
+ <block>vendor_tab</block>
177
+ </action>
178
+ <block type="dropship/adminhtml_inventory_edit_vendortabhistory" name="vendor_tab_history"/>
179
+ <action method="addTab">
180
+ <name>vendor_tab_history</name>
181
+ <block>vendor_tab_history</block>
182
+ </action>
183
+ </reference>
184
+ </adminhtml_catalog_product_edit>
185
+ </layout>
app/design/adminhtml/default/default/template/amosoft/add_help_js.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+
10
+
11
+ <script type="text/javascript">
12
+ //<![CDATA[
13
+ if($$('.form-buttons a#page-help-link').length <= 0 ){
14
+ if($$('.form-buttons button').length > 0){
15
+ $$('.form-buttons button')[0].insert({
16
+ before: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from amosoft?</a>"
17
+ });
18
+ }else
19
+ {
20
+ $$('.form-buttons')[0].insert({
21
+ top: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from amosoft?</a>"
22
+ });
23
+ }
24
+ }
25
+ //]]>
26
+ </script>
app/design/adminhtml/default/default/template/amosoft/addvendorfields.phtml ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+
10
+
11
+ <script type="text/javascript">
12
+ //<![CDATA[
13
+ var firstStepTemplate = '<div class="option-box" id="vendor_{{id}}">'+
14
+ '<table id="<?php echo $this->getFieldId() ?>_{{id}}" class="option-header" cellpadding="0" cellspacing="0">'+
15
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_is_delete" name="<?php echo $this->getFieldName() ?>[{{id}}][is_delete]" value="" />'+
16
+ '<input type="hidden" id="<?php echo $this->getFieldId() ?>_{{id}}_updated_by" name="<?php echo $this->getFieldName() ?>[{{id}}][updated_by]" value="<?php echo $this->escapeHtml(Mage::getSingleton('admin/session')->getUser()->getUsername()) ?>" />'+
17
+ '<thead>'+
18
+ '<tr>'+
19
+ '<th class="opt-title" style="width:307px;"><?php echo Mage::helper('catalog')->__('Supplier') ?> <span class="required">*</span></th>'+
20
+ '<th class="opt-type" style="width:75px;"><?php echo Mage::helper('catalog')->__('Cost') ?> <span class="required">*</span></th>'+
21
+ '<th class="opt-shipcost" style="width:75px;"><?php echo Mage::helper('catalog')->__('Shipping Cost') ?> <span class="required">*</span></th>'+
22
+ '<th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('dropship')->__('Inventory')) ?><span class="required">*</span></th>'+
23
+ '<th class="opt-order" style="width:75px;"><?php echo Mage::helper('catalog')->__('Supplier Sku') ?><span class="required">*</span></th>'+
24
+ '<th class="a-right"><?php echo $this->jsQuoteEscape($this->getDeleteButtonHtml()) ?></th>'+
25
+ '</tr>'+
26
+ '</thead>'+
27
+ '<tr>'+
28
+ '<td style = "padding: 5px 5px;"><?php echo $this->getVendorSelectHtml() ?></td>'+
29
+ '<td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry validate-number validate-zero-or-greater input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_{{id}}_cost" name="<?php echo $this->getFieldName() ?>[{{id}}][cost]" value=""></td>'+
30
+ '<td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry validate-number validate-zero-or-greater input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_{{id}}_shipping_cost" name="<?php echo $this->getFieldName() ?>[{{id}}][shipping_cost]" value=""></td>'+
31
+ '<td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry validate-number validate-zero-or-greater input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_{{id}}_inventory" name="<?php echo $this->getFieldName() ?>[{{id}}][stock]" value=""></td>'+
32
+ '<td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_{{id}}amosoft_vendor_sku" name="<?php echo $this->getFieldName() ?>[{{id}}][amosoft_vendor_sku]" value=""></td>'+
33
+ '<td>&nbsp;</td>'+
34
+ '</tr></table></div>';
35
+
36
+ var productOptionVendor = {
37
+ div : $('product_options_container_top_vendor'),
38
+ templateSyntax : /(^|.|\r|\n)({{(\w+)}})/,
39
+ templateText : firstStepTemplate,
40
+ itemCount : 1,
41
+ add : function(data) {
42
+ this.template = new Template(this.templateText, this.templateSyntax);
43
+
44
+ if(!data.id){
45
+ data = {};
46
+ data.id = this.itemCount;
47
+ data.type = '';
48
+ data.option_id = 0;
49
+ } else {
50
+ this.itemCount = data.item_count;
51
+ }
52
+
53
+ Element.insert(this.div, {'after':this.template.evaluate(data)});
54
+
55
+
56
+ this.itemCount++;
57
+ this.bindRemoveButtons();
58
+
59
+ },
60
+ remove : function(event){
61
+ var element = $(Event.findElement(event, 'div'));
62
+ if(element){
63
+ $('product_'+element.readAttribute('id')+'_'+'is_delete').value = '1';
64
+ element.addClassName('no-display');
65
+ element.addClassName('ignore-validate');
66
+ element.hide();
67
+ }
68
+ },
69
+ bindRemoveButtons : function(){
70
+ var buttons = $$('div.product-custom-options-vendor .delete-product-option-vendor');
71
+ for(var i=0;i<buttons.length;i++){
72
+ if(!$(buttons[i]).binded){
73
+ $(buttons[i]).binded = true;
74
+ Event.observe(buttons[i], 'click', this.remove.bind(this));
75
+ }
76
+ }
77
+ this.bindSelectType();
78
+ this.bindInputType();
79
+
80
+ },
81
+
82
+ bindSelectType : function(){
83
+
84
+ var types = $$('.select-vendor-option-type');
85
+ for(var i=0;i<types.length;i++){
86
+ if(!$(types[i]).binded){
87
+ $(types[i]).binded = true;
88
+ Event.observe(types[i], 'change', this.changeSelectInput.bind(this));
89
+ }
90
+ }
91
+ },
92
+
93
+ bindInputType : function(){
94
+
95
+ var types = $$('.vendor-input-text');
96
+ for(var i=0;i<types.length;i++){
97
+ if(!$(types[i]).binded){
98
+ $(types[i]).binded = true;
99
+ Event.observe(types[i], 'blur', this.changeInput.bind(this));
100
+ }
101
+ }
102
+ },
103
+
104
+ changeSelectInput : function(event){
105
+ var element = $(Event.findElement(event, 'select'));
106
+
107
+ var group = '';
108
+ var previousGroupElm = $(element.readAttribute('id').sub('_type', '_previous_group'));
109
+ previousGroupElm.value = element.getValue();
110
+ },
111
+
112
+ changeInput : function(event){
113
+ var element = $(Event.findElement(event, 'input'));
114
+
115
+ var group = '';
116
+ var previousGroupElm = $(element.readAttribute('id').sub('_type', '_previous_group'));
117
+ }
118
+ }
119
+
120
+
121
+
122
+ productOptionVendor.bindRemoveButtons();
123
+
124
+
125
+ if($('<?php echo $this->getAddButtonId() ?>')){
126
+ Event.observe('<?php echo $this->getAddButtonId() ?>', 'click', productOptionVendor.add.bind(productOptionVendor));
127
+ }
128
+
129
+ //validation for selected input type
130
+ Validation.addAllThese([
131
+ ['required-option-select', <?php echo $this->helper('core')->jsonEncode(Mage::helper('catalog')->__('Select a vendor')) ?>, function(v, elm) {
132
+ if (elm.getValue() == '') {
133
+ return false;
134
+ }
135
+ return true;
136
+ }]]);
137
+
138
+ //adding data to templates
139
+
140
+
141
+ //]]>
142
+ </script>
app/design/adminhtml/default/default/template/amosoft/bundle/renderer.phtml ADDED
@@ -0,0 +1,441 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @see Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer
4
+ */
5
+ ?>
6
+
7
+ <?php $_item = $this->getItem() ?>
8
+ <?php $items = array_merge(array($_item), $_item->getChildrenItems()); ?>
9
+ <?php $_count = count ($items) ?>
10
+ <?php $_index = 0 ?>
11
+
12
+ <?php $_prevOptionId = '' ?>
13
+
14
+ <?php if($this->getOrderOptions() || $_item->getDescription() || $this->canDisplayGiftmessage()): ?>
15
+ <?php $_showlastRow = true ?>
16
+ <?php else: ?>
17
+ <?php $_showlastRow = false ?>
18
+ <?php endif; ?>
19
+
20
+ <?php foreach ($items as $_item): ?>
21
+ <?php $this->setPriceDataObject($_item) ?>
22
+ <?php $attributes = $this->getSelectionAttributes($_item) ?>
23
+ <?php if ($_item->getParentItem()): ?>
24
+ <?php if ($_prevOptionId != $attributes['option_id']): ?>
25
+ <tr>
26
+ <td><div class="option-label"><?php echo $attributes['option_label'] ?></div></td>
27
+ <td>&nbsp;</td>
28
+ <td>&nbsp;</td>
29
+ <td>&nbsp;</td>
30
+ <td>&nbsp;</td>
31
+ <td>&nbsp;</td>
32
+ <td>&nbsp;</td>
33
+ <td>&nbsp;</td>
34
+ <td>&nbsp;</td>
35
+ <td class="last">&nbsp;</td>
36
+ </tr>
37
+ <?php $_prevOptionId = $attributes['option_id'] ?>
38
+ <?php endif; ?>
39
+ <?php endif; ?>
40
+ <tr<?php echo (++$_index==$_count && !$_showlastRow)?' class="border"':'' ?>>
41
+ <?php if (!$_item->getParentItem()): ?>
42
+ <td>
43
+ <h5 class="title">
44
+ <span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->escapeHtml($_item->getName()) ?></span>
45
+ </h5>
46
+ <div>
47
+ <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong>
48
+ <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($_item->getSku()))); ?>
49
+ </div>
50
+ </td>
51
+ <?php else: ?>
52
+ <td><div class="option-value"><?php echo $this->getValueHtml($_item)?></div></td>
53
+ <?php endif; ?>
54
+ <td class="a-center">
55
+ <?php if ($this->canShowPriceInfo($_item)): ?>
56
+ <?php echo $_item->getStatus() ?>
57
+ <?php else: ?>
58
+ &nbsp;
59
+ <?php endif; ?>
60
+ </td>
61
+ <?php
62
+ $ItemStatus = $_item->getAmosoftItemStatus();
63
+ ?>
64
+ <td class="a-center">
65
+ <span id="<?php echo $_item->getItemId() ?>"><?php echo $ItemStatus; ?></span>
66
+ <?php if($ItemStatus!=""): ?>
67
+ <p><a id="edit" onclick="respondToClick(<?php echo $_item->getItemId() ?>)" style="cursor:pointer"><?php echo $this->__('Edit') ?></a></p>
68
+ <span id="change_status-<?php echo $_item->getItemId() ?>" style="display:none;">
69
+ <select name="status" id="status-<?php echo $_item->getItemId() ?>" onchange="respondToChange(this)">
70
+ <option value=""><?php echo $this->__('Please select') ?></option>
71
+ <?php foreach(Mage::helper('dropship')->getAmosoftOrderItemStatus() as $status):?>
72
+ <?php if($ItemStatus!=$status): ?>
73
+ <option value="<?php echo $status ?>"><?php echo $status ?></option>
74
+ <?php endif; ?>
75
+ <?php endforeach; ?>
76
+ </select>
77
+ </span>
78
+ <?php endif; ?>
79
+ </td>
80
+ <td class="a-center"><?php echo $_item->getLbVendorName() ?></td>
81
+ <td class="a-center"><?php echo $_item->getAmosoftVendorSku() ?></td>
82
+ <td class="a-right">
83
+ <?php if ($this->canShowPriceInfo($_item)): ?>
84
+ <?php echo $this->displayPriceAttribute('original_price') ?>
85
+ <?php else: ?>
86
+ &nbsp;
87
+ <?php endif; ?>
88
+ </td>
89
+ <td class="a-right">
90
+ <?php if ($this->canShowPriceInfo($_item)): ?>
91
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
92
+ <span class="price-excl-tax">
93
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
94
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
95
+ <?php endif; ?>
96
+
97
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
98
+ <?php
99
+ echo $this->displayPrices(
100
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
101
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
102
+ );
103
+ ?>
104
+ <?php else: ?>
105
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
106
+ <?php endif; ?>
107
+
108
+
109
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
110
+ <br />
111
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
112
+ <small>
113
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
114
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
115
+ <?php endforeach; ?>
116
+ </small>
117
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
118
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
119
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
120
+ <?php endforeach; ?>
121
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
122
+ <small>
123
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
124
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
125
+ <?php endforeach; ?>
126
+ </small>
127
+ <?php endif; ?>
128
+
129
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
130
+ <br />
131
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
132
+ <?php
133
+ echo $this->displayPrices(
134
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
135
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
136
+ );
137
+ ?>
138
+ </span>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+ </span>
142
+ <br />
143
+ <?php endif; ?>
144
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
145
+ <span class="price-incl-tax">
146
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
147
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
148
+ <?php endif; ?>
149
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
150
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
151
+
152
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
153
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
154
+ <?php else: ?>
155
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
156
+ <?php endif; ?>
157
+
158
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
159
+ <br />
160
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
161
+ <small>
162
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
163
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
164
+ <?php endforeach; ?>
165
+ </small>
166
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
167
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
168
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
169
+ <?php endforeach; ?>
170
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
171
+ <small>
172
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
173
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
174
+ <?php endforeach; ?>
175
+ </small>
176
+ <?php endif; ?>
177
+
178
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
179
+ <br />
180
+ <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>
181
+ <?php endif; ?>
182
+ <?php endif; ?>
183
+ </span>
184
+ <?php endif; ?>
185
+ <?php else: ?>
186
+ &nbsp;
187
+ <?php endif; ?>
188
+ </td>
189
+ <td>
190
+ <?php if ($this->canShowPriceInfo($_item)): ?>
191
+ <table cellspacing="0" class="qty-table">
192
+ <tr>
193
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
194
+ <td><strong><?php echo $_item->getQtyOrdered()*1 ?></strong></td>
195
+ </tr>
196
+ <?php if ((float) $_item->getQtyInvoiced()): ?>
197
+ <tr>
198
+ <td><?php echo Mage::helper('sales')->__('Invoiced') ?></td>
199
+ <td><strong><?php echo $_item->getQtyInvoiced()*1 ?></strong></td>
200
+ </tr>
201
+ <?php endif; ?>
202
+ <?php if ((float) $_item->getQtyShipped() && $this->isShipmentSeparately($_item)): ?>
203
+ <tr>
204
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
205
+ <td><strong><?php echo $_item->getQtyShipped()*1 ?></strong></td>
206
+ </tr>
207
+ <?php endif; ?>
208
+ <?php if ((float) $_item->getQtyRefunded()): ?>
209
+ <tr>
210
+ <td><?php echo Mage::helper('sales')->__('Refunded') ?></td>
211
+ <td><strong><?php echo $_item->getQtyRefunded()*1 ?></strong></td>
212
+ </tr>
213
+ <?php endif; ?>
214
+ <?php if ((float) $_item->getQtyCanceled()): ?>
215
+ <tr>
216
+ <td><?php echo Mage::helper('sales')->__('Canceled') ?></td>
217
+ <td><strong><?php echo $_item->getQtyCanceled()*1 ?></strong></td>
218
+ </tr>
219
+ <?php endif; ?>
220
+ </table>
221
+ <?php elseif ($this->isShipmentSeparately($_item)): ?>
222
+ <table cellspacing="0" class="qty-table">
223
+ <tr>
224
+ <td><?php echo Mage::helper('sales')->__('Ordered') ?></td>
225
+ <td><strong><?php echo $_item->getQtyOrdered()*1 ?></strong></td>
226
+ </tr>
227
+ <?php if ((float) $_item->getQtyShipped()): ?>
228
+ <tr>
229
+ <td><?php echo Mage::helper('sales')->__('Shipped') ?></td>
230
+ <td><strong><?php echo $_item->getQtyShipped()*1 ?></strong></td>
231
+ </tr>
232
+ <?php endif; ?>
233
+ </table>
234
+ <?php else: ?>
235
+ &nbsp;
236
+ <?php endif; ?>
237
+ </td>
238
+ <td class="a-right">
239
+ <?php if ($this->canShowPriceInfo($_item)): ?>
240
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
241
+ <span class="price-excl-tax">
242
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
243
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
244
+ <?php endif; ?>
245
+
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
247
+ <?php
248
+ echo $this->displayPrices(
249
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
250
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
251
+ );
252
+ ?>
253
+ <?php else: ?>
254
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
255
+ <?php endif; ?>
256
+
257
+
258
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
259
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
260
+ <small>
261
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
262
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
263
+ <?php endforeach; ?>
264
+ </small>
265
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
266
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
267
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
268
+ <?php endforeach; ?>
269
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
270
+ <small>
271
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
272
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
273
+ <?php endforeach; ?>
274
+ </small>
275
+ <?php endif; ?>
276
+
277
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
278
+ <br />
279
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
280
+ <?php
281
+ echo $this->displayPrices(
282
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
283
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
284
+ );
285
+ ?>
286
+ </span>
287
+ <?php endif; ?>
288
+ <?php endif; ?>
289
+ </span>
290
+ <br />
291
+ <?php endif; ?>
292
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
293
+ <span class="price-incl-tax">
294
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
295
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
296
+ <?php endif; ?>
297
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
298
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
299
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
300
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
301
+ <?php else: ?>
302
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
303
+ <?php endif; ?>
304
+
305
+
306
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
307
+
308
+ <br />
309
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
310
+ <small>
311
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
312
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
313
+ <?php endforeach; ?>
314
+ </small>
315
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
316
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
317
+ <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>
318
+ <?php endforeach; ?>
319
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
320
+ <small>
321
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
322
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
323
+ <?php endforeach; ?>
324
+ </small>
325
+ <?php endif; ?>
326
+
327
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
328
+ <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>
329
+ <?php endif; ?>
330
+ <?php endif; ?>
331
+ </span>
332
+ <?php endif; ?>
333
+ <?php else: ?>
334
+ &nbsp;
335
+ <?php endif; ?>
336
+ </td>
337
+ <td class="a-right">
338
+ <?php if ($this->canShowPriceInfo($_item)): ?>
339
+ <?php echo $this->displayPriceAttribute('tax_amount') ?>
340
+ <?php else: ?>
341
+ &nbsp;
342
+ <?php endif; ?>
343
+ </td>
344
+
345
+ <td class="a-right">
346
+ <?php if ($this->canShowPriceInfo($_item)): ?>
347
+ <?php echo $this->displayTaxPercent($_item) ?>
348
+ <?php else: ?>
349
+ &nbsp;
350
+ <?php endif; ?>
351
+ </td>
352
+ <td class="a-right">
353
+ <?php if ($this->canShowPriceInfo($_item)): ?>
354
+ <?php echo $this->displayPriceAttribute('discount_amount') ?>
355
+ <?php else: ?>
356
+ &nbsp;
357
+ <?php endif; ?>
358
+ </td>
359
+ <td class="a-right last">
360
+ <?php if ($this->canShowPriceInfo($_item)): ?>
361
+ <?php echo $this->displayPrices(
362
+ max(0, $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount()),
363
+ max(0, $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount())
364
+ ); ?>
365
+ <?php else: ?>
366
+ &nbsp;
367
+ <?php endif; ?>
368
+ </td>
369
+ </tr>
370
+ <?php endforeach; ?>
371
+ <?php if($_showlastRow): ?>
372
+ <tr<?php if (!$this->canDisplayGiftmessage()) echo ' class="border"' ?>>
373
+ <td>
374
+ <?php if ($this->getOrderOptions()): ?>
375
+ <dl class="item-options">
376
+ <?php foreach ($this->getOrderOptions() as $option): ?>
377
+ <dt><?php echo $option['label'] ?>:</dt>
378
+ <dd>
379
+ <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
380
+ <?php echo $option['value'];?>
381
+ <?php else: ?>
382
+ <?php echo Mage::helper('core/string')->truncate($option['value'], 55, '', $_remainder);?>
383
+ <?php if ($_remainder):?>
384
+ ... <span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_remainder ?></span>
385
+ <script type="text/javascript">
386
+ $('<?php echo $_id ?>').hide();
387
+ $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
388
+ $('<?php echo $_id ?>').up().observe('mouseout', function(){$('<?php echo $_id ?>').hide();});
389
+ </script>
390
+ <?php endif;?>
391
+ <?php endif;?>
392
+ </dd>
393
+ <?php endforeach; ?>
394
+ </dl>
395
+ <?php else: ?>
396
+ &nbsp;
397
+ <?php endif; ?>
398
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
399
+ </td>
400
+ <td>&nbsp;</td>
401
+ <td>&nbsp;</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 class="last">&nbsp;</td>
409
+ </tr>
410
+ <?php endif; ?>
411
+ <script type="text/javascript">
412
+
413
+ function respondToClick(id) {
414
+ $('change_status-'+id).show();
415
+ }
416
+
417
+ function respondToChange(obj) {
418
+ var itemId = obj.id.split('-');
419
+ new Ajax.Request('<?php echo $this->getUrl('amosoft/adminhtml_amosoft/changeStatusAjax') ?>', {
420
+ parameters: {
421
+ 'amosoft_item_id': itemId[1],
422
+ 'amosoft_item_status': obj.value
423
+ },
424
+ method: 'post',
425
+ onSuccess: success,
426
+ onFailure: fail
427
+ });
428
+ }
429
+
430
+ function success(response){
431
+ var data = response.responseText.evalJSON();
432
+ var id = data.amosoft_item_id;
433
+ $(id).innerHTML = data.amosoft_item_status;
434
+ alert(data.msg);
435
+ $('change_status-'+id).hide();
436
+ }
437
+
438
+ function fail(response){
439
+ alert("Request cannot be completed");
440
+ }
441
+ </script>
app/design/adminhtml/default/default/template/amosoft/custom-msg.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <div class="custom-msg" id="messages"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
app/design/adminhtml/default/default/template/amosoft/downloadable/downloadable.phtml ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $this->setPriceDataObject($_item) ?>
29
+ <tr<?php if ($this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>>
30
+ <td class="giftmessage-single-item">
31
+ <?php if ($this->canDisplayContainer()): ?>
32
+ <div id="<?php echo $this->getHtmlId() ?>" class="item-container">
33
+ <?php endif; ?>
34
+ <div class="item-text">
35
+ <?php echo $this->getColumnHtml($_item, 'downloadable') ?>
36
+ </div>
37
+ <?php if ($this->canDisplayContainer()): ?>
38
+ </div>
39
+ <?php endif ?>
40
+ </td>
41
+ <?php
42
+ $ItemStatus = $_item->getAmosoftItemStatus();
43
+ ?>
44
+ <td class="a-center"><?php echo $_item->getStatus() ?></td>
45
+ <td class="a-center">
46
+ <span id="<?php echo $_item->getItemId() ?>"><?php echo $ItemStatus; ?></span>
47
+ <?php if($ItemStatus!=""): ?>
48
+ <p><a id="edit" onclick="respondToClick(<?php echo $_item->getItemId() ?>)" style="cursor:pointer"><?php echo $this->__('Edit') ?></a></p>
49
+ <span id="change_status-<?php echo $_item->getItemId() ?>" style="display:none;">
50
+ <select name="status" id="status-<?php echo $_item->getItemId() ?>" onchange="respondToChange(this)">
51
+ <option value=""><?php echo $this->__('Please select') ?></option>
52
+ <?php foreach(Mage::helper('dropship')->getAmosoftOrderItemStatus() as $status):?>
53
+ <?php if($ItemStatus!=$status): ?>
54
+ <option value="<?php echo $status ?>"><?php echo $status ?></option>
55
+ <?php endif; ?>
56
+ <?php endforeach; ?>
57
+ </select>
58
+ </span>
59
+ <?php endif; ?>
60
+ </td>
61
+ <td class="a-center"><?php echo $_item->getLbVendorName() ?></td>
62
+ <td class="a-center"><?php echo $_item->getAmosoftVendorSku() ?></td>
63
+ <td class="a-right"><?php echo $this->displayPriceAttribute('original_price') ?></td>
64
+ <td class="a-right">
65
+
66
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
67
+ <span class="price-excl-tax">
68
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
69
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
70
+ <?php endif; ?>
71
+
72
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
73
+ <?php
74
+ echo $this->displayPrices(
75
+ $_item->getBasePrice() + $_item->getBaseWeeeTaxAppliedAmount() + $_item->getBaseWeeeTaxDisposition(),
76
+ $_item->getPrice() + $_item->getWeeeTaxAppliedAmount() + $_item->getWeeeTaxDisposition()
77
+ );
78
+ ?>
79
+ <?php else: ?>
80
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
81
+ <?php endif; ?>
82
+
83
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
84
+ <br/>
85
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
86
+ <small>
87
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
88
+ <span class="nobr"><?php echo $tax['title']; ?>
89
+ : <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
90
+ <?php endforeach; ?>
91
+ </small>
92
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
93
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
94
+ <span class="nobr"><small><?php echo $tax['title']; ?>
95
+ : <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
96
+ <?php endforeach; ?>
97
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
98
+ <small>
99
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
100
+ <span class="nobr"><?php echo $tax['title']; ?>
101
+ : <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php endif; ?>
105
+
106
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
107
+ <br/>
108
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br/>
109
+ <?php
110
+ echo $this->displayPrices(
111
+ $_item->getBasePrice() + $_item->getBaseWeeeTaxAppliedAmount() + $_item->getBaseWeeeTaxDisposition(),
112
+ $_item->getPrice() + $_item->getWeeeTaxAppliedAmount() + $_item->getWeeeTaxDisposition()
113
+ );
114
+ ?>
115
+ </span>
116
+ <?php endif; ?>
117
+ <?php endif; ?>
118
+ </span>
119
+ <br/>
120
+ <?php endif; ?>
121
+
122
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax() || $this->helper('tax')->displaySalesBothPrices()): ?>
123
+ <span class="price-incl-tax">
124
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
125
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax'); ?>:</span>
126
+ <?php endif; ?>
127
+ <?php $weeeTaxInclTax = Mage::helper('weee')->getWeeeTaxInclTax($_item); ?>
128
+ <?php if ($weeeTaxInclTax && Mage::helper('weee')->typeOfDisplay($_item, 0, 'sales')): // including ?>
129
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getPriceInclTax($_item) + $weeeTaxInclTax); ?>
130
+ <?php elseif ($weeeTaxInclTax && Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?>
131
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getPriceInclTax($_item) + $weeeTaxInclTax); ?>
132
+ <br/>
133
+ <small>
134
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
135
+ <span class="nobr"><?php echo $tax['title']; ?>
136
+ : <?php echo Mage::helper('core')->currency($tax['amount_incl_tax'], true, true); ?></span>
137
+ <br/>
138
+ <?php endforeach; ?>
139
+ </small>
140
+ <?php elseif ($_item->getWeeeTaxAppliedAmount() && Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?>
141
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getPriceInclTax($_item)); ?>
142
+ <br/>
143
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
144
+ <span class="nobr"><small><?php echo $tax['title']; ?>
145
+ : <?php echo Mage::helper('core')->currency($tax['amount_incl_tax'], true, true); ?></small></span>
146
+ <br/>
147
+ <?php endforeach; ?>
148
+ <span class="nobr">
149
+ <?php echo Mage::helper('weee')->__('Total'); ?>:
150
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getPriceInclTax($_item) + $weeeTaxInclTax); ?>
151
+ </span>
152
+ <?php else: // excl. ?>
153
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getPriceInclTax($_item)); ?>
154
+ <?php endif; ?>
155
+ </span>
156
+ <?php endif; ?>
157
+ </td>
158
+ <td><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
159
+
160
+ <td class="a-right">
161
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
162
+ <span class="price-excl-tax">
163
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
164
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
165
+ <?php endif; ?>
166
+
167
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
168
+ <?php
169
+ echo $this->displayPrices(
170
+ $_item->getBaseRowTotal() + $_item->getBaseWeeeTaxAppliedRowAmount() + $_item->getBaseWeeeTaxRowDisposition(),
171
+ $_item->getRowTotal() + $_item->getWeeeTaxAppliedRowAmount() + $_item->getWeeeTaxRowDisposition()
172
+ );
173
+ ?>
174
+ <?php else: ?>
175
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
176
+ <?php endif; ?>
177
+
178
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
179
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
180
+ <small>
181
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
182
+ <span class="nobr"><?php echo $tax['title']; ?>
183
+ : <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
184
+ <?php endforeach; ?>
185
+ </small>
186
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
187
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
188
+ <span class="nobr"><small><?php echo $tax['title']; ?>
189
+ : <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
190
+ <?php endforeach; ?>
191
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
192
+ <small>
193
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
194
+ <span class="nobr"><?php echo $tax['title']; ?>
195
+ : <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
196
+ <?php endforeach; ?>
197
+ </small>
198
+ <?php endif; ?>
199
+
200
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
201
+ <br/>
202
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br/>
203
+ <?php
204
+ echo $this->displayPrices(
205
+ $_item->getBaseRowTotal() + $_item->getBaseWeeeTaxAppliedRowAmount() + $_item->getBaseWeeeTaxRowDisposition(),
206
+ $_item->getRowTotal() + $_item->getWeeeTaxAppliedRowAmount() + $_item->getWeeeTaxRowDisposition()
207
+ );
208
+ ?>
209
+ </span>
210
+ <?php endif; ?>
211
+ <?php endif; ?>
212
+ </span>
213
+ <br/>
214
+ <?php endif; ?>
215
+
216
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
217
+ <span class="price-incl-tax">
218
+
219
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
220
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax'); ?>:</span>
221
+ <?php endif; ?>
222
+
223
+ <?php if ($_item->getWeeeTaxAppliedRowAmount() && Mage::helper('weee')->typeOfDisplay($_item, 0, 'sales')): // including ?>
224
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getSubtotalInclTax($_item) + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
225
+ <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): // incl. + weee ?>
226
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getSubtotalInclTax($_item) + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
227
+ <br/>
228
+ <small>
229
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
230
+ <span class="nobr"><?php echo $tax['title']; ?>
231
+ : <?php echo Mage::helper('core')->currency($tax['row_amount_incl_tax'], true, true); ?></span>
232
+ <br/>
233
+ <?php endforeach; ?>
234
+ </small>
235
+ <?php elseif ($_item->getWeeeTaxAppliedRowAmount() && Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): // excl. + weee + final ?>
236
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getSubtotalInclTax($_item)); ?>
237
+ <br/>
238
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
239
+ <span class="nobr"><small><?php echo $tax['title']; ?>
240
+ : <?php echo Mage::helper('core')->currency($tax['row_amount_incl_tax'], true, true); ?></small></span>
241
+ <br/>
242
+ <?php endforeach; ?>
243
+ <span class="nobr">
244
+ <?php echo Mage::helper('weee')->__('Total'); ?>:
245
+ <?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getSubtotalInclTax($_item) + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
246
+ </span>
247
+ <?php else: // excl. ?>
248
+ <?php echo $this->displaySubtotalInclTax($_item); ?>
249
+ <?php endif; ?>
250
+
251
+ <!--
252
+
253
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
254
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax'); ?>:</span>
255
+ <?php endif; ?>
256
+ <?php echo $this->displaySubtotalInclTax($_item); ?>
257
+ -->
258
+ </span>
259
+ <?php endif; ?>
260
+ </td>
261
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
262
+ <td class="a-right"><?php echo $this->displayTaxPercent($_item) ?></td>
263
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
264
+ <td class="a-right last">
265
+ <?php echo $this->displayPrices(
266
+ $_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(),
267
+ $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()
268
+ ); ?>
269
+ </td>
270
+ </tr>
271
+ <script type="text/javascript">
272
+
273
+ function respondToClick(id) {
274
+ $('change_status-'+id).show();
275
+ }
276
+
277
+ function respondToChange(obj) {
278
+ var itemId = obj.id.split('-');
279
+ new Ajax.Request('<?php echo $this->getUrl('amosoft/adminhtml_amosoft/changeStatusAjax') ?>', {
280
+ parameters: {
281
+ 'amosoft_item_id': itemId[1],
282
+ 'amosoft_item_status': obj.value
283
+ },
284
+ method: 'post',
285
+ onSuccess: success,
286
+ onFailure: fail
287
+ });
288
+ }
289
+
290
+ function success(response){
291
+ var data = response.responseText.evalJSON();
292
+ var id = data.amosoft_item_id;
293
+ $(id).innerHTML = data.amosoft_item_status;
294
+ alert(data.msg);
295
+ $('change_status-'+id).hide();
296
+ }
297
+
298
+ function fail(response){
299
+ alert("Request cannot be completed");
300
+ }
301
+ </script>
app/design/adminhtml/default/default/template/amosoft/html/pager.phtml ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Pager template
30
+ *
31
+ * @see Mage_Page_Block_Html_Pager
32
+ */
33
+ ?>
34
+ <?php if($this->getCollection()->getSize()): ?>
35
+
36
+ <?php if($this->getUseContainer()): ?>
37
+ <div class="pager">
38
+ <?php endif ?>
39
+
40
+ <?php if($this->getShowAmounts()): ?>
41
+ <p class="amount">
42
+ <?php if($this->getLastPageNum()>1): ?>
43
+ <?php echo $this->__('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
44
+ <?php else: ?>
45
+ <strong><?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?></strong>
46
+ <?php endif; ?>
47
+ </p>
48
+ <?php endif ?>
49
+
50
+ <?php if($this->getShowPerPage()): ?>
51
+ <div class="limiter">
52
+ <label><?php echo $this->__('Show') ?></label>
53
+ <select onchange="setLocation(this.value)">
54
+ <?php foreach ($this->getAvailableLimit() as $_key=>$_limit): ?>
55
+ <option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
56
+ <?php echo $_limit ?>
57
+ </option>
58
+ <?php endforeach; ?>
59
+ </select> <?php echo $this->__('per page') ?>
60
+ </div>
61
+ <?php endif ?>
62
+
63
+ <?php if($this->getLastPageNum()>1): ?>
64
+ <div class="pages">
65
+ <strong><?php echo $this->__('Page:') ?></strong>
66
+ <ol>
67
+ <?php if (!$this->isFirstPage()): ?>
68
+ <li>
69
+ <a class="previous<?php if(!$this->getAnchorTextForPrevious()): ?> i-previous<?php endif;?>" href="<?php echo $this->getPreviousPageUrl() ?>" title="<?php echo $this->__('Previous') ?>">
70
+ <?php if(!$this->getAnchorTextForPrevious()): ?>
71
+ <img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="<?php echo $this->__('Previous') ?>" class="v-middle" />
72
+ <?php else: ?>
73
+ <?php echo $this->getAnchorTextForPrevious() ?>
74
+ <?php endif;?>
75
+ </a>
76
+ </li>
77
+ <?php endif;?>
78
+
79
+ <?php if ($this->canShowFirst()): ?>
80
+ <li><a class="first" href="<?php echo $this->getFirstPageUrl() ?>">1</a></li>
81
+ <?php endif;?>
82
+
83
+ <?php if ($this->canShowPreviousJump()): ?>
84
+ <li><a class="previous_jump" title="" href="<?php echo $this->getPreviousJumpUrl() ?>">...</a></li>
85
+ <?php endif;?>
86
+
87
+ <?php foreach ($this->getFramePages() as $_page): ?>
88
+ <?php if ($this->isPageCurrent($_page)): ?>
89
+ <li class="current"><?php echo $_page ?></li>
90
+ <?php else: ?>
91
+ <li><a href="<?php echo $this->getPageUrl($_page) ?>"><?php echo $_page ?></a></li>
92
+ <?php endif;?>
93
+ <?php endforeach;?>
94
+
95
+
96
+ <?php if ($this->canShowNextJump()): ?>
97
+ <li><a class="next_jump" title="" href="<?php echo $this->getNextJumpUrl() ?>">...</a></li>
98
+ <?php endif;?>
99
+
100
+ <?php if ($this->canShowLast()): ?>
101
+ <li><a class="last" href="<?php echo $this->getLastPageUrl() ?>"><?php echo $this->getLastPageNum() ?></a></li>
102
+ <?php endif;?>
103
+
104
+ <?php if (!$this->isLastPage()): ?>
105
+ <li>
106
+ <a class="next<?php if(!$this->getAnchorTextForNext()): ?> i-next<?php endif; ?>" href="<?php echo $this->getNextPageUrl() ?>" title="<?php echo $this->__('Next') ?>">
107
+ <?php if(!$this->getAnchorTextForNext()): ?>
108
+ <img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="<?php echo $this->__('Next') ?>" class="v-middle" />
109
+ <?php else: ?>
110
+ <?php echo $this->getAnchorTextForNext() ?>
111
+ <?php endif;?>
112
+ </a>
113
+ </li>
114
+ <?php endif;?>
115
+ </ol>
116
+
117
+ </div>
118
+ <?php endif; ?>
119
+
120
+ <?php if($this->getUseContainer()): ?>
121
+ </div>
122
+ <?php endif ?>
123
+
124
+ <?php endif ?>
app/design/adminhtml/default/default/template/amosoft/import/form/after.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <div class="entry-edit" id="import_validation_container" style="display:none;">
10
+ <div class="entry-edit-head">
11
+ <h4 class="icon-head head-edit-form fieldset-legend" id="import_validation_container_header"><?php echo $this->__('Validation Results'); ?></h4>
12
+ </div>
13
+ <div id="import_validation_messages" class="fieldset "><!-- --></div>
14
+ </div>
app/design/adminhtml/default/default/template/amosoft/import/form/before.phtml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <script type="text/javascript">
10
+ //<![CDATA[
11
+ /**
12
+ * Name and ID for iframe for data POST-ing.
13
+ *
14
+ * @var string
15
+ */
16
+ varienForm.prototype.ifrElemName = 'import_post_target_frame';
17
+
18
+ /**
19
+ * Post form data to dynamic iframe.
20
+ *
21
+ * @param string newActionUrl OPTIONAL Change form action to this if specified
22
+ * @return void
23
+ */
24
+ varienForm.prototype.postToFrame = function(newActionUrl)
25
+ {
26
+ if(this.validate()){
27
+ // create dynamic frame
28
+ if (!$(this.ifrElemName)) {
29
+ $('html-body').insert({
30
+ bottom:'<iframe name="' + this.ifrElemName + '" id="' + this.ifrElemName + '" style="display:none;"/>'
31
+ });
32
+ }
33
+
34
+ // show mask, temporary set new target and submit form
35
+ var loadingMask = $('loading-mask');
36
+ var formElem = $(this.formId);
37
+ var oldTarget = formElem.target;
38
+ var oldAction = formElem.action;
39
+
40
+ Element.clonePosition(loadingMask, $$('#html-body .wrapper')[0], {offsetLeft:-2})
41
+ toggleSelectsUnderBlock(loadingMask, false);
42
+ loadingMask.show();
43
+ setLoaderPosition();
44
+ formElem.target = this.ifrElemName;
45
+
46
+ if (newActionUrl) {
47
+ formElem.action = newActionUrl;
48
+ }
49
+ formElem.action += (formElem.action.lastIndexOf('?') != -1 ? '&' : '?')
50
+ + 'form_key=' + encodeURIComponent(formElem.form_key.value);
51
+ this._submit();
52
+ formElem.target = oldTarget;
53
+ formElem.action = oldAction;
54
+ }
55
+ };
56
+
57
+ /**
58
+ * Actions after data post complete. Hide load mask, remove iframe, run response processing method.
59
+ *
60
+ * @param object response
61
+ * @return void
62
+ */
63
+ varienForm.prototype.postToFrameComplete = function(response)
64
+ {
65
+ var loadingMask = $('loading-mask');
66
+ $(this.ifrElemName).remove();
67
+ toggleSelectsUnderBlock(loadingMask, true);
68
+ loadingMask.hide();
69
+ this.postToFrameProcessResponse(response);
70
+ };
71
+
72
+ /**
73
+ * Process response JSON.
74
+ *
75
+ * @param object response
76
+ * @return void
77
+ */
78
+ varienForm.prototype.postToFrameProcessResponse = function(response)
79
+ {
80
+ if ('object' != typeof(response)) {
81
+ return alert('Invalid response');
82
+ }
83
+ $H(response).each(function(pair) {
84
+ switch (pair.key) {
85
+ case 'show':
86
+ case 'clear':
87
+ case 'hide':
88
+ $H(pair.value).each(function(val) {if ($(val.value)) $(val.value)[pair.key]();});
89
+ break;
90
+ case 'innerHTML':
91
+ case 'value':
92
+ $H(pair.value).each(function(val) {
93
+ var el = $(val.key);
94
+ if (el) {
95
+ el[pair.key] = val.value;
96
+ // if element does not visible
97
+ el.offsetWidth || el.up('div.entry-edit').show();
98
+ }
99
+ });
100
+ break;
101
+ case 'removeClassName':
102
+ case 'addClassName':
103
+ $H(pair.value).each(function(val) {if ($(val.key)) $(val.key)[pair.key](val.value);});
104
+ break;
105
+ default:
106
+ alert(pair.key + ': ' + pair.value);
107
+ break;
108
+ }
109
+ });
110
+ };
111
+
112
+ /**
113
+ * Send form data to Start action when file is validated.
114
+ *
115
+ * @param string newActionUrl
116
+ * @param string sourceFileField
117
+ * @return void
118
+ */
119
+ varienForm.prototype.startImport = function(newActionUrl, sourceFileField)
120
+ {
121
+ $(sourceFileField).removeClassName('required-entry');
122
+ this.postToFrame(newActionUrl);
123
+ $(sourceFileField).addClassName('required-entry');
124
+ };
125
+ //]]>
126
+ </script>
app/design/adminhtml/default/default/template/amosoft/import/frame/result.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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.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
+ top.editForm.postToFrameComplete(<?php echo $this->getResponseJson() ?>);
30
+ //]]>
31
+ </script>
app/design/adminhtml/default/default/template/amosoft/inline-edit.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+
10
+
11
+ <script type="text/javascript">
12
+ //<![CDATA[
13
+
14
+ function saveRanking()
15
+ {
16
+
17
+
18
+ var arrDropshipParameter = $H({});
19
+ var arrNonDropshipParameter = $H({});
20
+ var arrVendorNameParameter = $H({});
21
+ var arrVendorProductLinkParameter = $H({});
22
+ arrDropshipParameter.set(JSON.stringify(arrDropship));
23
+ arrNonDropshipParameter.set(JSON.stringify(arrNonDropship));
24
+ arrVendorNameParameter.set(JSON.stringify(arrVendorName));
25
+ arrVendorProductLinkParameter.set(JSON.stringify(arrVendorProductLink));
26
+
27
+
28
+
29
+
30
+ var actionUrl = '<?php echo Mage::getSingleton('adminhtml/url')->getUrl('*/*/saveranking') ?>'
31
+ var formdataStart = "<form id='edit_form_ranking' action='"+actionUrl+"' method='post'></form>";
32
+ var formDataEnd = "<div><input name='partent_save_table_input' id='partent_save_table_input' type='hidden' value=''><input name='dropship_data' id='dropship_data' type='hidden' value=''><input name='nondropship_data' id='nondropship_data' type='hidden' value=''><input name='vendorname_data' id='vendorname_data' type='hidden' value=''><input name='vendorproductlink_data' id='vendorproductlink_data' type='hidden' value=''> <input name='form_key' type='hidden' value='<?php echo Mage::getSingleton('core/session')->getFormKey() ?>' /></div>";
33
+
34
+ if(!$('edit_form_ranking'))
35
+ {
36
+ $('panel').insert(formdataStart);
37
+ $('edit_form_ranking').insert(formDataEnd);
38
+ }
39
+
40
+
41
+
42
+ $('dropship_data').value = arrDropshipParameter.toQueryString();
43
+ $('nondropship_data').value = arrNonDropshipParameter.toQueryString();
44
+ $('vendorname_data').value = arrVendorNameParameter.toQueryString();
45
+ $('vendorproductlink_data').value = arrVendorProductLinkParameter.toQueryString();
46
+ }
47
+ function setTableName(name){
48
+
49
+ $('partent_save_table_input').value = name;
50
+ }
51
+
52
+ function submitPartentFrom(){
53
+ closePopup();
54
+ $('edit_form_ranking').submit();
55
+ }
56
+
57
+ function showPopup(sUrl) {
58
+ oPopup = new Window({
59
+ id:'popup_window',
60
+ className: 'magento',
61
+ url: sUrl,
62
+ width: 350,
63
+ height: 100,
64
+ minimizable: false,
65
+ maximizable: false,
66
+ showEffectOptions: {
67
+ duration: 0.4
68
+ },
69
+ hideEffectOptions:{
70
+ duration: 0.4
71
+ },
72
+ destroyOnClose: true
73
+ });
74
+ oPopup.setZIndex(100);
75
+ oPopup.showCenter(true);
76
+ }
77
+
78
+ function closePopup() {
79
+ Windows.close('popup_window');
80
+ }
81
+
82
+ function saveRankingTable()
83
+ {
84
+ showPopup('<?php echo Mage::getSingleton('adminhtml/url')->getUrl('*/*/popup',array('_query'=>array('issuccessfull' => ''))) ?>')
85
+ }
86
+
87
+
88
+ //]]>
89
+ </script>
app/design/adminhtml/default/default/template/amosoft/item_order_history.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <?php
10
+ $amosoftItemDescSort = $this->getHistory();
11
+ if(is_array($amosoftItemDescSort))
12
+ krsort($amosoftItemDescSort);
13
+ ?>
14
+ <div class="entry-edit">
15
+ <fieldset>
16
+ <ul class="note-list">
17
+ <?php if($this->getHistory()) : ?>
18
+ <?php foreach ($amosoftItemDescSort as $item): ?>
19
+ <li>
20
+ <strong><?php echo Mage::helper('core')->formatDate($item['date'], 'medium', false);//echo $item['date']; ?></strong>
21
+ <?php echo Mage::helper('core')->formatTime($item['date'], 'medium', false); ?><span class="separator">|</span>
22
+ <strong><?php echo $item['item_status']; ?></strong>
23
+ <span class="separator">|</span>
24
+ <small>
25
+ <strong class="subdue">
26
+ <?php echo Mage::getModel('sales/order_status')->load($item['order_status'], 'status')->getStoreLabel(); ?>
27
+ <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16px" height="16px" alt="" />
28
+ </strong>
29
+ </small>
30
+ </li>
31
+ <?php endforeach; ?>
32
+ <?php else : ?>
33
+ <?php echo $this->__('No Records Found')?>
34
+ <?php endif; ?>
35
+ </ul>
36
+ </fieldset>
37
+ </div>
app/design/adminhtml/default/default/template/amosoft/popup.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <!DOCTYPE html>
10
+ <html>
11
+ <head>
12
+ <title>Payment form</title>
13
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
14
+ <script type="text/javascript" src="<?php echo $this->getJsUrl() ?>prototype/prototype.js"></script>
15
+ <script type="text/javascript" src="<?php echo $this->getJsUrl() ?>prototype/validation.js"></script>
16
+ <script type="text/javascript" src="<?php echo $this->getJsUrl() ?>mage/adminhtml/form.js"></script>
17
+ <style>
18
+ .validation-advice {
19
+ clear: both;
20
+ min-height: 15px;
21
+ margin: 3px 0 5px 9px;
22
+ padding-left: 135px;
23
+ font-size: .95em;
24
+ font-weight: bold;
25
+ line-height: 1.25em;
26
+ color: #D40707;
27
+
28
+ }
29
+ </style>
30
+
31
+ </head>
32
+ <body style="background-color:#fff9e9">
33
+ <div id="messages"></div>
34
+
35
+ <div>
36
+ <input name='form_key' type='hidden' value='<?php echo Mage::getSingleton('core/session')->getFormKey() ?>' />
37
+ <label class="label-msg">Please enter a name for the supplier Ranking History entry &nbsp;</label><span><input id="save_table_input" class="required-entry" name="save_table" value=""></span>
38
+ <div class="validation-advice" id="error-input" style="display: none;">This is a required field.</div>
39
+
40
+ <button style="margin-left:100px" type="button" id="save_table" onclick="submitForm()" >Save Table</button>
41
+ <span><button type="button" id="save_table_close" name="save_table_close" value="save table" onclick="parent.closePopup();">Close</button></span>
42
+
43
+ </div>
44
+
45
+
46
+ <script type="text/javascript">
47
+ function submitForm()
48
+ {
49
+ if($('save_table_input').value == '')
50
+ {
51
+ return $('error-input').setStyle({display:'block'})
52
+ }
53
+ $('save_table').setAttribute('disabled','disabled');
54
+ $('save_table_close').setAttribute('disabled','disabled');
55
+ $('error-input').setStyle({display:'none'})
56
+ parent.saveRanking();
57
+ parent.setTableName($('save_table_input').value);
58
+ parent.submitPartentFrom();
59
+ }
60
+ </script>
61
+ </body>
62
+ </html>
app/design/adminhtml/default/default/template/amosoft/process-profile.phtml ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <style type="text/css" >
10
+ ul { list-style-type:none; padding:0; margin:0; }
11
+ li { margin-left:0; border:1px solid #ccc; margin:2px; padding:2px 2px 2px 2px; font:normal 12px sans-serif; }
12
+ img { margin-right:5px; }
13
+ </style>
14
+ <script type="text/javascript">
15
+ var FORM_KEY = "<?php echo $this->getFormKey();?>";
16
+ if (typeof auto_scroll=='undefined') {
17
+ var auto_scroll = window.setInterval(console_scroll, 10);
18
+ }
19
+ function console_scroll()
20
+ {
21
+ if (typeof top.$ != 'function') {
22
+ return;
23
+ }
24
+ document.body.scrollTop+=100;
25
+ }
26
+ </script>
27
+ <?php if($this->isManualUploadRunning()){ ?>
28
+ <ul>
29
+ <li>
30
+ <img src="<?php echo $this->getSkinUrl('images/error_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
31
+ <?php echo $this->__("Manual upload is currently running please try again later");?>
32
+ </li>
33
+ </ul>
34
+ <?php }else{ ?>
35
+ <ul>
36
+ <li>
37
+ <?php if ($this->getBulkVendorCode()):?>
38
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle" style="margin-right:5px"/>
39
+ <?php echo $this->__("Starting bulk profile execution, please wait...");?>
40
+ </li>
41
+ <li style="background-color:#FFD;">
42
+ <img src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif');?>" class="v-middle" style="margin-right:5px"/>
43
+ <?php echo $this->__("Warning: Please do not close the window during importing/exporting data");?>
44
+ <?php else:?>
45
+ <img src="<?php echo $this->getSkinUrl('images/error_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
46
+ <?php echo $this->__("No profile loaded...");?>
47
+ <?php endif;?>
48
+ </li>
49
+ </ul>
50
+
51
+ <?php if ($this->getBulkVendorCode()):?>
52
+ <ul id="profileRows">
53
+ <li id="liNoproduct" style="display:none;">
54
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
55
+ <?php echo $this->__("No simple product found");?>
56
+ </li>
57
+ <li id="liFinished" style="display:none;">
58
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
59
+ <?php echo $this->__("Finished bulk profile execution.");?>
60
+ </li>
61
+ <li id="liFinishederror" style="display:none;">
62
+ <img src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif');?>" class="v-middle" style="margin-right:5px"/>
63
+ <?php echo $this->__("Bulk profile execution hault due to error");?>
64
+ </li>
65
+ <li id="get_csv" style="display:none;">
66
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
67
+ <button onclick = "genrateCSV()"><?php echo $this->__("Download Failed Sku Csv");?></button>
68
+ </li>
69
+ <li id="get_csv_success" style="display:none;">
70
+ <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
71
+ <button onclick = "genrateCSV('success')"><?php echo $this->__("Download Success Sku Csv");?></button>
72
+ </li>
73
+ </ul>
74
+ <?php if ($this->getBatchModel() > 0):?>
75
+
76
+ <script type="text/javascript">
77
+ var countOfStartedProfiles = 0;
78
+ var countOfUpdated = 0;
79
+ var countOfError = 0;
80
+ var importData = [];
81
+ var totalRecords = <?php echo $this->getBatchItemsCount();?>;
82
+ var config= <?php echo $this->getBatchConfigJson();?>;
83
+ var errorSku = [];
84
+ var successSku = [];
85
+ var successSkuCount = 0;
86
+ </script>
87
+ <script type="text/javascript">
88
+
89
+ window.onbeforeunload = function (evt) {
90
+ if(importData.length == 0){
91
+ return null;
92
+ }
93
+ new Ajax.Request("<?php echo $this->getUrl('*/*/batchFinish', array('exeuctionTerminated' => 1));?>", {
94
+ method: "post",
95
+ parameters: {form_key: FORM_KEY,sucees_sku:successSkuCount,errorSkuCount:errorSku.length,amosoft_vendor_code:'<?php echo Mage::registry('bulk_vendor_Code') ?>'},
96
+ asynchronous : true,
97
+ });
98
+
99
+ return;
100
+ }
101
+
102
+ function addImportData(data) {
103
+ importData.push(data);
104
+ }
105
+
106
+ function execImportData() {
107
+ if (importData.length == 0) {
108
+ $("updatedRows_img").src = config.styles.message.icon;
109
+ $("updatedRows").style.backgroundColor = config.styles.message.bg;
110
+ Element.insert($("liFinished"), {before: config.tpl.evaluate({
111
+ style: "background-color:"+config.styles.message.bg,
112
+ image: config.styles.message.icon,
113
+ text: config.tplSccTxt.evaluate({updated:(countOfUpdated-countOfError)}),
114
+ id: "updatedFinish"
115
+ })});
116
+
117
+ if ($("liBeforeFinish")) {
118
+ Element.insert($("liFinished"), {before: $("liBeforeFinish")});
119
+ $("liBeforeFinish").show();
120
+ }
121
+
122
+ new Ajax.Request("<?php echo $this->getUrl('*/*/batchFinish', array('exeuctionTerminated' => 0));?>", {
123
+ method: "post",
124
+ parameters: {form_key: FORM_KEY,sucees_sku:successSkuCount,errorSkuCount:errorSku.length,amosoft_vendor_code:'<?php echo Mage::registry('bulk_vendor_Code') ?>'},
125
+ onComplete: function(transport) {
126
+ if (transport.responseText.isJSON()) {
127
+ var response = transport.responseText.evalJSON();
128
+ if (response.error) {
129
+ Element.insert($("liFinished"), {before: config.tpl.evaluate({
130
+ style: "background-color:"+config.styles.error.bg,
131
+ image: config.styles.error.icon,
132
+ text: response.error.escapeHTML(),
133
+ id: "error-finish"
134
+ })});
135
+ }
136
+ }
137
+
138
+ if ($("before-finish-wait-img")) {
139
+ $("before-finish-wait-img").hide();
140
+ }
141
+
142
+ $('liFinished').show();
143
+ if(errorSku.length > 0)
144
+ {
145
+ $('get_csv').show();
146
+
147
+ }
148
+ if(successSku.length > 0)
149
+ {
150
+ $('get_csv_success').show();
151
+ }
152
+ },
153
+ onFailure:function(){
154
+ alert('Not able to connect to server');
155
+ $('liFinishederror').show();
156
+ }
157
+ });
158
+ } else {
159
+ sendImportData(importData.shift());
160
+ }
161
+ }
162
+
163
+ function sendImportData(data) {
164
+ if (!config.tpl) {
165
+ config.tpl = new Template(config.template);
166
+ config.tplTxt = new Template(config.text);
167
+ config.tplSccTxt = new Template(config.successText);
168
+ }
169
+ if (!$("updatedRows")) {
170
+ Element.insert($("liFinished"), {before: config.tpl.evaluate({
171
+ style: "background-color: #FFD;",
172
+ image: config.styles.loader,
173
+ text: config.tplTxt.evaluate({updated:countOfUpdated, percent:getPercent()}),
174
+ id: "updatedRows"
175
+ })});
176
+ }
177
+ countOfStartedProfiles++;
178
+ if (!data.form_key) {
179
+ data.form_key = FORM_KEY;
180
+ }
181
+
182
+ new Ajax.Request("<?php echo $this->getUrl('*/*/batchRun');?>", {
183
+ method: "post",
184
+ parameters: data,
185
+ onSuccess: function(transport) {
186
+ countOfStartedProfiles --;
187
+ countOfUpdated += data["rows[]"].length;
188
+ if (transport.responseText.isJSON()) {
189
+ addProfileRow(transport.responseText.evalJSON());
190
+ } else {
191
+ Element.insert($("updatedRows"), {before: config.tpl.evaluate({
192
+ style: "background-color:"+config.styles.error.bg,
193
+ image: config.styles.error.icon,
194
+ text: transport.responseText.escapeHTML(),
195
+ id: "error-" + countOfStartedProfiles
196
+ })});
197
+ countOfError += data["rows[]"].length;
198
+ }
199
+ execImportData();
200
+ },
201
+ onFailure:function(){
202
+ alert('Not able to connect to server');
203
+ $('liFinishederror').show();
204
+ }
205
+ });
206
+ }
207
+
208
+ function getPercent() {
209
+ return Math.ceil((countOfUpdated/totalRecords)*1000)/10;
210
+ }
211
+
212
+ function addProfileRow(data) {
213
+ if (data.errors.length > 0) {
214
+ for (var i=0, length=data.errors.length; i<length; i++) {
215
+ Element.insert($("updatedRows"), {before: config.tpl.evaluate({
216
+ style: "background-color:"+config.styles.error.bg,
217
+ image: config.styles.error.icon,
218
+ text: data.errors[i],
219
+ id: "id-" + (countOfUpdated + i + 1)
220
+ })});
221
+ countOfError ++;
222
+ errorSku.push(data.skuError[i]);
223
+ }
224
+ }
225
+ $("updatedRows_status").update(config.tplTxt.evaluate({updated:countOfUpdated, percent:getPercent()}));
226
+ if (data.savedRows > 0) {
227
+ successSkuCount += data.savedRows;
228
+ for (var i=0, length=data.skuSuccess.length; i<length; i++) {
229
+ successSku.push(data.skuSuccess[i]);
230
+ }
231
+
232
+ }
233
+
234
+
235
+ }
236
+
237
+ function genrateCSV(type){
238
+
239
+ var csvContent;
240
+ var sku = (type == 'success') ? successSku : errorSku;
241
+ csvContent = prepareCSVcontent(sku,type)
242
+ var encodedUri = encodeURI(csvContent);
243
+ var link = document.createElement("a");
244
+ if (link.download !== undefined){
245
+ link.setAttribute("href", encodedUri);
246
+ link.setAttribute("download", "my_data.csv");
247
+ document.body.appendChild(link);
248
+ link.click();
249
+ document.body.removeChild(link);
250
+ }else
251
+ {
252
+ alert('CSV export only works in Chrome, Firefox, and Opera.');
253
+ }
254
+
255
+ }
256
+
257
+ function prepareCSVcontent(sku,type){
258
+
259
+ if(sku.length < 0)
260
+ {
261
+ return;
262
+ }
263
+ var headerTitle = (type == 'success') ? 'Success Sku' : 'Failed Sku';
264
+ var csvContent = "data:text/csv;charset=utf-8,";
265
+ if(sku[0] != headerTitle) sku.unshift(headerTitle);
266
+ for(var i=0;i<sku.length;i++)
267
+ {
268
+ if(sku[i] !== 'undefined')
269
+ csvContent += sku[i]+ "\n";
270
+ }
271
+ return csvContent;
272
+
273
+ }
274
+ </script>
275
+ <?php $importData = $this->getImportData();?>
276
+ <script type="text/javascript">
277
+ <?php foreach ($importData as $importValue):?>
278
+ addImportData(<?php echo $this->jsonEncode($importValue);?>);
279
+ <?php endforeach;?>
280
+ execImportData();
281
+ </script>
282
+ <?php else: ?>
283
+ <script type="text/javascript">$('liNoproduct').show();</script>
284
+ <?php endif;?>
285
+
286
+ <?php if ($this->getShowFinished()):?>
287
+ <script type="text/javascript">$('liFinished').show();</script>
288
+ <?php endif;?>
289
+ <?php endif;?>
290
+ <?php } ?>
app/design/adminhtml/default/default/template/amosoft/result.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <?php $collection = $this->getLogCollection(); ?>
10
+
11
+ <div class="content-header">
12
+ <table cellspacing="0">
13
+ <tr>
14
+ <td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml() ?></td>
15
+ <td class="form-buttons"><?php echo $this->getButtonsHtml() ?></td>
16
+ </tr>
17
+ </table>
18
+ </div>
19
+ <div class="grid">
20
+ <?php if(count($collection) > 0): ?>
21
+ <table cellspacing="0" class="data" id="amosoftgrid_table">
22
+ <?php foreach($collection as $key => $logArray){ ?>
23
+ <thead>
24
+ <tr class="tablelogheading" >
25
+ <td colspan="5"><ul class = " logheading"><li><strong><?php echo $this->formatDate($logArray['created'], 'medium', true); ?><span class="separator">|</span><strong><?php echo $key; ?></strong></li></ul></td>
26
+
27
+ </tr>
28
+ <tr class="headings">
29
+ <th>Supplier Name</th>
30
+ <th>Supplier Code</th>
31
+ <th>Link Product</th>
32
+ <th>Ranking</th>
33
+ <th>Active</th>
34
+
35
+ </tr>
36
+ </thead>
37
+
38
+ <tbody>
39
+
40
+ <?php foreach($logArray as $valueArray){ ?>
41
+ <tr>
42
+ <?php unset($logArray['created']); ?>
43
+ <?php if(is_array($valueArray)){ ?>
44
+ <?php foreach($valueArray as $value){ ?>
45
+
46
+ <td class="a-right "><?php echo $value ?> </td>
47
+
48
+ <?php } ?>
49
+ <?php } ?>
50
+ </tr>
51
+ <?php } ?>
52
+ </tbody>
53
+ <?php } ?>
54
+ </table>
55
+ <script type="text/javascript">
56
+ var headingArr = [];
57
+ $$('.logheading').each(function(row){
58
+
59
+ headingArr.push($(row).innerHTML)
60
+ $(row).setStyle({display:'none'})
61
+ })
62
+
63
+ for(var i=0; i<= headingArr.length; i++ )
64
+ {
65
+ if( headingArr[i] !=undefined ){
66
+ try{
67
+ $$('.tablelogheading')[i].innerHTML = '<td colspan="5"><ul class="" style="border-bottom: 2.5px solid #000000;margin: 15px 0 5px 5px;">'+headingArr[i]+'</ul></td>';
68
+ }catch(err){
69
+ console.log(err.message);
70
+ }
71
+ }
72
+ }
73
+
74
+
75
+ </script>
76
+
77
+ <?php else: ?>
78
+ <h1>No Data Found</h1>
79
+ </div>
80
+ <?php endif; ?>
app/design/adminhtml/default/default/template/amosoft/sales/default.phtml ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $amosoftDetails = Mage::getBlockSingleton('dropship/adminhtml_sourcing'); ?>
29
+ <?php $this->setPriceDataObject($_item) ?>
30
+ <tr <?php if (!$this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>>
31
+ <td>
32
+ <?php if ($this->canDisplayContainer()): ?>
33
+ <div id="<?php echo $this->getHtmlId() ?>" class="item-container">
34
+ <?php endif; ?>
35
+ <div class="item-text">
36
+ <?php echo $this->getColumnHtml($_item, 'name') ?>
37
+ </div>
38
+ <?php if ($this->canDisplayContainer()): ?>
39
+ </div>
40
+ <?php endif ?>
41
+ </td>
42
+ <?php $amosoftItem = $amosoftDetails->getAmosoftOrderItemsDetails($_item); ?>
43
+ <?php
44
+ $amosoftItemStatus;
45
+ if($_item->getProductType() == 'configurable'){
46
+ $amosoftItemStatus = $amosoftItem->getAmosoftItemStatus();
47
+ }else{
48
+ $amosoftItemStatus = $_item->getAmosoftItemStatus();
49
+ }
50
+ ?>
51
+ <td class="a-center"><?php echo $_item->getStatus() ?></td>
52
+ <td class="a-center">
53
+ <span id="<?php echo $amosoftItem->getItemId() ?>"><?php echo $amosoftItemStatus; ?></span>
54
+ <?php if($amosoftItemStatus!="" && $amosoftItemStatus!="Completed"): ?>
55
+ <p><a id="edit" onclick="respondToClick(<?php echo $amosoftItem->getItemId() ?>)" style="cursor:pointer"><?php echo $this->__('Edit') ?></a></p>
56
+ <span id="change_status-<?php echo $amosoftItem->getItemId() ?>" style="display:none;">
57
+ <select name="status" id="status-<?php echo $amosoftItem->getItemId() ?>" onchange="respondToChange(this)">
58
+ <option value=""><?php echo $this->__('Please select') ?></option>
59
+ <?php foreach(Mage::helper('dropship')->getAmosoftOrderItemStatus() as $status):?>
60
+ <?php if($amosoftItemStatus!=$status): ?>
61
+ <?php if($amosoftItemStatus=="Sent to Vendor" && $status=="Sent to Supplier"):?>
62
+ <?php continue; ?>
63
+ <?php endif; ?>
64
+ <option value="<?php echo $status ?>"><?php echo $status ?></option>
65
+ <?php endif; ?>
66
+ <?php endforeach; ?>
67
+ </select>
68
+ </span>
69
+ <?php endif; ?>
70
+ </td>
71
+ <td class="a-center"><?php echo ($_item->getProductType() == 'configurable') ? $amosoftItem->getAmosoftVendorName() : $_item->getAmosoftVendorName() ?></td>
72
+ <td class="a-center"><?php echo ($_item->getProductType() == 'configurable') ? $amosoftItem->getAmosoftVendorSku() : $_item->getAmosoftVendorSku() ?></td>
73
+ <td class="a-right"><?php echo $this->displayPriceAttribute('original_price') ?></td>
74
+ <td class="a-right">
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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', $_item->getStoreId())): ?>
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
+
170
+ </td>
171
+ <td><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
172
+
173
+ <td class="a-right">
174
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
175
+ <span class="price-excl-tax">
176
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
177
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
178
+ <?php endif; ?>
179
+
180
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
181
+ <?php
182
+ echo $this->displayPrices(
183
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
184
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
185
+ );
186
+ ?>
187
+ <?php else: ?>
188
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
189
+ <?php endif; ?>
190
+
191
+
192
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
193
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
194
+ <small>
195
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
196
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
197
+ <?php endforeach; ?>
198
+ </small>
199
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
200
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
201
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
202
+ <?php endforeach; ?>
203
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
204
+ <small>
205
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
206
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
207
+ <?php endforeach; ?>
208
+ </small>
209
+ <?php endif; ?>
210
+
211
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
212
+ <br />
213
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
214
+ <?php
215
+ echo $this->displayPrices(
216
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
217
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
218
+ );
219
+ ?>
220
+ </span>
221
+ <?php endif; ?>
222
+ <?php endif; ?>
223
+ </span>
224
+ <br />
225
+ <?php endif; ?>
226
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
227
+ <span class="price-incl-tax">
228
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
229
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
230
+ <?php endif; ?>
231
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
232
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
233
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
234
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
235
+ <?php else: ?>
236
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
237
+ <?php endif; ?>
238
+
239
+
240
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
241
+
242
+ <br />
243
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
244
+ <small>
245
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
246
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
247
+ <?php endforeach; ?>
248
+ </small>
249
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
250
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
251
+ <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>
252
+ <?php endforeach; ?>
253
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
254
+ <small>
255
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
256
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
257
+ <?php endforeach; ?>
258
+ </small>
259
+ <?php endif; ?>
260
+
261
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
262
+ <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>
263
+ <?php endif; ?>
264
+ <?php endif; ?>
265
+ </span>
266
+ <?php endif; ?>
267
+ </td>
268
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
269
+ <td class="a-right"><?php echo $this->displayTaxPercent($_item) ?></td>
270
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
271
+ <td class="a-right last">
272
+ <?php echo $this->displayPrices(
273
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount() - $_item->getBaseDiscountAmount(),
274
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount() - $_item->getDiscountAmount()
275
+ ); ?>
276
+ </td>
277
+ </tr>
278
+
279
+ <script type="text/javascript">
280
+
281
+ function respondToClick(id) {
282
+ $('change_status-'+id).show();
283
+ }
284
+
285
+ function respondToChange(obj) {
286
+ if(obj.value){
287
+ var itemId = obj.id.split('-');
288
+ new Ajax.Request('<?php echo $this->getUrl('amosoft/adminhtml_amosoft/changeStatusAjax') ?>', {
289
+ parameters: {
290
+ 'amosoft_item_id': itemId[1],
291
+ 'amosoft_item_status': obj.value,
292
+ 'order_id': '<?php echo $this->getRequest()->getParam('order_id'); ?>'
293
+ },
294
+ method: 'post',
295
+ onSuccess: success,
296
+ onFailure: fail
297
+ });
298
+ }
299
+ }
300
+
301
+ function success(response){
302
+ var data = response.responseText.evalJSON();
303
+ var id = data.amosoft_item_id;
304
+ $(id).innerHTML = data.amosoft_item_status;
305
+ $('change_status-'+id).hide();
306
+ window.location.reload(true);
307
+ }
308
+
309
+ function fail(response){
310
+ alert("Request cannot be completed");
311
+ }
312
+ </script>
app/design/adminhtml/default/default/template/amosoft/sales/items.phtml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder() ?>
28
+ <div class="grid np">
29
+ <div class="hor-scroll">
30
+ <table cellspacing="0" class="data order-tables">
31
+ <col />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <col width="1" />
35
+ <col width="1" />
36
+ <col width="1" />
37
+ <col width="1" />
38
+ <col width="1" />
39
+ <col width="1" />
40
+ <col width="1" />
41
+ <thead>
42
+ <tr class="headings">
43
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
44
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Item Status') ?></span></th>
45
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Drop Ship Status') ?></span></th>
46
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Drop Ship Supplier') ?></span></th>
47
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Supplier Sku') ?></span></th>
48
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Original Price') ?></span></th>
49
+ <th><?php echo $this->helper('sales')->__('Price') ?></th>
50
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
51
+ <th><?php echo $this->helper('sales')->__('Subtotal') ?></th>
52
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Amount') ?></span></th>
53
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Tax Percent') ?></span></th>
54
+ <th><span class="nobr"><?php echo $this->helper('sales')->__('Discount Amount') ?></span></th>
55
+ <th class="last"><span class="nobr"><?php echo $this->helper('sales')->__('Row Total') ?></span></th>
56
+ </tr>
57
+ </thead>
58
+ <?php $_items = $this->getItemsCollection() ?>
59
+ <?php $i=0;foreach ($_items as $_item):?>
60
+ <?php if ($_item->getParentItem()) continue; else $i++;?>
61
+ <tbody class="<?php echo $i%2?'even':'odd' ?>">
62
+ <?php echo $this->getItemHtml($_item) ?>
63
+ <?php echo $this->getItemExtraInfoHtml($_item) ?>
64
+ </tbody>
65
+ <?php endforeach; ?>
66
+ </table>
67
+ </div>
68
+ </div>
69
+ <br />
app/design/adminhtml/default/default/template/amosoft/system/config/fieldset/hint.phtml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <?php
10
+ /**
11
+ *
12
+ * @see Mage_Paypal_Block_System_Config_Fieldset_Hint
13
+ */
14
+ ?>
15
+ <script type="text/javascript">
16
+ //<![CDATA[
17
+ if($$('.form-buttons a#page-help-link').length <= 0 ){
18
+ if($$('.form-buttons button').length > 0){
19
+ $$('.form-buttons button')[0].insert({
20
+ before: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from amosoft?</a>"
21
+ });
22
+ }else
23
+ {
24
+ $$('.form-buttons')[0].insert({
25
+ top: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from amosoft?</a>"
26
+ });
27
+ }
28
+ }
29
+ //]]>
30
+ </script>
31
+
32
+ <div class="dropship">
33
+ <div class="amosoft-notice"></div>
34
+ <div style="clear: right; padding-top: 10px;">
35
+ <h3>Your Store Information </h3>
36
+ </div>
37
+ <div style="border-bottom: 1px double #000000;padding-bottom: 20px;">
38
+ <div style="padding-bottom: 20px;padding-top: 15px;">
39
+ <div style="width:120px;float:left"><label style= "display: block;width: 185px;padding-right: 15px;padding-top: 1px;">
40
+ Base Magento URL</label>
41
+ </div>
42
+ <div style="width: 300px; padding-right: 5px;float:left">
43
+ <input id="amosoft_integration_integration_magento_base_url" value="<?php echo Mage::getBaseUrl( Mage_Core_Model_Store::URL_TYPE_WEB, true ); ?>" style="width: 300px;padding: 2px;" type="text" readonly="readonly">
44
+ </div>
45
+ </div>
46
+ <div class="clear"></div>
47
+ <div style="width:500px;padding-bottom:29px;">
48
+ <div style="width:120px;float:left"><label style= "display: block;width: 185px;padding-right: 15px;padding-top: 1px;">
49
+ Magento Version</label>
50
+ </div>
51
+ <div style="width: 300px; padding-right: 5px;float:left">
52
+ <input id="amosoft_integration_integration_magento_base_url" value="<?php echo Mage::getVersion() ?>" style="width:300px;padding: 2px;" type="text" readonly="readonly">
53
+ </div>
54
+ </div>
55
+ <div class="clear"></div>
56
+ <div style="float:left;">
57
+ <div style="width:120px;float:left"><label style= "display: block;width: 185px;padding-right: 15px;padding-top: 1px;">
58
+ Magento Store IDs</label>
59
+ </div>
60
+ </div>
61
+ <div style="width: 314px; float:left;border:2px #000 solid;overflow: hidden;">
62
+ <div style="background:grey;color:#fff;font-weight:bold;text-align: center;">
63
+ <div style="float:left; width:50px;margin: 0 15px 0 0;background:grey;">ID</div>
64
+ <div style="float:left; width:177px">Store Name</div>
65
+ <div style="clear:both;"></div>
66
+ </div>
67
+ <div>
68
+ <ul>
69
+ <?php foreach($this->getStoreList() as $storeDetail): ?>
70
+ <li>
71
+ <div style="float:left; width:50px;margin: 0 15px 0 0;"><input id="amosoft_integration_integration_store_list_val" value="<?php echo $storeDetail['value'] ?>" style="width:50px;padding: 2px;margin: 0 0 0 5px;" type="text" readonly="readonly"></div>
72
+ <div style="float:left; width:177px"><input id="amosoft_integration_integration_store_list_label" value="<?php echo $storeDetail['label'] ?>" style="padding: 2px;" type="text" readonly="readonly"></div>
73
+ <div style="clear:both;"></div>
74
+ </li>
75
+ <?php endforeach; ?>
76
+ </ul>
77
+ </div>
78
+
79
+ </div>
80
+ <div class="clear"></div>
81
+ </div>
82
+
83
+ <div style="padding-top: 20px;">
84
+ <div style="clear: right">
85
+ <b><span>Step 1:</span>&nbsp; Create a amosoft account </b>
86
+ </div>
87
+ <div style="border-bottom: 1px double #000000; padding-bottom: 20px">
88
+ <span><a target="_blank" href="http://netdropship.amosoft.com/">Click Here to Sign up</a></span>&nbsp; Or if you
89
+ have an existing account <span><a target="_blank" href="http://netdropship.amosoft.com/"> Sign in Here</a></span>
90
+ </div>
91
+ </div>
92
+ <div style="border-bottom: 1px double #000000;padding-bottom: 20px;padding-top: 50px;">
93
+ <div style="clear: right">
94
+ <b><span>Step 2:</span>&nbsp; Connect amosoft to your Magento Admin Panel </b>
95
+ </div>
96
+
97
+ <p><span>Create your amosoft SOAP API User > <a href="<?php echo $this->getUrl('amosoft/adminhtml_amosoft/getapidetails') ?>">Click Here to
98
+ update your amosoft API key</a></span>&nbsp;(this is like your
99
+ password)</p>
100
+ <p> <span>Login to <a target="_blank" href="http://netdropship.amosoft.com/">Amosoft NET Dropship</a> and navigate to <b>Settings > Setup Connection</b> > See screenshot below for fields to fill
101
+ </span></p>
102
+ <p>
103
+ <img border="2" width="950px" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>amosoft/setup_connection.png"/>
104
+ <!-- <img border="2" width="950px" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>amosoft/setup_connection2.png"/> -->
105
+ </p>
106
+ <p></p>
107
+
108
+
109
+ </div>
110
+ <div class="clear"></div>
111
+ <div style="padding-top: 50px;">
112
+ <p >
113
+ <b><span>Step 3:</span>&nbsp; Add to Supplier/Vendors </b>
114
+ </p>
115
+ <p>
116
+ <span>Login to <a href="http://netdropship.amosoft.com/" target="_blank">Amosoft NET Dropship</a> and navigate to <b>Supplier Management > Click Add New Supplier </b>
117
+ </span>
118
+ </p>
119
+ <p >
120
+ <span>The MagVendID Supplier Code must match to the Vendor ID assigned to your supplier set up in the amosoft Portal. </span> See the below screenshot
121
+ </p>
122
+ <p>
123
+ <img border="2" width="950px" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>amosoft/suppliers.png"/>
124
+ </p>
125
+ <div style="clear:right;padding-bottom:50px"></div>
126
+ <p>
127
+ <p>Congratulations, you are now connected to amosoft. You can now set up your Sourcing Logic rules</p>
128
+ <p>For support and help on setting these up please go to <a target="_blank" href="http://help.netdropship.amosoft.com/">http://help.netdropship.amosoft.com/</a></p>
129
+ <p>If you have any questions or encounter any issues setting this up please contact <a href="mailto:support@amosoft.com">support@amosoft.com</a></p>
130
+ </p>
131
+ </div>
132
+ </div>
app/design/adminhtml/default/default/template/amosoft/system/config/submitbutton.phtml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+
10
+ <?php /* var $this Mage_Adminhtml_Block_System_Config_System_Storage_Media_Synchronize */ ?>
11
+ <div style="float:left"><?php echo $this->getSubmitButtonHtml() ?></div>
12
+ <script type="text/javascript">
13
+ //<![CDATA[
14
+ Validation.addAllThese([
15
+ ['validate-url-amosoft', 'Please enter a valid URL. Protocol is required (http://, https:// )', function (v) {
16
+ v = (v || '').replace(/^\s+/, '').replace(/\s+$/, '');
17
+ return Validation.get('IsEmpty').test(v) || /^(http|https):\/\/(([A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))(\.[A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))*)(:(\d+))?(\/[A-Z0-9~](([A-Z0-9_~-]|\.)*[A-Z0-9~]|))*\/?(.*)?$/i.test(v)
18
+ }],
19
+ ['validate-ftp-url-amosoft', 'Please enter a valid URL. Protocol is required (ftp://, ftps:// )', function (v) {
20
+ return Validation.get('IsEmpty').test(v) || /^(ftps|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(v) || /^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(v)
21
+ }]
22
+ ]);
23
+
24
+ var enableId = 'amosoft_sourcing_cron_settings_upload_enabled';
25
+ var buttonId = 'amosoft_sourcing_cron_settings_upload_ftp_testconnection';
26
+ var buttonObj = $('amosoft_sourcing_cron_settings_upload_ftp_testconnection');
27
+ function checkButtonState(event) {
28
+ var element = Event.element(event);
29
+
30
+ if(element.value == '1'){
31
+ enableSyncButton();
32
+ }else
33
+ {
34
+ disableSyncButton();
35
+ }
36
+
37
+
38
+ }
39
+
40
+ function enableSyncButton() {
41
+ Form.Element.enable(buttonId);
42
+ buttonObj.removeClassName('disabled');
43
+ }
44
+
45
+ function disableSyncButton() {
46
+ Form.Element.disable(buttonId);
47
+ buttonObj.addClassName('disabled');
48
+ }
49
+
50
+ Event.observe(window, 'load', function(){
51
+
52
+ if($(enableId).value != '1'){
53
+ disableSyncButton();
54
+ }
55
+
56
+ });
57
+ $(enableId).observe('change', checkButtonState);
58
+ function synchronize(id) {
59
+
60
+ if(!configForm.validate())
61
+ {
62
+ return ;
63
+ }
64
+
65
+ new Ajax.Request('<?php echo $this->getAjaxSyncUrl() ?>', {
66
+ parameters: $('config_edit_form').serialize(),
67
+ method: 'post',
68
+ onSuccess: successFunc,
69
+ onFailure: failFunc
70
+ });
71
+
72
+ }
73
+
74
+ function successFunc(response){
75
+ var container = $('messages');
76
+ var content = response.responseText.evalJSON();
77
+ if(content.error)
78
+ {
79
+ $('messages').show();
80
+ container.update('<ul class="messages"><li class="error-msg"><ul><li><span>'+content.message+'</span></li></ul></li></ul>')
81
+ container.scrollTo();
82
+ buttonObj.innerHTML = '<span><spn>Unsuccessful Tested</span></span>'
83
+ return;
84
+ }else
85
+ {
86
+ buttonObj.innerHTML = '<span><spn>Successfully Tested</span></span>'
87
+ $('messages').hide();
88
+ }
89
+
90
+ }
91
+
92
+ function failFunc(){
93
+ alert('Not able to connect to server please try again later');
94
+ }
95
+ //]]>
96
+ </script>
97
+
98
+
99
+
app/design/adminhtml/default/default/template/amosoft/upload_vendor_product.phtml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <div class="custom-msg" id="messages"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
10
+ <div class="content-header">
11
+ <table cellspacing="0">
12
+ <tr>
13
+ <td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml() ?></td>
14
+ <td class="form-buttons"><?php echo $this->getButtonsHtml() ?></td>
15
+ </tr>
16
+ </table>
17
+ </div>
18
+
19
+ <?php echo $this->getFormHtml() ?>
20
+ <div>
21
+ <?php echo $this->getChildHtml('inventory') ?>
22
+ </div>
23
+ <script type="text/javascript">
24
+ editForm = new varienForm('edit_form', '<?php echo $this->getValidationUrl() ?>');
25
+ </script>
26
+ <?php if($this->getProductSetupMode()): ?>
27
+ <?php echo $this->getFormScripts() ?>
28
+ <?php endif; ?>
29
+
30
+ <script type="text/javascript">
31
+ //<![CDATA[
32
+ var isProductModeSteup = '<?php echo $this->getProductSetupMode() ?>';
33
+ var formSubmit = false;
34
+ function downloadSampleCsv()
35
+ {
36
+ if(isProductModeSteup)
37
+ setLocation("<?php echo $this->getUrl('amosoft/adminhtml_upload/download',array('_query'=>array('isproductsetupmode' => true))) ?>");
38
+ else
39
+ setLocation("<?php echo $this->getUrl('amosoft/adminhtml_upload/download') ?>");
40
+ }
41
+ document.observe("dom:loaded", function(){
42
+ if($('uploadStarted'))
43
+ $('uploadStarted').value = 0;
44
+ });
45
+
46
+
47
+ $('upload_button').observe('click', function() { if(editForm.validate()){formSubmit = true;} });
48
+ //window.onbeforeunload = confirmExit;
49
+ function confirmExit(evt) {
50
+
51
+ if(formSubmit){
52
+ new Ajax.Request("<?php echo $this->getUrl('*/*/terminate'); ?>", {
53
+ method: "post",
54
+ parameters: {form_key: '<?php echo $this->getFormKey();?>'},
55
+ asynchronous : true,
56
+ });
57
+
58
+ return;
59
+ }else
60
+ {
61
+ return null;
62
+ }
63
+ }
64
+
65
+ //]]>
66
+ </script>
app/design/adminhtml/default/default/template/amosoft/vendor_ranking.phtml ADDED
@@ -0,0 +1,455 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <?php $helper = Mage::helper('dropship')?>
10
+ <?php $dropshipVendorCollection = $this->getVendorCollection('yes'); ?>
11
+ <?php $nonDropshipVendorCollection = $this->getVendorCollection('no'); ?>
12
+ <style type="text/css">
13
+
14
+
15
+ </style>
16
+ <div class="content-header">
17
+ <table cellspacing="0">
18
+ <tr>
19
+ <td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml() ?></td>
20
+ <td class="form-buttons"><?php echo $this->getButtonsHtml() ?></td>
21
+ </tr>
22
+ </table>
23
+ </div>
24
+ <?php if(Mage::getStoreConfig('amosoft_sourcing/rank/ranktype') == 'cost'): ?>
25
+ <div id="warning-message"><ul class="messages"><li class="warning-msg"><ul><li><span>Cost Based sourcing rule is currently selected. Vendor ranking will only take effect when Rank Based sourcing rule is selected in the Sourcing Configuration page.</span></li></ul></li></ul></div>
26
+ <?php endif; ?>
27
+ <div id="notice-message"><ul class="messages"><li class="notice-msg"><ul><li><span>To remove an Active Vendor from dropship Sourcing Rule, drag it to the Non Active Vendors section on the right. To activate that Vendor again, simply drag it back to the Active Vendors section.</span></li></ul></li></ul></div>
28
+
29
+ <div id="message"><ul class="messages"><li class="error-msg"><ul><li><span>You Have Unsubmitted Changes.</span></li></ul></li></ul></div>
30
+ <div id="panel"></div>
31
+ <div class="clear"></div>
32
+ <div>
33
+ <?php echo $this->getChildHtml('supplier.upload') ?>
34
+ </div>
35
+ <script type="text/javascript">
36
+ var arrVendorName = [];
37
+ var arrVendorProductLink = [];
38
+ var arrDropship = <?php echo $dropshipVendorCollection['arrayData'] ?>;
39
+ var arrNonDropship = <?php echo $nonDropshipVendorCollection['arrayData'] ?>;
40
+ var addNew = 1;
41
+ $('message').hide();
42
+
43
+ Ext.require([
44
+ 'Ext.grid.*',
45
+ 'Ext.data.*',
46
+ 'Ext.dd.*'
47
+ ]);
48
+
49
+ Ext.define('DataObject', {
50
+ extend: 'Ext.data.Model',
51
+ fields: ['name', 'code','link']
52
+ });
53
+
54
+ Ext.onReady(function(){
55
+ var dropShipData = <?php echo $dropshipVendorCollection['gridData'] ?>
56
+ // create the data store
57
+ var firstGridStore = Ext.create('Ext.data.Store', {
58
+ model: 'DataObject',
59
+ data: dropShipData,
60
+ });
61
+ var pTypes = Ext.create('Ext.data.Store', {
62
+ fields : ['link', 'name'],
63
+ data : <?php echo $this->getAttributeCode(); ?>
64
+ });
65
+
66
+ // Column Model shortcut array
67
+ var columns1 = [
68
+ Ext.create('Ext.grid.RowNumberer',{dataIndex:'id',xtype: 'rownumberer',text:'Ranking',align: 'right',width:50}),
69
+ {text: "Vendor Name", flex: 1,hideable:false, sortable: false, dataIndex: 'name',editor : {
70
+ xtype: 'textfield',
71
+ allowBlank:false
72
+ }},
73
+ {text: "Vendor Code", flex: 1,hidden:false,hideable:false,sortable: false, dataIndex: 'code'},
74
+ {text: 'Link Product',dataIndex: 'link',width: 130,
75
+ renderer : function (value) {
76
+ switch (value) {
77
+ case '<?php echo $helper::AMOSOFT_PRODUCT_LINK_CODE_UPC ?>':
78
+ return '<?php echo $helper::AMOSOFT_PRODUCT_LINK_UPC ?>';
79
+ break;
80
+ case '<?php echo $helper::AMOSOFT_PRODUCT_LINK_CODE_MNP ?>':
81
+ return '<?php echo $helper::AMOSOFT_PRODUCT_LINK_MNP ?>';
82
+ break;
83
+ case '<?php echo $helper::AMOSOFT_PRODUCT_LINK_CODE_SKU ?>':
84
+ return '<?php echo $helper::AMOSOFT_PRODUCT_LINK_SKU ?>';
85
+ break;
86
+ default:
87
+ return '<?php echo $helper::AMOSOFT_PRODUCT_LINK_NONE ?>';
88
+ }
89
+ },
90
+ editor: new Ext.form.field.ComboBox({
91
+ store : pTypes,
92
+ displayField : 'name',
93
+ valueField : 'link',
94
+ queryMode : 'local',
95
+ editable: false,
96
+ listeners: {
97
+ select: function(combo, records) {
98
+ var vendCode = combo.up('grid').editingPlugin.activeRecord.data.code;
99
+ var proLink = records[0].data.link;
100
+ updateProductLink(vendCode, proLink,arrVendorProductLink)
101
+ }
102
+ }
103
+ })
104
+ }
105
+ ];
106
+
107
+ var columns2 = [
108
+ {text: "Vendor Name", flex: 1,sortable: false,hideable:false, dataIndex: 'name',editor : {
109
+ xtype: 'textfield',
110
+ allowBlank:false
111
+ }},
112
+ {text: "Vendor Code", flex: 1,hidden:false,hideable:false,dataIndex: 'code',sortable: false}
113
+ ];
114
+
115
+ // create the destination Grid
116
+ var rowEditing = Ext.create('Ext.grid.plugin.CellEditing', {
117
+ clicksToMoveEditor: 2,
118
+ autoCancel: false
119
+ });
120
+ // declare the source Grid
121
+ var firstGrid = Ext.create('Ext.grid.Panel', {
122
+ viewConfig: {
123
+ plugins: {
124
+ ptype: 'gridviewdragdrop',
125
+ },
126
+ listeners: {
127
+ drop: function(node, data, dropRec, dropPosition) {
128
+ var dropName = dropRec ? dropRec.get('code') : '';
129
+ var id = 1;
130
+
131
+ $$('.x-grid-cell-row-numberer .x-grid-cell-inner ').each(function(item){
132
+ item.innerHTML = id++;
133
+ })
134
+ arrDropship.each(function(item,index){
135
+
136
+ if(item.code == data.records[0].get('code')){
137
+ arrDropship.splice(index,1);
138
+ }
139
+ })
140
+ if(dropPosition === 'undefined' || dropName == '')
141
+ {
142
+
143
+ arrDropship.push({name:data.records[0].get('name'),code:data.records[0].get('code')});
144
+
145
+ }else
146
+ {
147
+ var firstindexLoc;
148
+ arrDropship.each(function(item,index){
149
+
150
+ if(item.code == dropName){
151
+ firstindexLoc = index
152
+ }
153
+ })
154
+ if(dropPosition == 'after')
155
+ {
156
+
157
+ firstindexLoc = firstindexLoc+1;
158
+ arrDropship.splice(firstindexLoc, 0, {name:data.records[0].get('name'),code:data.records[0].get('code')});
159
+ indexLoc = 0;
160
+ }else
161
+ {
162
+
163
+ arrDropship.splice(firstindexLoc, 0, {name:data.records[0].get('name'),code:data.records[0].get('code')});
164
+ indexLoc = 0;
165
+
166
+ }
167
+ }
168
+
169
+ var fristIndextemp;
170
+ arrNonDropship.each(function(item,index){
171
+
172
+ if(item.code == data.records[0].get('code')){
173
+ fristIndextemp = index
174
+ }
175
+ })
176
+ if (arrNonDropship.length > 0 && fristIndextemp > -1) {
177
+ arrNonDropship.splice(fristIndextemp, 1);
178
+ }
179
+ $('message').show();
180
+ },
181
+ beforedrop: function(node, data, dropRec, dropPosition,dropHandlers){
182
+ (data.records[0].data.link) ? updateProductLink(data.records[0].data.code, data.records[0].data.link,arrVendorProductLink) : data.records[0].data.link = ''
183
+ }
184
+ }
185
+ },
186
+ store : firstGridStore,
187
+ columns : columns1,
188
+ stripeRows : true,
189
+ title : 'Active Vendors',
190
+ margins : '0 2 0 0',
191
+ tbar: [{
192
+ text: 'Add Active Vendors',
193
+ xtype: 'button',
194
+ iconCls: 'vendor-add',
195
+ handler : function() {
196
+ rowEditing.cancelEdit();
197
+
198
+ // Create a model instance
199
+ var r = Ext.create('DataObject', {
200
+ name: 'New Vendor',
201
+ code: 'temp_amosoft_vendor_code',
202
+ });
203
+ var rowNumber = ($$('.x-grid-cell-row-numberer .x-grid-cell-inner ').length);
204
+ firstGridStore.insert(rowNumber, r);
205
+ rowEditing.startEditByPosition({row: rowNumber, column: 1});
206
+ }
207
+ }],
208
+ plugins: [rowEditing],
209
+ listeners: {
210
+ edit: function(e, editor) {
211
+ var isAvailable;
212
+ var isNew = false;
213
+ var rowObject = editor.row.getElementsByClassName('x-grid-cell-inner');
214
+ if(rowObject[2].innerHTML.match(/temp_amosoft_vendor_code/g)){
215
+ var tempClass = editor.row.getElementsByClassName('x-grid-cell')[0].className
216
+ editor.row.getElementsByClassName('x-grid-cell')[0].className = tempClass+' x-grid-dirty-cell';
217
+ firstGrid.setLoading();
218
+ Ext.Ajax.request({
219
+ url: '<?php echo Mage::getSingleton('adminhtml/url')->getUrl('*/*/addNewVendor') ?>',
220
+ params:{name:editor.record.data['name'],code:rowObject[2].innerHTML,form_key:'<?php echo Mage::getSingleton('core/session')->getFormKey() ?>',rank:$$('.x-grid-cell-row-numberer .x-grid-cell-inner ').length},
221
+ method : 'POST',
222
+ success: function(action){
223
+ var msg_server = Ext.decode(action.responseText);
224
+ if (msg_server.success == true){
225
+ // Great, commit the record to hide the red changed flags
226
+ editor.record.set('code',msg_server.message);
227
+ editor.record.commit();
228
+ firstGrid.getSelectionModel().selection = null
229
+ firstGrid.getView().refresh();
230
+ firstGrid.setLoading(false);
231
+ arrDropship.push({name:editor.record.data['name'],code:msg_server.message});
232
+ isNew = true;
233
+ Ext.Msg.alert('Vendor '+editor.record.data['name']+' Add Successfuly');
234
+ $('message').hide();
235
+ }
236
+ },
237
+ failure: function(action){
238
+ isNew = true;
239
+ Ext.Msg.alert('Please Try Again Later');
240
+ firstGrid.setLoading(false);
241
+ }
242
+ });
243
+ }
244
+ if(editor.record.dirty && !isNew && editor.colIdx == 1){
245
+ if(arrVendorName.length > 0){
246
+ var removeIndex
247
+ arrVendorName.each(function(item,index){
248
+
249
+ if(item.code == rowObject[2].innerHTML){
250
+ isAvailable = true
251
+ removeIndex = index
252
+ }
253
+ })
254
+ }
255
+ if(isAvailable){
256
+ arrVendorName.splice(removeIndex, 1);
257
+ arrVendorName.push({name:editor.record.data['name'],code:rowObject[2].innerHTML})
258
+ }else
259
+ {
260
+ arrVendorName.push({name:editor.record.data['name'],code:rowObject[2].innerHTML})
261
+ }
262
+ $('message').show();}
263
+
264
+ return;
265
+
266
+ },
267
+
268
+ canceledit : function (e, editor){
269
+ var rowObject = editor.row.getElementsByClassName('x-grid-cell-inner');
270
+ if(rowObject[2].innerHTML.match(/temp_amosoft_vendor_code/g)){
271
+ var sm = firstGrid.getSelectionModel();
272
+ rowEditing.cancelEdit();
273
+ firstGridStore.remove(sm.getSelection());
274
+ if (secondGridStore.getCount() > 0) {
275
+ sm.select(0);
276
+ }
277
+ }
278
+ }
279
+ },
280
+
281
+ selType: 'cellmodel'
282
+
283
+ });
284
+
285
+ var nonDropShipData = <?php echo $nonDropshipVendorCollection['gridData'] ?>
286
+ // create the data store
287
+ var secondGridStore = Ext.create('Ext.data.Store', {
288
+ model: 'DataObject',
289
+ data: nonDropShipData,
290
+ });
291
+
292
+
293
+
294
+
295
+ var secondGrid = Ext.create('Ext.grid.Panel', {
296
+ viewConfig: {
297
+ plugins: {
298
+ ptype: 'gridviewdragdrop',
299
+ //dragGroup: 'secondGridDDGroup',
300
+ //dropGroup: 'firstGridDDGroup'
301
+ },
302
+ listeners: {
303
+ drop: function(node, data, dropRec, dropPosition) {
304
+ //var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
305
+ var dropName = dropRec ? dropRec.get('code') : '';
306
+ var code = data.records[0].get('code');
307
+ var id = 1;
308
+
309
+ $$('.x-grid-cell-row-numberer .x-grid-cell-inner ').each(function(item){
310
+ item.innerHTML = id++;
311
+ })
312
+ if(dropPosition === 'undefined' || dropName == '')
313
+ {
314
+
315
+ arrNonDropship.push({name:data.records[0].get('name'),code:data.records[0].get('code')});
316
+
317
+ }else
318
+ {
319
+
320
+ var indexLoc;
321
+ arrDropship.each(function(item,index){
322
+
323
+ if(item.code == dropName){
324
+ indexLoc = index
325
+ }
326
+ })
327
+ arrNonDropship.each(function(item,index){
328
+
329
+ if(item.code == data.records[0].get('code')){
330
+ arrNonDropship.splice(index,1);
331
+ }
332
+ })
333
+ if(dropPosition == 'after')
334
+ {
335
+ indexLoc = indexLoc+1;
336
+ arrNonDropship.splice(indexLoc, 0, {name:data.records[0].get('name'),code:data.records[0].get('code')});
337
+ indexLoc = 0;
338
+ }else
339
+ {
340
+ arrNonDropship.splice(indexLoc, 0, {name:data.records[0].get('name'),code:data.records[0].get('code')});
341
+ indexLoc = 0;
342
+
343
+ }
344
+ }
345
+ updateGridData(data,arrDropship,false);
346
+ updateGridData(data,arrVendorProductLink,true);
347
+
348
+ }
349
+ }
350
+ },
351
+ store : secondGridStore,
352
+ columns : columns2,
353
+ stripeRows : true,
354
+ title : 'Non Active Vendors',
355
+ margins : '0 0 0 3',
356
+ plugins: [
357
+ Ext.create('Ext.grid.plugin.CellEditing', {
358
+ clicksToEdit : 2,
359
+ listeners: {
360
+ edit: function(editor, e, eOpts) {
361
+ var isAvailable;
362
+ var rowObject = e.row.getElementsByClassName('x-grid-cell-inner');
363
+
364
+ if(e.record.dirty){
365
+ if(arrVendorName.length > 0){
366
+
367
+
368
+ var removeIndex
369
+ arrVendorName.each(function(item,index){
370
+
371
+ if(item.code == rowObject[1].innerHTML){
372
+ isAvailable = true
373
+ removeIndex = index
374
+ }
375
+ })
376
+ }
377
+ if(isAvailable){
378
+ arrVendorName.splice(removeIndex, 1);
379
+ arrVendorName.push({name:e.record.data['name'],code:rowObject[1].innerHTML})
380
+ }else
381
+ {
382
+ arrVendorName.push({name:e.record.data['name'],code:rowObject[1].innerHTML})
383
+ }
384
+ $('message').show();}
385
+ return;
386
+
387
+ }
388
+ }
389
+ })
390
+ ],
391
+ selType: 'cellmodel'
392
+ });
393
+
394
+ //Simple 'border layout' panel to house both grids
395
+ var displayPanel = Ext.create('Ext.Panel', {
396
+ width : 1205,
397
+ height : 500,
398
+ layout : {
399
+ type: 'hbox',
400
+ align: 'stretch',
401
+ padding: 5
402
+ },
403
+ renderTo : 'panel',
404
+ defaults : { flex : 1 }, //auto stretch
405
+ items : [
406
+ firstGrid,
407
+ secondGrid
408
+ ]
409
+ });
410
+
411
+
412
+ });
413
+
414
+ function updateGridData(data,tmpArray,isLink)
415
+ {
416
+ var indextemp;
417
+ tmpArray.each(function(item,index){
418
+
419
+ if(item.code == data.records[0].get('code')){
420
+ indextemp = index
421
+ }
422
+ })
423
+ if (tmpArray.length > 0 && indextemp > -1) {
424
+ (!isLink) ? tmpArray.splice(indextemp, 1) : tmpArray[indextemp].attr = ""
425
+ $('message').show();
426
+ }else
427
+ {
428
+ (isLink) ? tmpArray.push({code:data.records[0].get('code'),attr:""}) : ''
429
+ $('message').hide();
430
+ }
431
+ }
432
+
433
+ function updateProductLink(vendCode, proLink,prolinkArray) {
434
+ var isAvailable = false;
435
+ var removeIndex
436
+ //var vendCode = combo.up('grid').editingPlugin.activeRecord.data.code;
437
+ //var proLink = records[0].data.link;
438
+ if(prolinkArray.length > 0){
439
+ prolinkArray.each(function(item,index){
440
+ if(item.code == vendCode){
441
+ isAvailable = true
442
+ removeIndex = index
443
+ }
444
+ })
445
+ }
446
+ if(isAvailable){
447
+ prolinkArray.splice(removeIndex, 1);
448
+ prolinkArray.push({code:vendCode,attr:proLink})
449
+ }else
450
+ {
451
+ prolinkArray.push({code:vendCode,attr:proLink})
452
+ }
453
+ }
454
+ </script>
455
+
app/design/adminhtml/default/default/template/amosoft/vendor_upload_product_history.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <div class="content-header">
10
+ <table cellspacing="0">
11
+ <tr>
12
+ <td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml() ?></td>
13
+ <td class="form-buttons"><?php echo $this->getButtonsHtml() ?></td>
14
+ </tr>
15
+ </table>
16
+ </div>
17
+ <div class="grid">
18
+
19
+ <div class="entry-edit">
20
+ <?php if(count($this->getLogCollection()) > 0 ): ?>
21
+ <fieldset>
22
+ <ul class="note-list">
23
+ <?php $i = 0 ?>
24
+ <?php foreach ($this->getLogCollection() as $_item): ?>
25
+
26
+ <li>
27
+ <strong><?php echo $_item['amosoft_vendor_code'] ?></strong>
28
+ <span class="separator">|</span>
29
+ <strong><?php echo $_item['updated_by'] ?></strong>
30
+ <span class="separator">|</span>
31
+
32
+ <strong><?php echo $_item['success'] ?> successfully updates</strong>
33
+ <span class="separator">|</span>
34
+ <strong><?php echo $_item['failure'] ?> failed updates</strong>
35
+ <?php if(!empty($_item['ftp_error'])): ?>
36
+ <a href="<?php echo $this->getUrl('*/*/exportErrorCsv',array('vcode'=>$_item['amosoft_vendor_code'], 'vdate'=>$_item['created_at']))?>" onmouseout = " setTimeout(function(){$('simplediv<?php echo $i ?>').hide();return false;},200); " onmouseover="$('simplediv<?php echo $i ?>').show();return false;"><strong><?php echo $_item['ftp_error'] ?> </strong></a>
37
+ <div id="simplediv<?php echo $i ?>" style="background-color:none;border:1px solid black;display:none;width:500px;height:auto;word-wrap: break-word;padding:3px"><?php
38
+ $rowData = (!is_null($_item['ftp_error_desc'])) ? $_item['ftp_error_desc'] : $_item['error_id'];
39
+ echo $this->parseDescription($rowData,$_item['amosoft_vendor_code']); ?></div>
40
+ <?php endif; ?>
41
+ <span class="separator">|</span>
42
+ <strong> <?php echo $this->formatDate($_item['created_at'], 'medium', true); ?></strong>
43
+ </li>
44
+ <?php $i++ ?>
45
+ <?php endforeach; ?>
46
+ </ul>
47
+ </fieldset>
48
+ <?php else :?>
49
+ <h2>No Data Found</h2>
50
+ <?php endif; ?>
51
+ </div>
52
+
53
+
54
+ </div>
55
+
56
+ <script type="text/javascript">
57
+ function popup()
58
+ {
59
+
60
+ }
61
+ </script>
62
+
63
+
app/design/adminhtml/default/default/template/amosoft/vendorproducttab.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <div class="entry-edit custom-options product-custom-options-vendor">
10
+
11
+ <div class="entry-edit-head">
12
+ <h4><?php echo Mage::helper('catalog')->__('Supplier Details') ?></h4>
13
+ <div class="right"><?php echo $this->getAddButtonHtml() ?></div>
14
+ </div>
15
+
16
+ <div id="product_options_container" class="box">
17
+ <div id="product_options_container_top_vendor">
18
+ <!-- If vendor inventory data is available -->
19
+ <?php if($collection = $this->getAssignedData()): ?>
20
+ <?php if($collection->count() > 0) { ?>
21
+ <?php foreach($collection as $vendor){ ?>
22
+ <div class="option-box" id="vendor_<?php echo $vendor->getId() ?>">
23
+ <table id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>" class="option-header" cellpadding="0" cellspacing="0">
24
+ <input type="hidden" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_is_delete" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][is_delete]" value="" />
25
+ <input type="hidden" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_amosoft_vendor_code" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][amosoft_vendor_code]" value="<?php echo $vendor->getAmosoftVendorCode() ?>" />
26
+ <thead>
27
+ <tr>
28
+ <th class="opt-title" style="width:150px;"><?php echo Mage::helper('dropship')->__('Supplier Code') ?></th>
29
+ <th class="opt-type" style="width:150px;"><?php echo Mage::helper('dropship')->__('Supplier Name') ?></th>
30
+ <th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('dropship')->__('Cost')) ?><span class="required">*</span></th>
31
+ <th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('dropship')->__('Shipping Cost')) ?><span class="required">*</span></th>
32
+ <th class="opt-order" style="width:75px;"><?php echo Mage::helper('dropship')->__('Inventory') ?><span class="required">*</span></th>
33
+ <th class="opt-order" style="width:75px;"><?php echo Mage::helper('dropship')->__('Supplier Sku') ?><span class="required">*</span></th>
34
+ <th class="opt-order" style="width:150px;"><?php echo Mage::helper('dropship')->__('Last Sync') ?><span class="required">*</span></th>
35
+ <th class="a-right"><?php echo $this->jsQuoteEscape($this->getUpdateDeleteButtonHtml()) ?></th>
36
+ </tr>
37
+ </thead>
38
+ <tr>
39
+ <td><?php echo $vendor->getAmosoftVendorCode() ?></td>
40
+ <td><?php echo $vendor->getVendorName() ?></td>
41
+ <td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry validate-number validate-zero-or-greater input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_cost" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][cost]" value="<?php echo $vendor->getCost() ?>"></td>
42
+
43
+ <td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry validate-number validate-zero-or-greater input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_cost" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][shipping_cost]" value="<?php echo $vendor->getShippingCost() ?>"></td>
44
+
45
+ <td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry validate-number validate-zero-or-greater input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_inventory" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][stock]" value="<?php echo $vendor->getStock() ?>"></td>
46
+ <td style = "padding: 5px 5px;"><input style="width: 84px;" type="text" class="required-entry input-text vendor-input-text" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>amosoft_vendor_sku" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][amosoft_vendor_sku]" value="<?php echo $vendor->getAmosoftVendorSku() ?>"></td>
47
+ <td style = "padding: 5px 5px;"><strong><?php echo $this->formatDate($vendor->getUpdatedAt(), 'medium', true); ?></strong></td>
48
+ <td>&nbsp;</td>
49
+ </tr></table></div>
50
+ <?php } } ?>
51
+ <?php endif; ?>
52
+ <!-- end -->
53
+ </div>
54
+ <?php echo $this->getOptionsBoxHtml() ?>
55
+ </div>
56
+ </div>
57
+
58
+ <script type="text/javascript">
59
+ // re-bind form elements onchange
60
+ varienWindowOnload(true);
61
+
62
+ </script>
app/design/adminhtml/default/default/template/amosoft/vendorproducttabhistory.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+ <?php ?>
10
+ <div class="entry-edit">
11
+ <?php if($this->getInventoryLog()-> count() > 0 ): ?>
12
+ <fieldset>
13
+ <ul class="note-list">
14
+
15
+ <?php foreach ($this->getInventoryLog() as $_item): ?>
16
+ <li>
17
+ <strong><?php echo $_item->getAmosoftVendorCode() ?></strong>
18
+ <span class="separator">|</span>
19
+ <strong><?php echo $_item->getAmosoftVendorName() ?></strong>
20
+ <span class="separator">|</span>
21
+ <strong><?php echo $_item->getCost() ?></strong>
22
+ <span class="separator">|</span>
23
+ <strong><?php echo $_item->getStock() ?></strong>
24
+ <span class="separator">|</span>
25
+ <strong><?php echo $_item->getUpdatedBy() ?></strong>
26
+ <span class="separator">|</span>
27
+ <strong><?php echo $_item->getActivity() ?></strong>
28
+ <span class="separator">|</span>
29
+ <strong><?php echo $this->formatDate($_item->getUpdatedAt(), 'medium', true); ?></strong>
30
+ </li>
31
+ <?php endforeach; ?>
32
+ </ul>
33
+ </fieldset>
34
+ <?php else :?>
35
+ <h2>No Data Found</h2>
36
+ <?php endif; ?>
37
+ </div>
app/design/adminhtml/default/default/template/amosoft/window.phtml ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amosoft
4
+ *
5
+ * @category Local
6
+ * @package Amosoft_Dropship
7
+ */
8
+ ?>
9
+
10
+ <?php if ($this->canShow()): ?>
11
+ <?php $msg = $this->getNoticeMessageText();?>
12
+ <script type="text/javascript">
13
+ //<![CDATA[
14
+ var messagePopupClosed = false;
15
+ function openMessagePopup() {
16
+ var height = $('html-body').getHeight();
17
+ $('message-popup-window-mask').setStyle({'height':height+'px'});
18
+ toggleSelectsUnderBlock($('message-popup-window-mask'), false);
19
+ Element.show('message-popup-window-mask');
20
+ $('message-popup-window').addClassName('show');
21
+ }
22
+
23
+ function closeApiMessagePopup() {
24
+ if($('success').value == 1){
25
+ toggleSelectsUnderBlock($('message-popup-window-mask'), true);
26
+ Element.hide('message-popup-window-mask');
27
+ $('message-popup-window').removeClassName('show');
28
+ messagePopupClosed = true;
29
+ }else
30
+ {
31
+ $('advice-required-entry').show();
32
+ }
33
+ }
34
+
35
+ Event.observe(window, 'load', openMessagePopup);
36
+ Event.observe(window, 'keyup', function(evt) {
37
+ if(messagePopupClosed) return;
38
+ var code;
39
+ if (evt.keyCode) code = evt.keyCode;
40
+ else if (evt.which) code = evt.which;
41
+ if (code == Event.KEY_ESC) {
42
+ closeApiMessagePopup();
43
+ }
44
+ });
45
+
46
+ function saveSaopApi()
47
+ {
48
+ $('save_button').addClassName('disabled');
49
+ $('save_button').disable();
50
+ if($('api_key').value.length <= 0 ){
51
+ $('advice-required-entry').show();
52
+ $('save_button').disabled = false;
53
+ $('save_button').removeClassName('disabled');
54
+ return;
55
+ }
56
+ new Ajax.Request('<?php echo $this->getUrl('amosoft/adminhtml_sourcing/saveSoapApi') ?>',
57
+ {
58
+ method:'get',
59
+ parameters: {user_id: '<?php echo $msg['user_id']?>',api_key:$('api_key').value },
60
+ onSuccess: function(transport){
61
+
62
+ var response = transport.responseText.evalJSON() || "no response text";
63
+ $('save_button_text').innerHTML = response.message;
64
+ $('success').value = response.success
65
+ $('api_key').disabled = true;
66
+ $('advice-required-entry').hide();
67
+ },
68
+ onFailure: function(){ alert('Something went wrong...please close popup save API password manually (system->web services->SOPA/XML-RPC-Users->amosoft)')
69
+ $('success').value = 1
70
+ $('save_button').removeClassName('disabled');
71
+ $('save_button').disabled = false;
72
+ }
73
+ });
74
+ }
75
+
76
+ //]]>
77
+ </script>
78
+
79
+ <div id="message-popup-window-mask" style="display:none;"></div>
80
+ <div id="message-popup-window" class="message-popup" style="width:547px">
81
+ <div class="message-popup-head">
82
+ <a href="#" onclick="closeApiMessagePopup(); return false;" title="<?php echo $this->getCloseText(); ?>"><span><?php echo $this->getCloseText(); ?></span></a>
83
+ <h2><?php echo $this->getHeaderText(); ?></h2>
84
+ </div>
85
+ <div class="message-popup-content" >
86
+ <div class="message" style="width:489px">
87
+ <span class="message-icon message-<?php echo $this->getSeverityText();?>" style="background-image:url(<?php echo $this->getSeverityIconsUrl() ?>);"><?php echo $this->getSeverityText();?></span>
88
+ <div class="message-text" style="width:430px">
89
+ <h4>Please save below information for future reference</h4>
90
+ SOAP USER NAME : <b><?php echo $msg['username']; ?></b><br>
91
+ <?php if(empty($msg['api_password'])): ?>
92
+ SOAP API KEY : <input class="required-entry input-text"type="password" name="api_key" id="api_key">
93
+ <input type="hidden" name="success" id="success" value="0">
94
+ <button title="save" id="save_button" type="button" class="scalable task" onclick="saveSaopApi()" style=""><span><span><span id="save_button_text">Save</span></span></span></button>
95
+ <div class="validation-advice" id="advice-required-entry" style="display:none">This is a required field.</div>
96
+ <?php endif; ?>
97
+ <!-- <hr>
98
+ REST CONSUMER KEY : <b><?php //echo $msg['consumer_key']; ?></b><br>
99
+ REST CONSUMER SECRET KEY : <b><?php //echo $msg['consumer_secret']; ?></b><br> -->
100
+ <hr>
101
+ <b>This information can always be retrieved by going to dropship -> General Information.</b>
102
+ </div>
103
+
104
+ </div>
105
+ </div>
106
+ </div>
107
+ <?php endif; ?>
app/etc/modules/Amosoft_Dropship.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Amosoft_Dropship>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <version>0.1.0</version>
8
+ </Amosoft_Dropship>
9
+ </modules>
10
+ </config>
js/amosoft/extjs/bootstrap.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Load the library located at the same path with this file
3
+ *
4
+ * Will automatically load ext-all-debug.js if any of these conditions is true:
5
+ * - Current hostname is localhost
6
+ * - Current hostname is an IP v4 address
7
+ * - Current protocol is "file:"
8
+ *
9
+ * Will load ext-all.js (minified) otherwise
10
+ */
11
+ (function() {
12
+
13
+ var scripts = document.getElementsByTagName('script'),
14
+ localhostTests = [
15
+ /^localhost$/,
16
+ /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:\d{1,5})?\b/ // IP v4
17
+ ],
18
+ host = window.location.hostname,
19
+ isDevelopment = null,
20
+ queryString = window.location.search,
21
+ test, path, i, ln, scriptSrc, match;
22
+
23
+ for (i = 0, ln = scripts.length; i < ln; i++) {
24
+ scriptSrc = scripts[i].src;
25
+
26
+ match = scriptSrc.match(/bootstrap\.js$/);
27
+
28
+ if (match) {
29
+ path = scriptSrc.substring(0, scriptSrc.length - match[0].length);
30
+ break;
31
+ }
32
+ }
33
+
34
+ if (queryString.match('(\\?|&)debug') !== null) {
35
+ isDevelopment = true;
36
+ }
37
+ else if (queryString.match('(\\?|&)nodebug') !== null) {
38
+ isDevelopment = false;
39
+ }
40
+
41
+ if (isDevelopment === null) {
42
+ for (i = 0, ln = localhostTests.length; i < ln; i++) {
43
+ test = localhostTests[i];
44
+
45
+ if (host.search(test) !== -1) {
46
+ isDevelopment = true;
47
+ break;
48
+ }
49
+ }
50
+ }
51
+
52
+ if (isDevelopment === null && window.location.protocol === 'file:') {
53
+ isDevelopment = true;
54
+ }
55
+
56
+ document.write('<script type="text/javascript" src="' + path + 'ext-all' + ((isDevelopment) ? '-debug' : '') + '.js"></script>');
57
+
58
+ })();
js/amosoft/extjs/css/example.css ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Ext JS
3
+ * Copyright(c) 2006-2011 Sencha Inc.
4
+ * licensing@sencha.com
5
+ * http://www.sencha.com/license
6
+ */
7
+ body {
8
+ font-family:helvetica,tahoma,verdana,sans-serif;
9
+ padding:20px;
10
+ padding-top:32px;
11
+ font-size:13px;
12
+ }
13
+ p {
14
+ margin-bottom:15px;
15
+ }
16
+ h1 {
17
+ font-size:18px;
18
+ margin-bottom:20px;
19
+ }
20
+ h2 {
21
+ font-size:14px;
22
+ color:#333;
23
+ font-weight:bold;
24
+ margin:10px 0;
25
+ }
26
+ .example-info{
27
+ width:150px;
28
+ border:1px solid #c3daf9;
29
+ border-top:1px solid #DCEAFB;
30
+ border-left:1px solid #DCEAFB;
31
+ background:#ecf5fe url( info-bg.gif ) repeat-x;
32
+ font-size:10px;
33
+ padding:8px;
34
+ }
35
+ pre.code{
36
+ background: #F8F8F8;
37
+ border: 1px solid #e8e8e8;
38
+ padding:10px;
39
+ margin:10px;
40
+ margin-left:0px;
41
+ border-left:5px solid #e8e8e8;
42
+ font-size: 12px !important;
43
+ line-height:14px !important;
44
+ }
45
+ .msg .x-box-mc {
46
+ font-size:14px;
47
+ }
48
+ #msg-div {
49
+ position:absolute;
50
+ left:35%;
51
+ top:10px;
52
+ width:300px;
53
+ z-index:20000;
54
+ }
55
+ #msg-div .msg {
56
+ border-radius: 8px;
57
+ -moz-border-radius: 8px;
58
+ background: #F6F6F6;
59
+ border: 2px solid #ccc;
60
+ margin-top: 2px;
61
+ padding: 10px 15px;
62
+ color: #555;
63
+ }
64
+ #msg-div .msg h3 {
65
+ margin: 0 0 8px;
66
+ font-weight: bold;
67
+ font-size: 15px;
68
+ }
69
+ #msg-div .msg p {
70
+ margin: 0;
71
+ }
72
+ .x-grid3-row-body p {
73
+ margin:5px 5px 10px 5px !important;
74
+ }
75
+
76
+ .feature-list {
77
+ margin-bottom: 15px;
78
+ }
79
+ .feature-list li {
80
+ list-style: disc;
81
+ margin-left: 17px;
82
+ margin-bottom: 4px;
83
+ }
js/amosoft/extjs/css/ext-all.css ADDED
@@ -0,0 +1 @@
 
1
+ .x-body{margin:0}img{border:0}.x-border-box,.x-border-box *{box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box}.x-rtl{direction:rtl}.x-ltr{direction:ltr}.x-clear{overflow:hidden;clear:both;font-size:0;line-height:0;display:table}.x-strict .x-ie7 .x-clear{height:0;width:0}.x-layer{position:absolute!important;overflow:hidden;zoom:1}.x-fixed-layer{position:fixed!important;overflow:hidden;zoom:1}.x-shim{position:absolute;left:0;top:0;overflow:hidden;filter:alpha(opacity=0);opacity:0}.x-hide-display{display:none!important}.x-hide-visibility{visibility:hidden!important}.x-ie6 .x-item-disabled{filter:none}.x-hidden,.x-hide-offsets{display:block!important;visibility:hidden!important;position:absolute!important;top:-10000px!important}.x-hide-nosize{height:0!important;width:0!important}.x-hide-clip{position:absolute!important;clip:rect(0,0,0,0);clip:rect(0 0 0 0)}.x-masked-relative{position:relative}.x-ie-shadow{background-color:#777;display:none;position:absolute;overflow:hidden;zoom:1}.x-unselectable{user-select:none;-o-user-select:none;-ms-user-select:none;-moz-user-select:-moz-none;-webkit-user-select:none;cursor:default}.x-selectable{cursor:auto;-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text;-o-user-select:text}.x-list-plain{list-style-type:none;margin:0;padding:0}.x-table-plain{border-collapse:collapse;border-spacing:0;font-size:1em}.x-frame-tl,.x-frame-tr,.x-frame-tc,.x-frame-bl,.x-frame-br,.x-frame-bc{overflow:hidden;background-repeat:no-repeat}.x-frame-tc,.x-frame-bc{background-repeat:repeat-x}.x-frame-mc{background-repeat:repeat-x;overflow:hidden}.x-proxy-el{position:absolute;background:#b4b4b4;filter:alpha(opacity=80);opacity:.8}.x-css-shadow{position:absolute;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}.x-item-disabled,.x-item-disabled *{cursor:default}.x-box-item{position:absolute!important;left:0;top:0}div.x-editor{overflow:visible}.x-mask{z-index:100;position:absolute;width:100%;height:100%;zoom:1}.x-mask-shim{z-index:100;position:absolute;top:0;left:0;width:100%;height:100%}.x-mask-msg{z-index:20001;position:absolute}.x-progress{position:relative;border-style:solid;overflow:hidden}.x-progress-bar{overflow:hidden;position:absolute;width:0;height:100%}.x-progress-text{overflow:hidden;position:absolute}.x-btn{display:inline-block;position:relative;zoom:1;*display:inline;outline:0;cursor:pointer;white-space:nowrap;vertical-align:middle;text-decoration:none}.x-btn-wrap{position:relative;display:block}.x-btn-button{position:relative;display:block;text-decoration:none;overflow:hidden;zoom:1}.x-btn-inner{display:block;white-space:nowrap;overflow:hidden;zoom:1}.x-btn-icon-el{top:0;right:0;bottom:0;left:0;position:absolute;background-repeat:no-repeat;text-align:center}.x-btn-inner-center{text-align:center}.x-btn-inner-left{text-align:left}.x-btn-inner-right{text-align:right}.x-box-layout-ct{overflow:hidden;zoom:1}.x-box-target{position:absolute;width:20000px;top:0;left:0;height:1px}.x-box-inner{overflow:hidden;zoom:1;position:relative;left:0;top:0}.x-horizontal-box-overflow-body{float:left}.x-box-scroller{position:relative;background-repeat:no-repeat}.x-box-scroller-left,.x-box-scroller-right{float:left;height:100%;z-index:5}.x-box-scroller-top .x-box-scroller,.x-box-scroller-bottom .x-box-scroller{line-height:0;font-size:0;background-position:center 0}.x-box-menu-after{float:right}.x-toolbar-text{white-space:nowrap}.x-toolbar-separator{display:block;font-size:1px;overflow:hidden;cursor:default;border:0;width:0;height:0;line-height:0}.x-quirks .x-ie .x-toolbar .x-toolbar-separator-horizontal{width:2px}.x-toolbar-scroller{padding-left:0}.x-toolbar-plain{border:0}.x-docked{position:absolute!important;z-index:1}.x-docked-vertical{position:static}.x-docked-top{border-bottom-width:0!important}.x-docked-bottom{border-top-width:0!important}.x-docked-left{border-right-width:0!important}.x-docked-right{border-left-width:0!important}.x-docked-noborder-top{border-top-width:0!important}.x-docked-noborder-right{border-right-width:0!important}.x-docked-noborder-bottom{border-bottom-width:0!important}.x-docked-noborder-left{border-left-width:0!important}.x-noborder-l{border-left-width:0!important}.x-noborder-b{border-bottom-width:0!important}.x-noborder-bl{border-bottom-width:0!important;border-left-width:0!important}.x-noborder-r{border-right-width:0!important}.x-noborder-rl{border-right-width:0!important;border-left-width:0!important}.x-noborder-rb{border-right-width:0!important;border-bottom-width:0!important}.x-noborder-rbl{border-right-width:0!important;border-bottom-width:0!important;border-left-width:0!important}.x-noborder-t{border-top-width:0!important}.x-noborder-tl{border-top-width:0!important;border-left-width:0!important}.x-noborder-tb{border-top-width:0!important;border-bottom-width:0!important}.x-noborder-tbl{border-top-width:0!important;border-bottom-width:0!important;border-left-width:0!important}.x-noborder-tr{border-top-width:0!important;border-right-width:0!important}.x-noborder-trl{border-top-width:0!important;border-right-width:0!important;border-left-width:0!important}.x-noborder-trb{border-top-width:0!important;border-right-width:0!important;border-bottom-width:0!important}.x-noborder-trbl{border-width:0!important}.x-header-icon{background-repeat:no-repeat;background-position:0 0;vertical-align:middle;text-align:center}.x-header-text-container{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.x-dd-drag-proxy,.x-dd-drag-current{z-index:1000000!important;pointer-events:none}.x-dd-drag-repair .x-dd-drag-ghost{filter:alpha(opacity=60);opacity:.6}.x-dd-drag-repair .x-dd-drop-icon{display:none}.x-dd-drag-ghost{filter:alpha(opacity=85);opacity:.85;padding:5px;padding-left:20px;white-space:nowrap;color:#000;font:normal 11px tahoma,arial,verdana,sans-serif;border:1px solid;border-color:#ddd #bbb #bbb #ddd;background-color:#fff}.x-dd-drop-icon{position:absolute;top:3px;left:3px;display:block;width:16px;height:16px;background-color:transparent;background-position:center;background-repeat:no-repeat;z-index:1}.x-dd-drop-ok .x-dd-drop-icon{background-image:url(images/dd/drop-yes.gif)}.x-dd-drop-ok-add .x-dd-drop-icon{background-image:url(images/dd/drop-add.gif)}.x-dd-drop-nodrop div.x-dd-drop-icon{background-image:url(images/dd/drop-no.gif)}.x-panel,.x-plain{overflow:hidden;position:relative}.x-panel{outline:0}.x-ie .x-panel-header,.x-ie .x-panel-header-tl,.x-ie .x-panel-header-tc,.x-ie .x-panel-header-tr,.x-ie .x-panel-header-ml,.x-ie .x-panel-header-mc,.x-ie .x-panel-header-mr,.x-ie .x-panel-header-bl,.x-ie .x-panel-header-bc,.x-ie .x-panel-header-br{zoom:1}.x-ie8 td.x-frame-mc{vertical-align:top}.x-panel-body{overflow:hidden;position:relative}.x-nlg .x-panel-header-vertical .x-frame-mc{background-repeat:repeat-y}.x-panel-header-plain,.x-panel-body-plain{border:0;padding:0}.x-tip{position:absolute;overflow:visible}.x-tip-body{overflow:hidden;position:relative}.x-tip-anchor{position:absolute;overflow:hidden;border-style:solid}.x-table-layout{font-size:1em}.x-btn-group{position:relative;overflow:hidden}.x-btn-group-body{position:relative;zoom:1}.x-btn-group-body .x-table-layout-cell{vertical-align:top}.x-viewport,.x-viewport body{margin:0;padding:0;border:0 none;overflow:hidden;height:100%;position:static}.x-window{outline:0;overflow:hidden}.x-window .x-window-wrap{position:relative}.x-window-body{position:relative;overflow:hidden}.x-window-body-plain{background:transparent}.x-form-item-label{display:block}.x-form-item-label-right{text-align:right}.x-form-item-label-top{display:block;zoom:1}.x-form-invalid-icon{overflow:hidden}.x-form-invalid-icon ul{display:none}.x-form-textarea{overflow:auto;resize:none}.x-safari.x-mac .x-form-textarea{margin-bottom:-2px}.x-form-display-field-body{vertical-align:top}.x-form-cb-wrap{vertical-align:top}.x-form-cb{vertical-align:top;overflow:hidden;padding:0;border:0}.x-form-cb::-moz-focus-inner{padding:0;border:0}.x-form-cb-label{display:inline-block;zoom:1}.x-fieldset{display:block;position:relative}.x-fieldset-header{overflow:hidden}.x-fieldset-header .x-form-item,.x-fieldset-header .x-tool{float:left}.x-fieldset-header .x-form-cb-wrap{font-size:0;line-height:0}.x-fieldset-header .x-form-cb{margin:0}.x-fieldset-header-text{float:left}.x-webkit *:focus{outline:none!important}.x-form-item{vertical-align:top;table-layout:fixed}.x-form-item-body{position:relative}.x-form-form-item td{border-top:1px solid transparent}.x-form-trigger{cursor:pointer;overflow:hidden;background-repeat:no-repeat}.x-item-disabled .x-form-trigger{cursor:default}.x-trigger-noedit{cursor:default}.x-form-trigger-wrap{vertical-align:top;border-collapse:separate}.x-form-spinner-up,.x-form-spinner-down{font-size:0}.x-datepicker{position:relative}.x-datepicker-inner{table-layout:fixed;width:100%;border-collapse:separate}.x-datepicker-cell{padding:0}.x-datepicker-header{position:relative;zoom:1}.x-datepicker-arrow{position:absolute;outline:0;font-size:0}.x-datepicker-column-header{padding:0}.x-datepicker-date{display:block;zoom:1;text-decoration:none}.x-monthpicker{position:absolute;left:0;top:0}.x-monthpicker-body{height:100%}.x-monthpicker-months,.x-monthpicker-years{float:left;height:100%}.x-monthpicker-item{float:left}.x-monthpicker-item-inner{display:block;text-decoration:none}.x-monthpicker-yearnav-button-ct{float:left;text-align:center}.x-monthpicker-yearnav-button{display:inline-block;outline:0;font-size:0}.x-monthpicker-buttons{position:absolute;bottom:0;width:100%}.x-strict .x-ie6 .x-monthpicker-buttons{bottom:-1px}.x-form-file-btn{overflow:hidden}.x-form-file-input{border:0;position:absolute;cursor:pointer;top:-2px;right:-2px;filter:alpha(opacity=0);opacity:0;font-size:1000px}.x-form-item-hidden{margin:0}.x-color-picker-item{float:left;text-decoration:none}.x-color-picker-item-inner{display:block;font-size:1px}.x-html-editor-tb .x-toolbar{position:static!important}.x-htmleditor-iframe{display:block;overflow:auto}.x-fit-item{position:relative}.x-grid-row,.x-grid-data-row{outline:0}.x-grid-view{overflow:hidden;position:relative}.x-grid-table{table-layout:fixed;border-collapse:separate}.x-grid-td{overflow:hidden;border-width:0;vertical-align:top}.x-grid-cell-inner{overflow:hidden;white-space:nowrap;zoom:1}.x-grid-resize-marker{position:absolute;z-index:5;top:0}.col-move-top,.col-move-bottom{position:absolute;top:0;line-height:0;font-size:0;overflow:hidden;z-index:20000;background:no-repeat center top transparent}.x-grid-header-ct{cursor:default}.x-column-header{position:absolute;overflow:hidden;background-repeat:repeat-x}.x-column-header-inner{zoom:1;white-space:nowrap;position:relative;overflow:hidden}.x-column-header-text{white-space:nowrap;background-repeat:no-repeat;zoom:1;display:inline-block}.x-column-header-trigger{display:none;height:100%;background-repeat:no-repeat;position:absolute;right:0;top:0;z-index:2}.x-column-header-over .x-column-header-trigger,.x-column-header-open .x-column-header-trigger{display:block}.x-column-header-align-right{text-align:right}.x-column-header-align-left{text-align:left}.x-column-header-align-center{text-align:center}.x-grid-cell-inner-action-col{line-height:0;font-size:0}.x-grid-cell-inner-checkcolumn{line-height:0;font-size:0}.x-row-numberer .x-column-header-inner{text-overflow:clip}.x-grid-group,.x-grid-group-body,.x-grid-group-hd{zoom:1}.x-grid-group-hd{white-space:nowrap}.x-grid-row-body-hidden,.x-grid-group-collapsed{display:none}.x-grid-rowbody{zoom:1}.x-grid-row-body-hidden{display:none}td.x-grid-rowwrap .x-grid-table{border:0}td.x-grid-rowwrap .x-grid-cell{border-bottom:0;background-color:transparent}.x-grid-editor .x-form-cb-wrap{text-align:center}.x-grid-editor .x-form-display-field{margin:0;white-space:nowrap;overflow:hidden}.x-grid-editor div.x-form-action-col-field{line-height:0}.x-grid-row-editor{position:absolute;overflow:visible;z-index:1}.x-grid-row-editor-buttons{position:absolute;white-space:nowrap}.x-grid-row-expander{font-size:0;line-height:0}.x-abs-layout-ct{position:relative}.x-abs-layout-item{position:absolute!important}.x-splitter{font-size:1px}.x-splitter-horizontal{cursor:e-resize;cursor:row-resize}.x-splitter-vertical{cursor:e-resize;cursor:col-resize}.x-splitter-collapsed,.x-splitter-horizontal-noresize,.x-splitter-vertical-noresize{cursor:default}.x-splitter-active{z-index:4}.x-collapse-el{position:absolute;background-repeat:no-repeat}.x-border-layout-ct{overflow:hidden;zoom:1}.x-border-layout-ct{position:relative}.x-border-region-slide-in{z-index:5}.x-region-collapsed-placeholder{z-index:4}.x-column{float:left}.x-ie6 .x-column{display:inline}.x-quirks .x-ie .x-form-layout-table,.x-quirks .x-ie .x-form-layout-table tbody tr.x-form-item{position:relative}.x-form-layout-table{border-collapse:separate;border-spacing:0 2px}.x-ie6 .x-form-layout-table{border-collapse:collapse;border-spacing:0}.x-menu{outline:0}.x-menu-item{white-space:nowrap;overflow:hidden}.x-menu-item-cmp .x-field-label-cell{vertical-align:middle}.x-menu-icon-separator{position:absolute;top:0;z-index:0;height:100%;overflow:hidden}.x-menu-plain .x-menu-icon-separator{display:none}.x-menu-item-link{text-decoration:none;outline:0;zoom:1}.x-menu-item-text{zoom:1}.x-menu-item-icon,.x-menu-item-icon-right,.x-menu-item-arrow{position:absolute;text-align:center}.x-resizable-overlay{position:absolute;left:0;top:0;width:100%;height:100%;display:none;z-index:200000;background-color:#fff;filter:alpha(opacity=0);opacity:0}.x-slider{outline:0;zoom:1;position:relative}.x-slider-inner{position:relative;left:0;top:0;overflow:visible;zoom:1}.x-slider-vert .x-slider-inner{background:repeat-y 0 0}.x-slider-end{zoom:1}.x-slider-thumb{position:absolute;background:no-repeat 0 0}.x-slider-horz .x-slider-thumb{left:0}.x-slider-vert .x-slider-thumb{bottom:0}a.x-tab{text-decoration:none}.x-tab-bar{position:relative}.x-column-header-checkbox .x-column-header-text{display:block;background-repeat:no-repeat;font-size:0}.x-grid-cell-row-checker{vertical-align:middle;background-repeat:no-repeat;font-size:0}.x-tab{display:block;white-space:nowrap;z-index:1}.x-tab-active{z-index:3}.x-tab-wrap{display:block;position:relative}.x-tab-button{zoom:1;display:block;outline:0}.x-tab-inner{display:block;text-align:center;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden;zoom:1}.x-btn-icon-el{top:0;right:0;bottom:0;left:0;position:absolute;background-repeat:no-repeat;text-align:center}.x-tab-bar{z-index:1}.x-tab-bar-body{z-index:2;position:relative}.x-tab-bar-strip{position:absolute;line-height:0;font-size:0;z-index:1}.x-tab-bar-horizontal .x-tab-bar-strip{width:100%;left:0}.x-tab-bar-vertical .x-tab-bar-strip{height:100%;top:0}.x-tab-bar-strip-top{bottom:0}.x-tab-bar-strip-bottom{top:0}.x-tab-bar-strip-left{right:0}.x-tab-bar-strip-right{left:0}.x-tab-bar-plain{background:transparent!important}.x-tab-icon-el{position:absolute;background-repeat:no-repeat;top:0;left:0;right:auto;bottom:0}.x-tab-close-btn{display:block;position:absolute;font-size:0;line-height:0;background:no-repeat}.x-tab-mc{overflow:visible}.x-autowidth-table .x-grid-table{table-layout:auto;width:auto!important}.x-tree-view{overflow:hidden}.x-tree-elbow-img,.x-tree-icon{background-repeat:no-repeat;background-position:0 center;vertical-align:top}.x-tree-checkbox{border:0;padding:0;vertical-align:top;position:relative;background-color:transparent}.x-tree-animator-wrap{overflow:hidden}.x-tree-node-text{zoom:1}.x-surface{display:-moz-inline-stack;display:inline-block;vertical-align:middle;*vertical-align:auto;zoom:1;*display:inline;overflow:hidden}.rvml{behavior:url(#default#VML)}.x-surface tspan{user-select:none;-o-user-select:none;-ms-user-select:none;-moz-user-select:-moz-none;-webkit-user-select:none;cursor:default}.x-vml-sprite{position:absolute;left:0;top:0;width:1px;height:1px}.x-vml-group{position:absolute;left:0;top:0;width:1000px;height:1000px}.x-vml-measure-span{position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;display:inline}.x-vml-base{position:relative;top:0;left:0;overflow:hidden;display:inline-block}.x-vml-base{position:relative;top:0;left:0;overflow:hidden;display:inline-block}svg,vml{overflow:hidden}.x-body{color:black;font-size:12px;font-family:tahoma,arial,verdana,sans-serif}.x-animating-size,.x-collapsed{overflow:hidden!important}.x-editor .x-form-item-body{padding-bottom:0}.x-focus-element{position:absolute;top:-10px;left:-10px;width:0;height:0}.x-focus-frame{position:absolute;left:0;top:0;z-index:100000000;width:0;height:0}.x-focus-frame-top,.x-focus-frame-bottom,.x-focus-frame-left,.x-focus-frame-right{position:absolute;top:0;left:0}.x-focus-frame-top,.x-focus-frame-bottom{border-top:solid 2px #15428b;height:2px}.x-focus-frame-left,.x-focus-frame-right{border-left:solid 2px #15428b;width:2px}.x-mask{filter:alpha(opacity=50);opacity:.5;background:#ccc}.x-mask-msg{padding:2px;border-style:solid;border-width:1px;border-color:#99bce8;background-image:none;background-color:#dfe9f6}.x-mask-msg-inner{padding:0 5px;border-style:solid;border-width:1px;border-color:#a3bad9;background-color:#eee;color:#222;font:normal 11px tahoma,arial,verdana,sans-serif}.x-mask-msg-text{padding:5px 5px 5px 20px;background-image:url(images/grid/loading.gif);background-repeat:no-repeat;background-position:0 center}.x-progress-default{background-color:#e0e8f3;border-width:1px;height:20px;border-color:#6594cf}.x-content-box .x-progress-default{height:18px}.x-progress-default .x-progress-bar-default{background-image:none;background-color:#73a3e0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#b2ccee),color-stop(50%,#88b1e5),color-stop(51%,#73a3e0),color-stop(100%,#5e96db));background-image:-webkit-linear-gradient(top,#b2ccee,#88b1e5 50%,#73a3e0 51%,#5e96db);background-image:-moz-linear-gradient(top,#b2ccee,#88b1e5 50%,#73a3e0 51%,#5e96db);background-image:-o-linear-gradient(top,#b2ccee,#88b1e5 50%,#73a3e0 51%,#5e96db);background-image:linear-gradient(top,#b2ccee,#88b1e5 50%,#73a3e0 51%,#5e96db)}.x-nlg .x-progress-default .x-progress-bar-default{background:repeat-x;background-image:url(images/progress/progress-default-bg.gif)}.x-progress-default .x-progress-text{color:white;font-weight:bold;font-size:11px;text-align:center;line-height:18px}.x-progress-default .x-progress-text-back{color:#396295;line-height:18px}.x-progress-default .x-progress-bar-default:after{display:none;content:"x-slicer:bg:url(images/progress/progress-default-bg.gif)"}.x-btn-default-small{border-color:#d1d1d1}.x-btn-default-small{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:2px 2px 2px 2px;border-width:1px;border-style:solid;background-image:none;background-color:white;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#fff),color-stop(48%,#f9f9f9),color-stop(52%,#e2e2e2),color-stop(100%,#e7e7e7));background-image:-webkit-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:-moz-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:-o-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7)}.x-btn-default-small-mc{background-image:url(images/btn/btn-default-small-fbg.gif);background-position:0 top;background-color:white}.x-nlg .x-btn-default-small{background-image:url(images/btn/btn-default-small-bg.gif);background-position:0 top}.x-nbr .x-btn-default-small{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-btn-default-small-frameInfo{font-family:th-3-3-3-3-1-1-1-1-2-2-2-2}.x-btn-default-small-tl{background-position:0 -6px}.x-btn-default-small-tr{background-position:right -9px}.x-btn-default-small-bl{background-position:0 -12px}.x-btn-default-small-br{background-position:right -15px}.x-btn-default-small-ml{background-position:0 top}.x-btn-default-small-mr{background-position:right top}.x-btn-default-small-tc{background-position:0 0}.x-btn-default-small-bc{background-position:0 -3px}.x-btn-default-small-tr,.x-btn-default-small-br,.x-btn-default-small-mr{padding-right:3px}.x-btn-default-small-tl,.x-btn-default-small-bl,.x-btn-default-small-ml{padding-left:3px}.x-btn-default-small-tc{height:3px}.x-btn-default-small-bc{height:3px}.x-btn-default-small-tl,.x-btn-default-small-bl,.x-btn-default-small-tr,.x-btn-default-small-br,.x-btn-default-small-tc,.x-btn-default-small-bc,.x-btn-default-small-ml,.x-btn-default-small-mr{zoom:1;background-image:url(images/btn/btn-default-small-corners.gif)}.x-btn-default-small-ml,.x-btn-default-small-mr{zoom:1;background-image:url(images/btn/btn-default-small-sides.gif)}.x-btn-default-small-mc{padding:0}.x-strict .x-ie7 .x-btn-default-small-tl,.x-strict .x-ie7 .x-btn-default-small-bl{position:relative;right:0}.x-btn-default-small:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/btn/btn-default-small-fbg.gif), bg:url(images/btn/btn-default-small-bg.gif), corners:url(images/btn/btn-default-small-corners.gif), sides:url(images/btn/btn-default-small-sides.gif)"}.x-btn-default-small .x-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 4px}.x-btn-default-small .x-btn-arrow{background-image:url(images/button/arrow.gif)}.x-btn-default-small .x-btn-arrow-right{padding-right:12px}.x-btn-default-small .x-btn-arrow-bottom{padding-bottom:12px}.x-btn-default-small .x-btn-glyph{font-size:16px;line-height:16px;color:#333;opacity:.5}.x-ie8m .x-btn-default-small .x-btn-glyph{color:#999}.x-btn-default-small-disabled{border-color:#e1e1e1;background-image:none;background-color:#f7f7f7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f7f7f7),color-stop(48%,#f1f1f1),color-stop(52%,#dadada),color-stop(100%,#dfdfdf));background-image:-webkit-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-moz-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-o-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf)}.x-btn-default-small-icon .x-btn-button,.x-btn-default-small-noicon .x-btn-button{height:16px}.x-btn-default-small-icon .x-btn-inner,.x-btn-default-small-noicon .x-btn-inner{line-height:16px}.x-btn-default-small-icon .x-btn-arrow-right .x-btn-inner,.x-btn-default-small-noicon .x-btn-arrow-right .x-btn-inner,.x-btn-default-small-icon-text-left .x-btn-arrow-right .x-btn-inner{padding-right:0}.x-btn-default-small-icon .x-btn-inner{width:16px;padding:0}.x-btn-default-small-icon .x-btn-icon-el{width:16px;height:16px}.x-btn-default-small-icon-text-left .x-btn-button{height:16px}.x-btn-default-small-icon-text-left .x-btn-inner{line-height:16px;padding-left:20px}.x-btn-default-small-icon-text-left .x-btn-icon-el{width:16px;right:auto}.x-ie6 .x-btn-default-small-icon-text-left .x-btn-icon-el,.x-quirks .x-btn-default-small-icon-text-left .x-btn-icon-el{height:16px}.x-btn-default-small-icon-text-right .x-btn-button{height:16px}.x-btn-default-small-icon-text-right .x-btn-inner{line-height:16px;padding-right:20px}.x-btn-default-small-icon-text-right .x-btn-icon-el{width:16px;left:auto}.x-ie6 .x-btn-default-small-icon-text-right .x-btn-icon-el,.x-quirks .x-btn-default-small-icon-text-right .x-btn-icon-el{height:16px}.x-btn-default-small-icon-text-top .x-btn-inner{padding-top:20px}.x-btn-default-small-icon-text-top .x-btn-icon-el{height:16px;bottom:auto}.x-ie6 .x-btn-default-small-icon-text-top .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-small-icon-text-top .x-btn-icon-el{width:100%}.x-btn-default-small-icon-text-bottom .x-btn-inner{padding-bottom:20px}.x-btn-default-small-icon-text-bottom .x-btn-icon-el{height:16px;top:auto}.x-ie6 .x-btn-default-small-icon-text-bottom .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-small-icon-text-bottom .x-btn-icon-el{width:100%}.x-btn-default-small-over{border-color:#b0ccf2;background-image:none;background-color:#e4f3ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e4f3ff),color-stop(48%,#d9edff),color-stop(52%,#c2d8f2),color-stop(100%,#c6dcf6));background-image:-webkit-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-moz-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-o-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6)}.x-btn-default-small-focus{border-color:#b0ccf2;background-image:none;background-color:#e4f3ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e4f3ff),color-stop(48%,#d9edff),color-stop(52%,#c2d8f2),color-stop(100%,#c6dcf6));background-image:-webkit-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-moz-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-o-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6)}.x-btn-default-small-menu-active,.x-btn-default-small-pressed{border-color:#9ebae1;background-image:none;background-color:#b6cbe4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#b6cbe4),color-stop(48%,#bfd2e6),color-stop(52%,#8dc0f5),color-stop(100%,#98c5f5));background-image:-webkit-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:-moz-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:-o-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5)}.x-btn-default-small-over .x-frame-tl,.x-btn-default-small-over .x-frame-bl,.x-btn-default-small-over .x-frame-tr,.x-btn-default-small-over .x-frame-br,.x-btn-default-small-over .x-frame-tc,.x-btn-default-small-over .x-frame-bc{background-image:url(images/btn/btn-default-small-over-corners.gif)}.x-btn-default-small-over .x-frame-ml,.x-btn-default-small-over .x-frame-mr{background-image:url(images/btn/btn-default-small-over-sides.gif)}.x-btn-default-small-over .x-frame-mc{background-color:#e4f3ff;background-image:url(images/btn/btn-default-small-over-fbg.gif)}.x-btn-default-small-focus .x-frame-tl,.x-btn-default-small-focus .x-frame-bl,.x-btn-default-small-focus .x-frame-tr,.x-btn-default-small-focus .x-frame-br,.x-btn-default-small-focus .x-frame-tc,.x-btn-default-small-focus .x-frame-bc{background-image:url(images/btn/btn-default-small-focus-corners.gif)}.x-btn-default-small-focus .x-frame-ml,.x-btn-default-small-focus .x-frame-mr{background-image:url(images/btn/btn-default-small-focus-sides.gif)}.x-btn-default-small-focus .x-frame-mc{background-color:#e4f3ff;background-image:url(images/btn/btn-default-small-focus-fbg.gif)}.x-btn-default-small-menu-active .x-frame-tl,.x-btn-default-small-menu-active .x-frame-bl,.x-btn-default-small-menu-active .x-frame-tr,.x-btn-default-small-menu-active .x-frame-br,.x-btn-default-small-menu-active .x-frame-tc,.x-btn-default-small-menu-active .x-frame-bc,.x-btn-default-small-pressed .x-frame-tl,.x-btn-default-small-pressed .x-frame-bl,.x-btn-default-small-pressed .x-frame-tr,.x-btn-default-small-pressed .x-frame-br,.x-btn-default-small-pressed .x-frame-tc,.x-btn-default-small-pressed .x-frame-bc{background-image:url(images/btn/btn-default-small-pressed-corners.gif)}.x-btn-default-small-menu-active .x-frame-ml,.x-btn-default-small-menu-active .x-frame-mr,.x-btn-default-small-pressed .x-frame-ml,.x-btn-default-small-pressed .x-frame-mr{background-image:url(images/btn/btn-default-small-pressed-sides.gif)}.x-btn-default-small-menu-active .x-frame-mc,.x-btn-default-small-pressed .x-frame-mc{background-color:#b6cbe4;background-image:url(images/btn/btn-default-small-pressed-fbg.gif)}.x-btn-default-small-disabled .x-frame-tl,.x-btn-default-small-disabled .x-frame-bl,.x-btn-default-small-disabled .x-frame-tr,.x-btn-default-small-disabled .x-frame-br,.x-btn-default-small-disabled .x-frame-tc,.x-btn-default-small-disabled .x-frame-bc{background-image:url(images/btn/btn-default-small-disabled-corners.gif)}.x-btn-default-small-disabled .x-frame-ml,.x-btn-default-small-disabled .x-frame-mr{background-image:url(images/btn/btn-default-small-disabled-sides.gif)}.x-btn-default-small-disabled .x-frame-mc{background-color:#f7f7f7;background-image:url(images/btn/btn-default-small-disabled-fbg.gif)}.x-nlg .x-btn-default-small-over{background-image:url(images/btn/btn-default-small-over-bg.gif)}.x-nlg .x-btn-default-small-focus{background-image:url(images/btn/btn-default-small-focus-bg.gif)}.x-nlg .x-btn-default-small-menu-active,.x-nlg .x-btn-default-small-pressed{background-image:url(images/btn/btn-default-small-pressed-bg.gif)}.x-nlg .x-btn-default-small-disabled{background-image:url(images/btn/btn-default-small-disabled-bg.gif)}.x-nbr .x-btn-default-small{background-image:none}.x-btn-default-small .x-btn-split-right{background-image:url(images/button/s-arrow.gif);padding-right:14px}.x-btn-default-small .x-btn-split-bottom{background-image:url(images/button/s-arrow-b.gif);padding-bottom:14px}.x-btn-default-small-over .x-btn-split-right{background-image:url(images/button/s-arrow-o.gif)}.x-btn-default-small-over .x-btn-split-bottom{background-image:url(images/button/s-arrow-bo.gif)}.x-btn-default-small-disabled .x-btn-inner,.x-btn-default-small-disabled .x-btn-icon-el{filter:alpha(opacity=50);opacity:.5}.x-btn-default-small-over:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-small-over-corners.gif), sides:url(images/btn/btn-default-small-over-sides.gif), frame-bg:url(images/btn/btn-default-small-over-fbg.gif), bg:url(images/btn/btn-default-small-over-bg.gif)"}.x-btn-default-small-focus:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-small-focus-corners.gif), sides:url(images/btn/btn-default-small-focus-sides.gif), frame-bg:url(images/btn/btn-default-small-focus-fbg.gif), bg:url(images/btn/btn-default-small-focus-bg.gif)"}.x-btn-default-small-pressed:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-small-pressed-corners.gif), sides:url(images/btn/btn-default-small-pressed-sides.gif), frame-bg:url(images/btn/btn-default-small-pressed-fbg.gif), bg:url(images/btn/btn-default-small-pressed-bg.gif)"}.x-btn-default-small-disabled:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-small-disabled-corners.gif), sides:url(images/btn/btn-default-small-disabled-sides.gif), frame-bg:url(images/btn/btn-default-small-disabled-fbg.gif), bg:url(images/btn/btn-default-small-disabled-bg.gif)"}.x-btn-default-medium{border-color:#d1d1d1}.x-btn-default-medium{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:3px 3px 3px 3px;border-width:1px;border-style:solid;background-image:none;background-color:white;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#fff),color-stop(48%,#f9f9f9),color-stop(52%,#e2e2e2),color-stop(100%,#e7e7e7));background-image:-webkit-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:-moz-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:-o-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7)}.x-btn-default-medium-mc{background-image:url(images/btn/btn-default-medium-fbg.gif);background-position:0 top;background-color:white}.x-nlg .x-btn-default-medium{background-image:url(images/btn/btn-default-medium-bg.gif);background-position:0 top}.x-nbr .x-btn-default-medium{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-btn-default-medium-frameInfo{font-family:th-3-3-3-3-1-1-1-1-3-3-3-3}.x-btn-default-medium-tl{background-position:0 -6px}.x-btn-default-medium-tr{background-position:right -9px}.x-btn-default-medium-bl{background-position:0 -12px}.x-btn-default-medium-br{background-position:right -15px}.x-btn-default-medium-ml{background-position:0 top}.x-btn-default-medium-mr{background-position:right top}.x-btn-default-medium-tc{background-position:0 0}.x-btn-default-medium-bc{background-position:0 -3px}.x-btn-default-medium-tr,.x-btn-default-medium-br,.x-btn-default-medium-mr{padding-right:3px}.x-btn-default-medium-tl,.x-btn-default-medium-bl,.x-btn-default-medium-ml{padding-left:3px}.x-btn-default-medium-tc{height:3px}.x-btn-default-medium-bc{height:3px}.x-btn-default-medium-tl,.x-btn-default-medium-bl,.x-btn-default-medium-tr,.x-btn-default-medium-br,.x-btn-default-medium-tc,.x-btn-default-medium-bc,.x-btn-default-medium-ml,.x-btn-default-medium-mr{zoom:1;background-image:url(images/btn/btn-default-medium-corners.gif)}.x-btn-default-medium-ml,.x-btn-default-medium-mr{zoom:1;background-image:url(images/btn/btn-default-medium-sides.gif)}.x-btn-default-medium-mc{padding:1px 1px 1px 1px}.x-strict .x-ie7 .x-btn-default-medium-tl,.x-strict .x-ie7 .x-btn-default-medium-bl{position:relative;right:0}.x-btn-default-medium:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/btn/btn-default-medium-fbg.gif), bg:url(images/btn/btn-default-medium-bg.gif), corners:url(images/btn/btn-default-medium-corners.gif), sides:url(images/btn/btn-default-medium-sides.gif)"}.x-btn-default-medium .x-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 3px}.x-btn-default-medium .x-btn-arrow{background-image:url(images/button/arrow.gif)}.x-btn-default-medium .x-btn-arrow-right{padding-right:12px}.x-btn-default-medium .x-btn-arrow-bottom{padding-bottom:12px}.x-btn-default-medium .x-btn-glyph{font-size:24px;line-height:24px;color:#333;opacity:.5}.x-ie8m .x-btn-default-medium .x-btn-glyph{color:#999}.x-btn-default-medium-disabled{border-color:#e1e1e1;background-image:none;background-color:#f7f7f7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f7f7f7),color-stop(48%,#f1f1f1),color-stop(52%,#dadada),color-stop(100%,#dfdfdf));background-image:-webkit-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-moz-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-o-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf)}.x-btn-default-medium-icon .x-btn-button,.x-btn-default-medium-noicon .x-btn-button{height:24px}.x-btn-default-medium-icon .x-btn-inner,.x-btn-default-medium-noicon .x-btn-inner{line-height:24px}.x-btn-default-medium-icon .x-btn-arrow-right .x-btn-inner,.x-btn-default-medium-noicon .x-btn-arrow-right .x-btn-inner,.x-btn-default-medium-icon-text-left .x-btn-arrow-right .x-btn-inner{padding-right:0}.x-btn-default-medium-icon .x-btn-inner{width:24px;padding:0}.x-btn-default-medium-icon .x-btn-icon-el{width:24px;height:24px}.x-btn-default-medium-icon-text-left .x-btn-button{height:24px}.x-btn-default-medium-icon-text-left .x-btn-inner{line-height:24px;padding-left:28px}.x-btn-default-medium-icon-text-left .x-btn-icon-el{width:24px;right:auto}.x-ie6 .x-btn-default-medium-icon-text-left .x-btn-icon-el,.x-quirks .x-btn-default-medium-icon-text-left .x-btn-icon-el{height:24px}.x-btn-default-medium-icon-text-right .x-btn-button{height:24px}.x-btn-default-medium-icon-text-right .x-btn-inner{line-height:24px;padding-right:28px}.x-btn-default-medium-icon-text-right .x-btn-icon-el{width:24px;left:auto}.x-ie6 .x-btn-default-medium-icon-text-right .x-btn-icon-el,.x-quirks .x-btn-default-medium-icon-text-right .x-btn-icon-el{height:24px}.x-btn-default-medium-icon-text-top .x-btn-inner{padding-top:28px}.x-btn-default-medium-icon-text-top .x-btn-icon-el{height:24px;bottom:auto}.x-ie6 .x-btn-default-medium-icon-text-top .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-medium-icon-text-top .x-btn-icon-el{width:100%}.x-btn-default-medium-icon-text-bottom .x-btn-inner{padding-bottom:28px}.x-btn-default-medium-icon-text-bottom .x-btn-icon-el{height:24px;top:auto}.x-ie6 .x-btn-default-medium-icon-text-bottom .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-medium-icon-text-bottom .x-btn-icon-el{width:100%}.x-btn-default-medium-over{border-color:#b0ccf2;background-image:none;background-color:#e4f3ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e4f3ff),color-stop(48%,#d9edff),color-stop(52%,#c2d8f2),color-stop(100%,#c6dcf6));background-image:-webkit-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-moz-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-o-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6)}.x-btn-default-medium-focus{border-color:#b0ccf2;background-image:none;background-color:#e4f3ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e4f3ff),color-stop(48%,#d9edff),color-stop(52%,#c2d8f2),color-stop(100%,#c6dcf6));background-image:-webkit-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-moz-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-o-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6)}.x-btn-default-medium-menu-active,.x-btn-default-medium-pressed{border-color:#9ebae1;background-image:none;background-color:#b6cbe4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#b6cbe4),color-stop(48%,#bfd2e6),color-stop(52%,#8dc0f5),color-stop(100%,#98c5f5));background-image:-webkit-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:-moz-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:-o-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5)}.x-btn-default-medium-over .x-frame-tl,.x-btn-default-medium-over .x-frame-bl,.x-btn-default-medium-over .x-frame-tr,.x-btn-default-medium-over .x-frame-br,.x-btn-default-medium-over .x-frame-tc,.x-btn-default-medium-over .x-frame-bc{background-image:url(images/btn/btn-default-medium-over-corners.gif)}.x-btn-default-medium-over .x-frame-ml,.x-btn-default-medium-over .x-frame-mr{background-image:url(images/btn/btn-default-medium-over-sides.gif)}.x-btn-default-medium-over .x-frame-mc{background-color:#e4f3ff;background-image:url(images/btn/btn-default-medium-over-fbg.gif)}.x-btn-default-medium-focus .x-frame-tl,.x-btn-default-medium-focus .x-frame-bl,.x-btn-default-medium-focus .x-frame-tr,.x-btn-default-medium-focus .x-frame-br,.x-btn-default-medium-focus .x-frame-tc,.x-btn-default-medium-focus .x-frame-bc{background-image:url(images/btn/btn-default-medium-focus-corners.gif)}.x-btn-default-medium-focus .x-frame-ml,.x-btn-default-medium-focus .x-frame-mr{background-image:url(images/btn/btn-default-medium-focus-sides.gif)}.x-btn-default-medium-focus .x-frame-mc{background-color:#e4f3ff;background-image:url(images/btn/btn-default-medium-focus-fbg.gif)}.x-btn-default-medium-menu-active .x-frame-tl,.x-btn-default-medium-menu-active .x-frame-bl,.x-btn-default-medium-menu-active .x-frame-tr,.x-btn-default-medium-menu-active .x-frame-br,.x-btn-default-medium-menu-active .x-frame-tc,.x-btn-default-medium-menu-active .x-frame-bc,.x-btn-default-medium-pressed .x-frame-tl,.x-btn-default-medium-pressed .x-frame-bl,.x-btn-default-medium-pressed .x-frame-tr,.x-btn-default-medium-pressed .x-frame-br,.x-btn-default-medium-pressed .x-frame-tc,.x-btn-default-medium-pressed .x-frame-bc{background-image:url(images/btn/btn-default-medium-pressed-corners.gif)}.x-btn-default-medium-menu-active .x-frame-ml,.x-btn-default-medium-menu-active .x-frame-mr,.x-btn-default-medium-pressed .x-frame-ml,.x-btn-default-medium-pressed .x-frame-mr{background-image:url(images/btn/btn-default-medium-pressed-sides.gif)}.x-btn-default-medium-menu-active .x-frame-mc,.x-btn-default-medium-pressed .x-frame-mc{background-color:#b6cbe4;background-image:url(images/btn/btn-default-medium-pressed-fbg.gif)}.x-btn-default-medium-disabled .x-frame-tl,.x-btn-default-medium-disabled .x-frame-bl,.x-btn-default-medium-disabled .x-frame-tr,.x-btn-default-medium-disabled .x-frame-br,.x-btn-default-medium-disabled .x-frame-tc,.x-btn-default-medium-disabled .x-frame-bc{background-image:url(images/btn/btn-default-medium-disabled-corners.gif)}.x-btn-default-medium-disabled .x-frame-ml,.x-btn-default-medium-disabled .x-frame-mr{background-image:url(images/btn/btn-default-medium-disabled-sides.gif)}.x-btn-default-medium-disabled .x-frame-mc{background-color:#f7f7f7;background-image:url(images/btn/btn-default-medium-disabled-fbg.gif)}.x-nlg .x-btn-default-medium-over{background-image:url(images/btn/btn-default-medium-over-bg.gif)}.x-nlg .x-btn-default-medium-focus{background-image:url(images/btn/btn-default-medium-focus-bg.gif)}.x-nlg .x-btn-default-medium-menu-active,.x-nlg .x-btn-default-medium-pressed{background-image:url(images/btn/btn-default-medium-pressed-bg.gif)}.x-nlg .x-btn-default-medium-disabled{background-image:url(images/btn/btn-default-medium-disabled-bg.gif)}.x-nbr .x-btn-default-medium{background-image:none}.x-btn-default-medium .x-btn-split-right{background-image:url(images/button/s-arrow.gif);padding-right:14px}.x-btn-default-medium .x-btn-split-bottom{background-image:url(images/button/s-arrow-b.gif);padding-bottom:14px}.x-btn-default-medium-over .x-btn-split-right{background-image:url(images/button/s-arrow-o.gif)}.x-btn-default-medium-over .x-btn-split-bottom{background-image:url(images/button/s-arrow-bo.gif)}.x-btn-default-medium-disabled .x-btn-inner,.x-btn-default-medium-disabled .x-btn-icon-el{filter:alpha(opacity=50);opacity:.5}.x-btn-default-medium-over:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-medium-over-corners.gif), sides:url(images/btn/btn-default-medium-over-sides.gif), frame-bg:url(images/btn/btn-default-medium-over-fbg.gif), bg:url(images/btn/btn-default-medium-over-bg.gif)"}.x-btn-default-medium-focus:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-medium-focus-corners.gif), sides:url(images/btn/btn-default-medium-focus-sides.gif), frame-bg:url(images/btn/btn-default-medium-focus-fbg.gif), bg:url(images/btn/btn-default-medium-focus-bg.gif)"}.x-btn-default-medium-pressed:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-medium-pressed-corners.gif), sides:url(images/btn/btn-default-medium-pressed-sides.gif), frame-bg:url(images/btn/btn-default-medium-pressed-fbg.gif), bg:url(images/btn/btn-default-medium-pressed-bg.gif)"}.x-btn-default-medium-disabled:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-medium-disabled-corners.gif), sides:url(images/btn/btn-default-medium-disabled-sides.gif), frame-bg:url(images/btn/btn-default-medium-disabled-fbg.gif), bg:url(images/btn/btn-default-medium-disabled-bg.gif)"}.x-btn-default-large{border-color:#d1d1d1}.x-btn-default-large{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:3px 3px 3px 3px;border-width:1px;border-style:solid;background-image:none;background-color:white;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#fff),color-stop(48%,#f9f9f9),color-stop(52%,#e2e2e2),color-stop(100%,#e7e7e7));background-image:-webkit-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:-moz-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:-o-linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7);background-image:linear-gradient(top,#fff,#f9f9f9 48%,#e2e2e2 52%,#e7e7e7)}.x-btn-default-large-mc{background-image:url(images/btn/btn-default-large-fbg.gif);background-position:0 top;background-color:white}.x-nlg .x-btn-default-large{background-image:url(images/btn/btn-default-large-bg.gif);background-position:0 top}.x-nbr .x-btn-default-large{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-btn-default-large-frameInfo{font-family:th-3-3-3-3-1-1-1-1-3-3-3-3}.x-btn-default-large-tl{background-position:0 -6px}.x-btn-default-large-tr{background-position:right -9px}.x-btn-default-large-bl{background-position:0 -12px}.x-btn-default-large-br{background-position:right -15px}.x-btn-default-large-ml{background-position:0 top}.x-btn-default-large-mr{background-position:right top}.x-btn-default-large-tc{background-position:0 0}.x-btn-default-large-bc{background-position:0 -3px}.x-btn-default-large-tr,.x-btn-default-large-br,.x-btn-default-large-mr{padding-right:3px}.x-btn-default-large-tl,.x-btn-default-large-bl,.x-btn-default-large-ml{padding-left:3px}.x-btn-default-large-tc{height:3px}.x-btn-default-large-bc{height:3px}.x-btn-default-large-tl,.x-btn-default-large-bl,.x-btn-default-large-tr,.x-btn-default-large-br,.x-btn-default-large-tc,.x-btn-default-large-bc,.x-btn-default-large-ml,.x-btn-default-large-mr{zoom:1;background-image:url(images/btn/btn-default-large-corners.gif)}.x-btn-default-large-ml,.x-btn-default-large-mr{zoom:1;background-image:url(images/btn/btn-default-large-sides.gif)}.x-btn-default-large-mc{padding:1px 1px 1px 1px}.x-strict .x-ie7 .x-btn-default-large-tl,.x-strict .x-ie7 .x-btn-default-large-bl{position:relative;right:0}.x-btn-default-large:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/btn/btn-default-large-fbg.gif), bg:url(images/btn/btn-default-large-bg.gif), corners:url(images/btn/btn-default-large-corners.gif), sides:url(images/btn/btn-default-large-sides.gif)"}.x-btn-default-large .x-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 3px}.x-btn-default-large .x-btn-arrow{background-image:url(images/button/arrow.gif)}.x-btn-default-large .x-btn-arrow-right{padding-right:12px}.x-btn-default-large .x-btn-arrow-bottom{padding-bottom:12px}.x-btn-default-large .x-btn-glyph{font-size:32px;line-height:32px;color:#333;opacity:.5}.x-ie8m .x-btn-default-large .x-btn-glyph{color:#999}.x-btn-default-large-disabled{border-color:#e1e1e1;background-image:none;background-color:#f7f7f7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f7f7f7),color-stop(48%,#f1f1f1),color-stop(52%,#dadada),color-stop(100%,#dfdfdf));background-image:-webkit-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-moz-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:-o-linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf);background-image:linear-gradient(top,#f7f7f7,#f1f1f1 48%,#dadada 52%,#dfdfdf)}.x-btn-default-large-icon .x-btn-button,.x-btn-default-large-noicon .x-btn-button{height:32px}.x-btn-default-large-icon .x-btn-inner,.x-btn-default-large-noicon .x-btn-inner{line-height:32px}.x-btn-default-large-icon .x-btn-arrow-right .x-btn-inner,.x-btn-default-large-noicon .x-btn-arrow-right .x-btn-inner,.x-btn-default-large-icon-text-left .x-btn-arrow-right .x-btn-inner{padding-right:0}.x-btn-default-large-icon .x-btn-inner{width:32px;padding:0}.x-btn-default-large-icon .x-btn-icon-el{width:32px;height:32px}.x-btn-default-large-icon-text-left .x-btn-button{height:32px}.x-btn-default-large-icon-text-left .x-btn-inner{line-height:32px;padding-left:36px}.x-btn-default-large-icon-text-left .x-btn-icon-el{width:32px;right:auto}.x-ie6 .x-btn-default-large-icon-text-left .x-btn-icon-el,.x-quirks .x-btn-default-large-icon-text-left .x-btn-icon-el{height:32px}.x-btn-default-large-icon-text-right .x-btn-button{height:32px}.x-btn-default-large-icon-text-right .x-btn-inner{line-height:32px;padding-right:36px}.x-btn-default-large-icon-text-right .x-btn-icon-el{width:32px;left:auto}.x-ie6 .x-btn-default-large-icon-text-right .x-btn-icon-el,.x-quirks .x-btn-default-large-icon-text-right .x-btn-icon-el{height:32px}.x-btn-default-large-icon-text-top .x-btn-inner{padding-top:36px}.x-btn-default-large-icon-text-top .x-btn-icon-el{height:32px;bottom:auto}.x-ie6 .x-btn-default-large-icon-text-top .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-large-icon-text-top .x-btn-icon-el{width:100%}.x-btn-default-large-icon-text-bottom .x-btn-inner{padding-bottom:36px}.x-btn-default-large-icon-text-bottom .x-btn-icon-el{height:32px;top:auto}.x-ie6 .x-btn-default-large-icon-text-bottom .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-large-icon-text-bottom .x-btn-icon-el{width:100%}.x-btn-default-large-over{border-color:#b0ccf2;background-image:none;background-color:#e4f3ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e4f3ff),color-stop(48%,#d9edff),color-stop(52%,#c2d8f2),color-stop(100%,#c6dcf6));background-image:-webkit-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-moz-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-o-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6)}.x-btn-default-large-focus{border-color:#b0ccf2;background-image:none;background-color:#e4f3ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e4f3ff),color-stop(48%,#d9edff),color-stop(52%,#c2d8f2),color-stop(100%,#c6dcf6));background-image:-webkit-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-moz-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:-o-linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6);background-image:linear-gradient(top,#e4f3ff,#d9edff 48%,#c2d8f2 52%,#c6dcf6)}.x-btn-default-large-menu-active,.x-btn-default-large-pressed{border-color:#9ebae1;background-image:none;background-color:#b6cbe4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#b6cbe4),color-stop(48%,#bfd2e6),color-stop(52%,#8dc0f5),color-stop(100%,#98c5f5));background-image:-webkit-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:-moz-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:-o-linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5);background-image:linear-gradient(top,#b6cbe4,#bfd2e6 48%,#8dc0f5 52%,#98c5f5)}.x-btn-default-large-over .x-frame-tl,.x-btn-default-large-over .x-frame-bl,.x-btn-default-large-over .x-frame-tr,.x-btn-default-large-over .x-frame-br,.x-btn-default-large-over .x-frame-tc,.x-btn-default-large-over .x-frame-bc{background-image:url(images/btn/btn-default-large-over-corners.gif)}.x-btn-default-large-over .x-frame-ml,.x-btn-default-large-over .x-frame-mr{background-image:url(images/btn/btn-default-large-over-sides.gif)}.x-btn-default-large-over .x-frame-mc{background-color:#e4f3ff;background-image:url(images/btn/btn-default-large-over-fbg.gif)}.x-btn-default-large-focus .x-frame-tl,.x-btn-default-large-focus .x-frame-bl,.x-btn-default-large-focus .x-frame-tr,.x-btn-default-large-focus .x-frame-br,.x-btn-default-large-focus .x-frame-tc,.x-btn-default-large-focus .x-frame-bc{background-image:url(images/btn/btn-default-large-focus-corners.gif)}.x-btn-default-large-focus .x-frame-ml,.x-btn-default-large-focus .x-frame-mr{background-image:url(images/btn/btn-default-large-focus-sides.gif)}.x-btn-default-large-focus .x-frame-mc{background-color:#e4f3ff;background-image:url(images/btn/btn-default-large-focus-fbg.gif)}.x-btn-default-large-menu-active .x-frame-tl,.x-btn-default-large-menu-active .x-frame-bl,.x-btn-default-large-menu-active .x-frame-tr,.x-btn-default-large-menu-active .x-frame-br,.x-btn-default-large-menu-active .x-frame-tc,.x-btn-default-large-menu-active .x-frame-bc,.x-btn-default-large-pressed .x-frame-tl,.x-btn-default-large-pressed .x-frame-bl,.x-btn-default-large-pressed .x-frame-tr,.x-btn-default-large-pressed .x-frame-br,.x-btn-default-large-pressed .x-frame-tc,.x-btn-default-large-pressed .x-frame-bc{background-image:url(images/btn/btn-default-large-pressed-corners.gif)}.x-btn-default-large-menu-active .x-frame-ml,.x-btn-default-large-menu-active .x-frame-mr,.x-btn-default-large-pressed .x-frame-ml,.x-btn-default-large-pressed .x-frame-mr{background-image:url(images/btn/btn-default-large-pressed-sides.gif)}.x-btn-default-large-menu-active .x-frame-mc,.x-btn-default-large-pressed .x-frame-mc{background-color:#b6cbe4;background-image:url(images/btn/btn-default-large-pressed-fbg.gif)}.x-btn-default-large-disabled .x-frame-tl,.x-btn-default-large-disabled .x-frame-bl,.x-btn-default-large-disabled .x-frame-tr,.x-btn-default-large-disabled .x-frame-br,.x-btn-default-large-disabled .x-frame-tc,.x-btn-default-large-disabled .x-frame-bc{background-image:url(images/btn/btn-default-large-disabled-corners.gif)}.x-btn-default-large-disabled .x-frame-ml,.x-btn-default-large-disabled .x-frame-mr{background-image:url(images/btn/btn-default-large-disabled-sides.gif)}.x-btn-default-large-disabled .x-frame-mc{background-color:#f7f7f7;background-image:url(images/btn/btn-default-large-disabled-fbg.gif)}.x-nlg .x-btn-default-large-over{background-image:url(images/btn/btn-default-large-over-bg.gif)}.x-nlg .x-btn-default-large-focus{background-image:url(images/btn/btn-default-large-focus-bg.gif)}.x-nlg .x-btn-default-large-menu-active,.x-nlg .x-btn-default-large-pressed{background-image:url(images/btn/btn-default-large-pressed-bg.gif)}.x-nlg .x-btn-default-large-disabled{background-image:url(images/btn/btn-default-large-disabled-bg.gif)}.x-nbr .x-btn-default-large{background-image:none}.x-btn-default-large .x-btn-split-right{background-image:url(images/button/s-arrow.gif);padding-right:14px}.x-btn-default-large .x-btn-split-bottom{background-image:url(images/button/s-arrow-b.gif);padding-bottom:14px}.x-btn-default-large-over .x-btn-split-right{background-image:url(images/button/s-arrow-o.gif)}.x-btn-default-large-over .x-btn-split-bottom{background-image:url(images/button/s-arrow-bo.gif)}.x-btn-default-large-disabled .x-btn-inner,.x-btn-default-large-disabled .x-btn-icon-el{filter:alpha(opacity=50);opacity:.5}.x-btn-default-large-over:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-large-over-corners.gif), sides:url(images/btn/btn-default-large-over-sides.gif), frame-bg:url(images/btn/btn-default-large-over-fbg.gif), bg:url(images/btn/btn-default-large-over-bg.gif)"}.x-btn-default-large-focus:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-large-focus-corners.gif), sides:url(images/btn/btn-default-large-focus-sides.gif), frame-bg:url(images/btn/btn-default-large-focus-fbg.gif), bg:url(images/btn/btn-default-large-focus-bg.gif)"}.x-btn-default-large-pressed:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-large-pressed-corners.gif), sides:url(images/btn/btn-default-large-pressed-sides.gif), frame-bg:url(images/btn/btn-default-large-pressed-fbg.gif), bg:url(images/btn/btn-default-large-pressed-bg.gif)"}.x-btn-default-large-disabled:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-large-disabled-corners.gif), sides:url(images/btn/btn-default-large-disabled-sides.gif), frame-bg:url(images/btn/btn-default-large-disabled-fbg.gif), bg:url(images/btn/btn-default-large-disabled-bg.gif)"}.x-btn-default-toolbar-small{border-color:transparent}.x-btn-default-toolbar-small{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:2px 2px 2px 2px;border-width:1px;border-style:solid;background-color:transparent}.x-btn-default-toolbar-small-mc{background-color:transparent}.x-nbr .x-btn-default-toolbar-small{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-btn-default-toolbar-small-frameInfo{font-family:th-3-3-3-3-1-1-1-1-2-2-2-2}.x-btn-default-toolbar-small-tl{background-position:0 -6px}.x-btn-default-toolbar-small-tr{background-position:right -9px}.x-btn-default-toolbar-small-bl{background-position:0 -12px}.x-btn-default-toolbar-small-br{background-position:right -15px}.x-btn-default-toolbar-small-ml{background-position:0 top}.x-btn-default-toolbar-small-mr{background-position:right top}.x-btn-default-toolbar-small-tc{background-position:0 0}.x-btn-default-toolbar-small-bc{background-position:0 -3px}.x-btn-default-toolbar-small-tr,.x-btn-default-toolbar-small-br,.x-btn-default-toolbar-small-mr{padding-right:3px}.x-btn-default-toolbar-small-tl,.x-btn-default-toolbar-small-bl,.x-btn-default-toolbar-small-ml{padding-left:3px}.x-btn-default-toolbar-small-tc{height:3px}.x-btn-default-toolbar-small-bc{height:3px}.x-btn-default-toolbar-small-tl,.x-btn-default-toolbar-small-bl,.x-btn-default-toolbar-small-tr,.x-btn-default-toolbar-small-br,.x-btn-default-toolbar-small-tc,.x-btn-default-toolbar-small-bc,.x-btn-default-toolbar-small-ml,.x-btn-default-toolbar-small-mr{zoom:1}.x-btn-default-toolbar-small-ml,.x-btn-default-toolbar-small-mr{zoom:1}.x-btn-default-toolbar-small-mc{padding:0}.x-strict .x-ie7 .x-btn-default-toolbar-small-tl,.x-strict .x-ie7 .x-btn-default-toolbar-small-bl{position:relative;right:0}.x-btn-default-toolbar-small .x-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 4px}.x-btn-default-toolbar-small .x-btn-arrow{background-image:url(images/button/arrow.gif)}.x-btn-default-toolbar-small .x-btn-arrow-right{padding-right:12px}.x-btn-default-toolbar-small .x-btn-arrow-bottom{padding-bottom:12px}.x-btn-default-toolbar-small .x-btn-glyph{font-size:16px;line-height:16px;color:#333;opacity:.5}.x-ie8m .x-btn-default-toolbar-small .x-btn-glyph{color:#999}.x-btn-default-toolbar-small-disabled{border-color:#e1e1e1;background-image:none;background-color:transparent}.x-btn-default-toolbar-small-disabled .x-btn-inner{color:#8c8c8c}.x-btn-default-toolbar-small-icon .x-btn-button,.x-btn-default-toolbar-small-noicon .x-btn-button{height:16px}.x-btn-default-toolbar-small-icon .x-btn-inner,.x-btn-default-toolbar-small-noicon .x-btn-inner{line-height:16px}.x-btn-default-toolbar-small-icon .x-btn-arrow-right .x-btn-inner,.x-btn-default-toolbar-small-noicon .x-btn-arrow-right .x-btn-inner,.x-btn-default-toolbar-small-icon-text-left .x-btn-arrow-right .x-btn-inner{padding-right:0}.x-btn-default-toolbar-small-icon .x-btn-inner{width:16px;padding:0}.x-btn-default-toolbar-small-icon .x-btn-icon-el{width:16px;height:16px}.x-btn-default-toolbar-small-icon-text-left .x-btn-button{height:16px}.x-btn-default-toolbar-small-icon-text-left .x-btn-inner{line-height:16px;padding-left:20px}.x-btn-default-toolbar-small-icon-text-left .x-btn-icon-el{width:16px;right:auto}.x-ie6 .x-btn-default-toolbar-small-icon-text-left .x-btn-icon-el,.x-quirks .x-btn-default-toolbar-small-icon-text-left .x-btn-icon-el{height:16px}.x-btn-default-toolbar-small-icon-text-right .x-btn-button{height:16px}.x-btn-default-toolbar-small-icon-text-right .x-btn-inner{line-height:16px;padding-right:20px}.x-btn-default-toolbar-small-icon-text-right .x-btn-icon-el{width:16px;left:auto}.x-ie6 .x-btn-default-toolbar-small-icon-text-right .x-btn-icon-el,.x-quirks .x-btn-default-toolbar-small-icon-text-right .x-btn-icon-el{height:16px}.x-btn-default-toolbar-small-icon-text-top .x-btn-inner{padding-top:20px}.x-btn-default-toolbar-small-icon-text-top .x-btn-icon-el{height:16px;bottom:auto}.x-ie6 .x-btn-default-toolbar-small-icon-text-top .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-toolbar-small-icon-text-top .x-btn-icon-el{width:100%}.x-btn-default-toolbar-small-icon-text-bottom .x-btn-inner{padding-bottom:20px}.x-btn-default-toolbar-small-icon-text-bottom .x-btn-icon-el{height:16px;top:auto}.x-ie6 .x-btn-default-toolbar-small-icon-text-bottom .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-toolbar-small-icon-text-bottom .x-btn-icon-el{width:100%}.x-btn-default-toolbar-small-over{border-color:#81a4d0;background-image:none;background-color:#dbeeff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dbeeff),color-stop(48%,#d0e7ff),color-stop(52%,#bbd2f0),color-stop(100%,#bed6f5));background-image:-webkit-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-moz-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-o-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5)}.x-btn-default-toolbar-small-focus{border-color:#81a4d0;background-image:none;background-color:#dbeeff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dbeeff),color-stop(48%,#d0e7ff),color-stop(52%,#bbd2f0),color-stop(100%,#bed6f5));background-image:-webkit-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-moz-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-o-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5)}.x-btn-default-toolbar-small-menu-active,.x-btn-default-toolbar-small-pressed{border-color:#7a9ac4;background-image:none;background-color:#bccfe5;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#bccfe5),color-stop(48%,#c5d6e7),color-stop(52%,#95c4f4),color-stop(100%,#9fc9f5));background-image:-webkit-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:-moz-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:-o-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5)}.x-btn-default-toolbar-small-over .x-frame-tl,.x-btn-default-toolbar-small-over .x-frame-bl,.x-btn-default-toolbar-small-over .x-frame-tr,.x-btn-default-toolbar-small-over .x-frame-br,.x-btn-default-toolbar-small-over .x-frame-tc,.x-btn-default-toolbar-small-over .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-small-over-corners.gif)}.x-btn-default-toolbar-small-over .x-frame-ml,.x-btn-default-toolbar-small-over .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-small-over-sides.gif)}.x-btn-default-toolbar-small-over .x-frame-mc{background-color:#dbeeff;background-image:url(images/btn/btn-default-toolbar-small-over-fbg.gif)}.x-btn-default-toolbar-small-focus .x-frame-tl,.x-btn-default-toolbar-small-focus .x-frame-bl,.x-btn-default-toolbar-small-focus .x-frame-tr,.x-btn-default-toolbar-small-focus .x-frame-br,.x-btn-default-toolbar-small-focus .x-frame-tc,.x-btn-default-toolbar-small-focus .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-small-focus-corners.gif)}.x-btn-default-toolbar-small-focus .x-frame-ml,.x-btn-default-toolbar-small-focus .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-small-focus-sides.gif)}.x-btn-default-toolbar-small-focus .x-frame-mc{background-color:#dbeeff;background-image:url(images/btn/btn-default-toolbar-small-focus-fbg.gif)}.x-btn-default-toolbar-small-menu-active .x-frame-tl,.x-btn-default-toolbar-small-menu-active .x-frame-bl,.x-btn-default-toolbar-small-menu-active .x-frame-tr,.x-btn-default-toolbar-small-menu-active .x-frame-br,.x-btn-default-toolbar-small-menu-active .x-frame-tc,.x-btn-default-toolbar-small-menu-active .x-frame-bc,.x-btn-default-toolbar-small-pressed .x-frame-tl,.x-btn-default-toolbar-small-pressed .x-frame-bl,.x-btn-default-toolbar-small-pressed .x-frame-tr,.x-btn-default-toolbar-small-pressed .x-frame-br,.x-btn-default-toolbar-small-pressed .x-frame-tc,.x-btn-default-toolbar-small-pressed .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-small-pressed-corners.gif)}.x-btn-default-toolbar-small-menu-active .x-frame-ml,.x-btn-default-toolbar-small-menu-active .x-frame-mr,.x-btn-default-toolbar-small-pressed .x-frame-ml,.x-btn-default-toolbar-small-pressed .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-small-pressed-sides.gif)}.x-btn-default-toolbar-small-menu-active .x-frame-mc,.x-btn-default-toolbar-small-pressed .x-frame-mc{background-color:#bccfe5;background-image:url(images/btn/btn-default-toolbar-small-pressed-fbg.gif)}.x-btn-default-toolbar-small-disabled .x-frame-tl,.x-btn-default-toolbar-small-disabled .x-frame-bl,.x-btn-default-toolbar-small-disabled .x-frame-tr,.x-btn-default-toolbar-small-disabled .x-frame-br,.x-btn-default-toolbar-small-disabled .x-frame-tc,.x-btn-default-toolbar-small-disabled .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-small-disabled-corners.gif)}.x-btn-default-toolbar-small-disabled .x-frame-ml,.x-btn-default-toolbar-small-disabled .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-small-disabled-sides.gif)}.x-btn-default-toolbar-small-disabled .x-frame-mc{background-color:transparent}.x-nlg .x-btn-default-toolbar-small-over{background-image:url(images/btn/btn-default-toolbar-small-over-bg.gif)}.x-nlg .x-btn-default-toolbar-small-focus{background-image:url(images/btn/btn-default-toolbar-small-focus-bg.gif)}.x-nlg .x-btn-default-toolbar-small-menu-active,.x-nlg .x-btn-default-toolbar-small-pressed{background-image:url(images/btn/btn-default-toolbar-small-pressed-bg.gif)}.x-nbr .x-btn-default-toolbar-small{background-image:none}.x-btn-default-toolbar-small .x-btn-split-right{background-image:url(images/button/s-arrow-noline.gif);padding-right:14px}.x-btn-default-toolbar-small .x-btn-split-bottom{background-image:url(images/button/s-arrow-b-noline.gif);padding-bottom:14px}.x-btn-default-toolbar-small-over .x-btn-split-right{background-image:url(images/button/s-arrow-o.gif)}.x-btn-default-toolbar-small-over .x-btn-split-bottom{background-image:url(images/button/s-arrow-bo.gif)}.x-btn-default-toolbar-small-disabled{filter:alpha(opacity=50);opacity:.5}.x-btn-default-toolbar-small-over:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-small-over-corners.gif), sides:url(images/btn/btn-default-toolbar-small-over-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-small-over-fbg.gif), bg:url(images/btn/btn-default-toolbar-small-over-bg.gif)"}.x-btn-default-toolbar-small-focus:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-small-focus-corners.gif), sides:url(images/btn/btn-default-toolbar-small-focus-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-small-focus-fbg.gif), bg:url(images/btn/btn-default-toolbar-small-focus-bg.gif)"}.x-btn-default-toolbar-small-pressed:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-small-pressed-corners.gif), sides:url(images/btn/btn-default-toolbar-small-pressed-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-small-pressed-fbg.gif), bg:url(images/btn/btn-default-toolbar-small-pressed-bg.gif)"}.x-btn-default-toolbar-small-disabled:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-small-disabled-corners.gif), sides:url(images/btn/btn-default-toolbar-small-disabled-sides.gif)"}.x-btn-default-toolbar-medium{border-color:transparent}.x-btn-default-toolbar-medium{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:3px 3px 3px 3px;border-width:1px;border-style:solid;background-color:transparent}.x-btn-default-toolbar-medium-mc{background-color:transparent}.x-nbr .x-btn-default-toolbar-medium{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-btn-default-toolbar-medium-frameInfo{font-family:th-3-3-3-3-1-1-1-1-3-3-3-3}.x-btn-default-toolbar-medium-tl{background-position:0 -6px}.x-btn-default-toolbar-medium-tr{background-position:right -9px}.x-btn-default-toolbar-medium-bl{background-position:0 -12px}.x-btn-default-toolbar-medium-br{background-position:right -15px}.x-btn-default-toolbar-medium-ml{background-position:0 top}.x-btn-default-toolbar-medium-mr{background-position:right top}.x-btn-default-toolbar-medium-tc{background-position:0 0}.x-btn-default-toolbar-medium-bc{background-position:0 -3px}.x-btn-default-toolbar-medium-tr,.x-btn-default-toolbar-medium-br,.x-btn-default-toolbar-medium-mr{padding-right:3px}.x-btn-default-toolbar-medium-tl,.x-btn-default-toolbar-medium-bl,.x-btn-default-toolbar-medium-ml{padding-left:3px}.x-btn-default-toolbar-medium-tc{height:3px}.x-btn-default-toolbar-medium-bc{height:3px}.x-btn-default-toolbar-medium-tl,.x-btn-default-toolbar-medium-bl,.x-btn-default-toolbar-medium-tr,.x-btn-default-toolbar-medium-br,.x-btn-default-toolbar-medium-tc,.x-btn-default-toolbar-medium-bc,.x-btn-default-toolbar-medium-ml,.x-btn-default-toolbar-medium-mr{zoom:1}.x-btn-default-toolbar-medium-ml,.x-btn-default-toolbar-medium-mr{zoom:1}.x-btn-default-toolbar-medium-mc{padding:1px 1px 1px 1px}.x-strict .x-ie7 .x-btn-default-toolbar-medium-tl,.x-strict .x-ie7 .x-btn-default-toolbar-medium-bl{position:relative;right:0}.x-btn-default-toolbar-medium .x-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 3px}.x-btn-default-toolbar-medium .x-btn-arrow{background-image:url(images/button/arrow.gif)}.x-btn-default-toolbar-medium .x-btn-arrow-right{padding-right:12px}.x-btn-default-toolbar-medium .x-btn-arrow-bottom{padding-bottom:12px}.x-btn-default-toolbar-medium .x-btn-glyph{font-size:24px;line-height:24px;color:#333;opacity:.5}.x-ie8m .x-btn-default-toolbar-medium .x-btn-glyph{color:#999}.x-btn-default-toolbar-medium-disabled{border-color:#e1e1e1;background-image:none;background-color:transparent}.x-btn-default-toolbar-medium-disabled .x-btn-inner{color:#8c8c8c}.x-btn-default-toolbar-medium-icon .x-btn-button,.x-btn-default-toolbar-medium-noicon .x-btn-button{height:24px}.x-btn-default-toolbar-medium-icon .x-btn-inner,.x-btn-default-toolbar-medium-noicon .x-btn-inner{line-height:24px}.x-btn-default-toolbar-medium-icon .x-btn-arrow-right .x-btn-inner,.x-btn-default-toolbar-medium-noicon .x-btn-arrow-right .x-btn-inner,.x-btn-default-toolbar-medium-icon-text-left .x-btn-arrow-right .x-btn-inner{padding-right:0}.x-btn-default-toolbar-medium-icon .x-btn-inner{width:24px;padding:0}.x-btn-default-toolbar-medium-icon .x-btn-icon-el{width:24px;height:24px}.x-btn-default-toolbar-medium-icon-text-left .x-btn-button{height:24px}.x-btn-default-toolbar-medium-icon-text-left .x-btn-inner{line-height:24px;padding-left:28px}.x-btn-default-toolbar-medium-icon-text-left .x-btn-icon-el{width:24px;right:auto}.x-ie6 .x-btn-default-toolbar-medium-icon-text-left .x-btn-icon-el,.x-quirks .x-btn-default-toolbar-medium-icon-text-left .x-btn-icon-el{height:24px}.x-btn-default-toolbar-medium-icon-text-right .x-btn-button{height:24px}.x-btn-default-toolbar-medium-icon-text-right .x-btn-inner{line-height:24px;padding-right:28px}.x-btn-default-toolbar-medium-icon-text-right .x-btn-icon-el{width:24px;left:auto}.x-ie6 .x-btn-default-toolbar-medium-icon-text-right .x-btn-icon-el,.x-quirks .x-btn-default-toolbar-medium-icon-text-right .x-btn-icon-el{height:24px}.x-btn-default-toolbar-medium-icon-text-top .x-btn-inner{padding-top:28px}.x-btn-default-toolbar-medium-icon-text-top .x-btn-icon-el{height:24px;bottom:auto}.x-ie6 .x-btn-default-toolbar-medium-icon-text-top .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-toolbar-medium-icon-text-top .x-btn-icon-el{width:100%}.x-btn-default-toolbar-medium-icon-text-bottom .x-btn-inner{padding-bottom:28px}.x-btn-default-toolbar-medium-icon-text-bottom .x-btn-icon-el{height:24px;top:auto}.x-ie6 .x-btn-default-toolbar-medium-icon-text-bottom .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-toolbar-medium-icon-text-bottom .x-btn-icon-el{width:100%}.x-btn-default-toolbar-medium-over{border-color:#81a4d0;background-image:none;background-color:#dbeeff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dbeeff),color-stop(48%,#d0e7ff),color-stop(52%,#bbd2f0),color-stop(100%,#bed6f5));background-image:-webkit-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-moz-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-o-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5)}.x-btn-default-toolbar-medium-focus{border-color:#81a4d0;background-image:none;background-color:#dbeeff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dbeeff),color-stop(48%,#d0e7ff),color-stop(52%,#bbd2f0),color-stop(100%,#bed6f5));background-image:-webkit-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-moz-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-o-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5)}.x-btn-default-toolbar-medium-menu-active,.x-btn-default-toolbar-medium-pressed{border-color:#7a9ac4;background-image:none;background-color:#bccfe5;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#bccfe5),color-stop(48%,#c5d6e7),color-stop(52%,#95c4f4),color-stop(100%,#9fc9f5));background-image:-webkit-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:-moz-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:-o-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5)}.x-btn-default-toolbar-medium-over .x-frame-tl,.x-btn-default-toolbar-medium-over .x-frame-bl,.x-btn-default-toolbar-medium-over .x-frame-tr,.x-btn-default-toolbar-medium-over .x-frame-br,.x-btn-default-toolbar-medium-over .x-frame-tc,.x-btn-default-toolbar-medium-over .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-medium-over-corners.gif)}.x-btn-default-toolbar-medium-over .x-frame-ml,.x-btn-default-toolbar-medium-over .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-medium-over-sides.gif)}.x-btn-default-toolbar-medium-over .x-frame-mc{background-color:#dbeeff;background-image:url(images/btn/btn-default-toolbar-medium-over-fbg.gif)}.x-btn-default-toolbar-medium-focus .x-frame-tl,.x-btn-default-toolbar-medium-focus .x-frame-bl,.x-btn-default-toolbar-medium-focus .x-frame-tr,.x-btn-default-toolbar-medium-focus .x-frame-br,.x-btn-default-toolbar-medium-focus .x-frame-tc,.x-btn-default-toolbar-medium-focus .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-medium-focus-corners.gif)}.x-btn-default-toolbar-medium-focus .x-frame-ml,.x-btn-default-toolbar-medium-focus .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-medium-focus-sides.gif)}.x-btn-default-toolbar-medium-focus .x-frame-mc{background-color:#dbeeff;background-image:url(images/btn/btn-default-toolbar-medium-focus-fbg.gif)}.x-btn-default-toolbar-medium-menu-active .x-frame-tl,.x-btn-default-toolbar-medium-menu-active .x-frame-bl,.x-btn-default-toolbar-medium-menu-active .x-frame-tr,.x-btn-default-toolbar-medium-menu-active .x-frame-br,.x-btn-default-toolbar-medium-menu-active .x-frame-tc,.x-btn-default-toolbar-medium-menu-active .x-frame-bc,.x-btn-default-toolbar-medium-pressed .x-frame-tl,.x-btn-default-toolbar-medium-pressed .x-frame-bl,.x-btn-default-toolbar-medium-pressed .x-frame-tr,.x-btn-default-toolbar-medium-pressed .x-frame-br,.x-btn-default-toolbar-medium-pressed .x-frame-tc,.x-btn-default-toolbar-medium-pressed .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-medium-pressed-corners.gif)}.x-btn-default-toolbar-medium-menu-active .x-frame-ml,.x-btn-default-toolbar-medium-menu-active .x-frame-mr,.x-btn-default-toolbar-medium-pressed .x-frame-ml,.x-btn-default-toolbar-medium-pressed .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-medium-pressed-sides.gif)}.x-btn-default-toolbar-medium-menu-active .x-frame-mc,.x-btn-default-toolbar-medium-pressed .x-frame-mc{background-color:#bccfe5;background-image:url(images/btn/btn-default-toolbar-medium-pressed-fbg.gif)}.x-btn-default-toolbar-medium-disabled .x-frame-tl,.x-btn-default-toolbar-medium-disabled .x-frame-bl,.x-btn-default-toolbar-medium-disabled .x-frame-tr,.x-btn-default-toolbar-medium-disabled .x-frame-br,.x-btn-default-toolbar-medium-disabled .x-frame-tc,.x-btn-default-toolbar-medium-disabled .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-medium-disabled-corners.gif)}.x-btn-default-toolbar-medium-disabled .x-frame-ml,.x-btn-default-toolbar-medium-disabled .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-medium-disabled-sides.gif)}.x-btn-default-toolbar-medium-disabled .x-frame-mc{background-color:transparent}.x-nlg .x-btn-default-toolbar-medium-over{background-image:url(images/btn/btn-default-toolbar-medium-over-bg.gif)}.x-nlg .x-btn-default-toolbar-medium-focus{background-image:url(images/btn/btn-default-toolbar-medium-focus-bg.gif)}.x-nlg .x-btn-default-toolbar-medium-menu-active,.x-nlg .x-btn-default-toolbar-medium-pressed{background-image:url(images/btn/btn-default-toolbar-medium-pressed-bg.gif)}.x-nbr .x-btn-default-toolbar-medium{background-image:none}.x-btn-default-toolbar-medium .x-btn-split-right{background-image:url(images/button/s-arrow-noline.gif);padding-right:14px}.x-btn-default-toolbar-medium .x-btn-split-bottom{background-image:url(images/button/s-arrow-b-noline.gif);padding-bottom:14px}.x-btn-default-toolbar-medium-over .x-btn-split-right{background-image:url(images/button/s-arrow-o.gif)}.x-btn-default-toolbar-medium-over .x-btn-split-bottom{background-image:url(images/button/s-arrow-bo.gif)}.x-btn-default-toolbar-medium-disabled{filter:alpha(opacity=50);opacity:.5}.x-btn-default-toolbar-medium-over:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-medium-over-corners.gif), sides:url(images/btn/btn-default-toolbar-medium-over-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-medium-over-fbg.gif), bg:url(images/btn/btn-default-toolbar-medium-over-bg.gif)"}.x-btn-default-toolbar-medium-focus:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-medium-focus-corners.gif), sides:url(images/btn/btn-default-toolbar-medium-focus-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-medium-focus-fbg.gif), bg:url(images/btn/btn-default-toolbar-medium-focus-bg.gif)"}.x-btn-default-toolbar-medium-pressed:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-medium-pressed-corners.gif), sides:url(images/btn/btn-default-toolbar-medium-pressed-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-medium-pressed-fbg.gif), bg:url(images/btn/btn-default-toolbar-medium-pressed-bg.gif)"}.x-btn-default-toolbar-medium-disabled:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-medium-disabled-corners.gif), sides:url(images/btn/btn-default-toolbar-medium-disabled-sides.gif)"}.x-btn-default-toolbar-large{border-color:transparent}.x-btn-default-toolbar-large{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:3px 3px 3px 3px;border-width:1px;border-style:solid;background-color:transparent}.x-btn-default-toolbar-large-mc{background-color:transparent}.x-nbr .x-btn-default-toolbar-large{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-btn-default-toolbar-large-frameInfo{font-family:th-3-3-3-3-1-1-1-1-3-3-3-3}.x-btn-default-toolbar-large-tl{background-position:0 -6px}.x-btn-default-toolbar-large-tr{background-position:right -9px}.x-btn-default-toolbar-large-bl{background-position:0 -12px}.x-btn-default-toolbar-large-br{background-position:right -15px}.x-btn-default-toolbar-large-ml{background-position:0 top}.x-btn-default-toolbar-large-mr{background-position:right top}.x-btn-default-toolbar-large-tc{background-position:0 0}.x-btn-default-toolbar-large-bc{background-position:0 -3px}.x-btn-default-toolbar-large-tr,.x-btn-default-toolbar-large-br,.x-btn-default-toolbar-large-mr{padding-right:3px}.x-btn-default-toolbar-large-tl,.x-btn-default-toolbar-large-bl,.x-btn-default-toolbar-large-ml{padding-left:3px}.x-btn-default-toolbar-large-tc{height:3px}.x-btn-default-toolbar-large-bc{height:3px}.x-btn-default-toolbar-large-tl,.x-btn-default-toolbar-large-bl,.x-btn-default-toolbar-large-tr,.x-btn-default-toolbar-large-br,.x-btn-default-toolbar-large-tc,.x-btn-default-toolbar-large-bc,.x-btn-default-toolbar-large-ml,.x-btn-default-toolbar-large-mr{zoom:1}.x-btn-default-toolbar-large-ml,.x-btn-default-toolbar-large-mr{zoom:1}.x-btn-default-toolbar-large-mc{padding:1px 1px 1px 1px}.x-strict .x-ie7 .x-btn-default-toolbar-large-tl,.x-strict .x-ie7 .x-btn-default-toolbar-large-bl{position:relative;right:0}.x-btn-default-toolbar-large .x-btn-inner{font-size:11px;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;color:#333;padding:0 3px}.x-btn-default-toolbar-large .x-btn-arrow{background-image:url(images/button/arrow.gif)}.x-btn-default-toolbar-large .x-btn-arrow-right{padding-right:12px}.x-btn-default-toolbar-large .x-btn-arrow-bottom{padding-bottom:12px}.x-btn-default-toolbar-large .x-btn-glyph{font-size:32px;line-height:32px;color:#333;opacity:.5}.x-ie8m .x-btn-default-toolbar-large .x-btn-glyph{color:#999}.x-btn-default-toolbar-large-disabled{border-color:#e1e1e1;background-image:none;background-color:transparent}.x-btn-default-toolbar-large-disabled .x-btn-inner{color:#8c8c8c}.x-btn-default-toolbar-large-icon .x-btn-button,.x-btn-default-toolbar-large-noicon .x-btn-button{height:32px}.x-btn-default-toolbar-large-icon .x-btn-inner,.x-btn-default-toolbar-large-noicon .x-btn-inner{line-height:32px}.x-btn-default-toolbar-large-icon .x-btn-arrow-right .x-btn-inner,.x-btn-default-toolbar-large-noicon .x-btn-arrow-right .x-btn-inner,.x-btn-default-toolbar-large-icon-text-left .x-btn-arrow-right .x-btn-inner{padding-right:0}.x-btn-default-toolbar-large-icon .x-btn-inner{width:32px;padding:0}.x-btn-default-toolbar-large-icon .x-btn-icon-el{width:32px;height:32px}.x-btn-default-toolbar-large-icon-text-left .x-btn-button{height:32px}.x-btn-default-toolbar-large-icon-text-left .x-btn-inner{line-height:32px;padding-left:36px}.x-btn-default-toolbar-large-icon-text-left .x-btn-icon-el{width:32px;right:auto}.x-ie6 .x-btn-default-toolbar-large-icon-text-left .x-btn-icon-el,.x-quirks .x-btn-default-toolbar-large-icon-text-left .x-btn-icon-el{height:32px}.x-btn-default-toolbar-large-icon-text-right .x-btn-button{height:32px}.x-btn-default-toolbar-large-icon-text-right .x-btn-inner{line-height:32px;padding-right:36px}.x-btn-default-toolbar-large-icon-text-right .x-btn-icon-el{width:32px;left:auto}.x-ie6 .x-btn-default-toolbar-large-icon-text-right .x-btn-icon-el,.x-quirks .x-btn-default-toolbar-large-icon-text-right .x-btn-icon-el{height:32px}.x-btn-default-toolbar-large-icon-text-top .x-btn-inner{padding-top:36px}.x-btn-default-toolbar-large-icon-text-top .x-btn-icon-el{height:32px;bottom:auto}.x-ie6 .x-btn-default-toolbar-large-icon-text-top .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-toolbar-large-icon-text-top .x-btn-icon-el{width:100%}.x-btn-default-toolbar-large-icon-text-bottom .x-btn-inner{padding-bottom:36px}.x-btn-default-toolbar-large-icon-text-bottom .x-btn-icon-el{height:32px;top:auto}.x-ie6 .x-btn-default-toolbar-large-icon-text-bottom .x-btn-icon-el,.x-quirks .x-ie .x-btn-default-toolbar-large-icon-text-bottom .x-btn-icon-el{width:100%}.x-btn-default-toolbar-large-over{border-color:#81a4d0;background-image:none;background-color:#dbeeff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dbeeff),color-stop(48%,#d0e7ff),color-stop(52%,#bbd2f0),color-stop(100%,#bed6f5));background-image:-webkit-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-moz-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-o-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5)}.x-btn-default-toolbar-large-focus{border-color:#81a4d0;background-image:none;background-color:#dbeeff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dbeeff),color-stop(48%,#d0e7ff),color-stop(52%,#bbd2f0),color-stop(100%,#bed6f5));background-image:-webkit-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-moz-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:-o-linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5);background-image:linear-gradient(top,#dbeeff,#d0e7ff 48%,#bbd2f0 52%,#bed6f5)}.x-btn-default-toolbar-large-menu-active,.x-btn-default-toolbar-large-pressed{border-color:#7a9ac4;background-image:none;background-color:#bccfe5;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#bccfe5),color-stop(48%,#c5d6e7),color-stop(52%,#95c4f4),color-stop(100%,#9fc9f5));background-image:-webkit-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:-moz-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:-o-linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5);background-image:linear-gradient(top,#bccfe5,#c5d6e7 48%,#95c4f4 52%,#9fc9f5)}.x-btn-default-toolbar-large-over .x-frame-tl,.x-btn-default-toolbar-large-over .x-frame-bl,.x-btn-default-toolbar-large-over .x-frame-tr,.x-btn-default-toolbar-large-over .x-frame-br,.x-btn-default-toolbar-large-over .x-frame-tc,.x-btn-default-toolbar-large-over .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-large-over-corners.gif)}.x-btn-default-toolbar-large-over .x-frame-ml,.x-btn-default-toolbar-large-over .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-large-over-sides.gif)}.x-btn-default-toolbar-large-over .x-frame-mc{background-color:#dbeeff;background-image:url(images/btn/btn-default-toolbar-large-over-fbg.gif)}.x-btn-default-toolbar-large-focus .x-frame-tl,.x-btn-default-toolbar-large-focus .x-frame-bl,.x-btn-default-toolbar-large-focus .x-frame-tr,.x-btn-default-toolbar-large-focus .x-frame-br,.x-btn-default-toolbar-large-focus .x-frame-tc,.x-btn-default-toolbar-large-focus .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-large-focus-corners.gif)}.x-btn-default-toolbar-large-focus .x-frame-ml,.x-btn-default-toolbar-large-focus .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-large-focus-sides.gif)}.x-btn-default-toolbar-large-focus .x-frame-mc{background-color:#dbeeff;background-image:url(images/btn/btn-default-toolbar-large-focus-fbg.gif)}.x-btn-default-toolbar-large-menu-active .x-frame-tl,.x-btn-default-toolbar-large-menu-active .x-frame-bl,.x-btn-default-toolbar-large-menu-active .x-frame-tr,.x-btn-default-toolbar-large-menu-active .x-frame-br,.x-btn-default-toolbar-large-menu-active .x-frame-tc,.x-btn-default-toolbar-large-menu-active .x-frame-bc,.x-btn-default-toolbar-large-pressed .x-frame-tl,.x-btn-default-toolbar-large-pressed .x-frame-bl,.x-btn-default-toolbar-large-pressed .x-frame-tr,.x-btn-default-toolbar-large-pressed .x-frame-br,.x-btn-default-toolbar-large-pressed .x-frame-tc,.x-btn-default-toolbar-large-pressed .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-large-pressed-corners.gif)}.x-btn-default-toolbar-large-menu-active .x-frame-ml,.x-btn-default-toolbar-large-menu-active .x-frame-mr,.x-btn-default-toolbar-large-pressed .x-frame-ml,.x-btn-default-toolbar-large-pressed .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-large-pressed-sides.gif)}.x-btn-default-toolbar-large-menu-active .x-frame-mc,.x-btn-default-toolbar-large-pressed .x-frame-mc{background-color:#bccfe5;background-image:url(images/btn/btn-default-toolbar-large-pressed-fbg.gif)}.x-btn-default-toolbar-large-disabled .x-frame-tl,.x-btn-default-toolbar-large-disabled .x-frame-bl,.x-btn-default-toolbar-large-disabled .x-frame-tr,.x-btn-default-toolbar-large-disabled .x-frame-br,.x-btn-default-toolbar-large-disabled .x-frame-tc,.x-btn-default-toolbar-large-disabled .x-frame-bc{background-image:url(images/btn/btn-default-toolbar-large-disabled-corners.gif)}.x-btn-default-toolbar-large-disabled .x-frame-ml,.x-btn-default-toolbar-large-disabled .x-frame-mr{background-image:url(images/btn/btn-default-toolbar-large-disabled-sides.gif)}.x-btn-default-toolbar-large-disabled .x-frame-mc{background-color:transparent}.x-nlg .x-btn-default-toolbar-large-over{background-image:url(images/btn/btn-default-toolbar-large-over-bg.gif)}.x-nlg .x-btn-default-toolbar-large-focus{background-image:url(images/btn/btn-default-toolbar-large-focus-bg.gif)}.x-nlg .x-btn-default-toolbar-large-menu-active,.x-nlg .x-btn-default-toolbar-large-pressed{background-image:url(images/btn/btn-default-toolbar-large-pressed-bg.gif)}.x-nbr .x-btn-default-toolbar-large{background-image:none}.x-btn-default-toolbar-large .x-btn-split-right{background-image:url(images/button/s-arrow-noline.gif);padding-right:14px}.x-btn-default-toolbar-large .x-btn-split-bottom{background-image:url(images/button/s-arrow-b-noline.gif);padding-bottom:14px}.x-btn-default-toolbar-large-over .x-btn-split-right{background-image:url(images/button/s-arrow-o.gif)}.x-btn-default-toolbar-large-over .x-btn-split-bottom{background-image:url(images/button/s-arrow-bo.gif)}.x-btn-default-toolbar-large-disabled{filter:alpha(opacity=50);opacity:.5}.x-btn-default-toolbar-large-over:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-large-over-corners.gif), sides:url(images/btn/btn-default-toolbar-large-over-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-large-over-fbg.gif), bg:url(images/btn/btn-default-toolbar-large-over-bg.gif)"}.x-btn-default-toolbar-large-focus:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-large-focus-corners.gif), sides:url(images/btn/btn-default-toolbar-large-focus-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-large-focus-fbg.gif), bg:url(images/btn/btn-default-toolbar-large-focus-bg.gif)"}.x-btn-default-toolbar-large-pressed:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-large-pressed-corners.gif), sides:url(images/btn/btn-default-toolbar-large-pressed-sides.gif), frame-bg:url(images/btn/btn-default-toolbar-large-pressed-fbg.gif), bg:url(images/btn/btn-default-toolbar-large-pressed-bg.gif)"}.x-btn-default-toolbar-large-disabled:after{display:none;content:"x-slicer:stretch:bottom, corners:url(images/btn/btn-default-toolbar-large-disabled-corners.gif), sides:url(images/btn/btn-default-toolbar-large-disabled-sides.gif)"}.x-btn-icon-text-left .x-btn-icon-el{background-position:left center}.x-btn-icon-text-right .x-btn-icon-el{background-position:right center}.x-btn-icon-text-top .x-btn-icon-el{background-position:center top}.x-btn-icon-text-bottom .x-btn-icon-el{background-position:center bottom}.x-btn-arrow-right{background-position:right center}.x-btn-arrow-bottom{background-position:center bottom}.x-btn-arrow{background-repeat:no-repeat}.x-btn-split{display:block;background-repeat:no-repeat}.x-btn-split-right{background-position:right center}.x-btn-split-bottom{background-position:center bottom}.x-cycle-fixed-width .x-btn-inner{text-align:inherit}.x-toolbar{font-size:11px;border-style:solid;padding:2px 0 2px 2px}.x-toolbar-item{margin:0 2px 0 0}.x-toolbar-text{margin:0 6px 0 4px;color:#4c4c4c;line-height:16px;font-family:tahoma,arial,verdana,sans-serif;font-size:11px;font-weight:normal}.x-toolbar-separator-horizontal{margin:0 2px 0 0;height:14px;border-style:solid;border-width:0 1px;border-left-color:#98c8ff;border-right-color:white}.x-toolbar-footer{background:transparent;border:0;margin:3px 0 0;padding:2px 0 2px 6px}.x-toolbar-footer .x-toolbar-item{margin:0 6px 0 0}.x-toolbar-spacer{width:2px}.x-toolbar-more-icon{background-image:url(images/toolbar/more.gif)!important;background-position:center center!important;background-repeat:no-repeat}.x-toolbar-default{border-color:#99bce8;border-width:1px;background-image:none;background-color:#d3e1f1;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dfe9f5),color-stop(100%,#d3e1f1));background-image:-webkit-linear-gradient(top,#dfe9f5,#d3e1f1);background-image:-moz-linear-gradient(top,#dfe9f5,#d3e1f1);background-image:-o-linear-gradient(top,#dfe9f5,#d3e1f1);background-image:linear-gradient(top,#dfe9f5,#d3e1f1)}.x-toolbar-default .x-box-scroller{cursor:pointer}.x-toolbar-default .x-box-scroller-disabled{filter:alpha(opacity=50);opacity:.5;cursor:default}.x-nlg .x-toolbar-default{background-image:url(images/toolbar/toolbar-default-bg.gif)!important;background-repeat:repeat-x}.x-toolbar-default:after{display:none;content:"x-slicer:bg:url(images/toolbar/toolbar-default-bg.gif), stretch:bottom"}.x-toolbar-scroll-left{background-image:url(images/toolbar/scroll-left.gif);background-position:-14px 0;width:14px;height:22px;border-style:solid;border-color:#8db2e3;border-width:0 0 1px;margin-top:0}.x-toolbar-scroll-left-hover{background-position:0 0}.x-toolbar-scroll-right{background-image:url(images/toolbar/scroll-right.gif);width:14px;height:22px;border-style:solid;border-color:#8db2e3;border-width:0 0 1px;margin-top:0}.x-toolbar-scroll-right-hover{background-position:-14px 0}.x-toolbar .x-box-menu-after{margin:0 2px 0 2px}.x-toolbar-vertical{padding:2px 2px 0 2px}.x-toolbar-vertical .x-toolbar-item{margin:0 0 2px 0}.x-toolbar-vertical .x-toolbar-text{margin:4px 0 6px 0}.x-toolbar-vertical .x-toolbar-separator-vertical{margin:0 5px 2px;border-style:solid none;border-width:1px 0;border-top-color:#98c8ff;border-bottom-color:white}.x-toolbar-vertical .x-box-menu-after,.x-toolbar-vertical .x-rtl.x-box-menu-after{margin:2px 0 2px 0;display:block;float:none}.x-header-draggable .x-header-body,.x-header-ghost{cursor:move}.x-header-text{white-space:nowrap}.x-panel-ghost{filter:alpha(opacity=65);opacity:.65}.x-panel-default{border-color:#99bce8;padding:0}.x-panel-header-default{font-size:11px;border:1px solid #99bce8}.x-panel-header-default-horizontal{padding:4px 5px 4px 5px}.x-panel-header-default-horizontal-noborder{padding:5px 6px 4px 6px}.x-panel-header-default-vertical{padding:5px 4px 5px 4px}.x-panel-header-default-vertical-noborder{padding:6px 5px 6px 4px}.x-panel-header-text-container-default{color:#04408c;font-size:11px;font-weight:bold;font-family:tahoma,arial,verdana,sans-serif;line-height:15px;padding:0 2px 1px;text-transform:none}.x-panel-body-default{background:white;border-color:#99bce8;color:black;font-size:12px;font-size:normal;border-width:1px;border-style:solid}.x-panel-header-default{background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-vertical{background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,100% 50%,0% 50%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-nlg .x-panel-header-default-top{background:url(images/panel-header/panel-header-default-top-bg.gif)}.x-nlg .x-panel-header-default-bottom{background:url(images/panel-header/panel-header-default-bottom-bg.gif)}.x-nlg .x-panel-header-default-left{background:url(images/panel-header/panel-header-default-left-bg.gif) top right}.x-nlg .x-panel-header-default-right{background:url(images/panel-header/panel-header-default-right-bg.gif) top right}.x-panel .x-panel-header-default-collapsed-border-top{border-bottom-width:1px!important}.x-panel .x-panel-header-default-collapsed-border-right{border-left-width:1px!important}.x-panel .x-panel-header-default-collapsed-border-bottom{border-top-width:1px!important}.x-panel .x-panel-header-default-collapsed-border-left{border-right-width:1px!important}.x-panel-header-default-top:after{display:none;content:"x-slicer:bg:url(images/panel-header/panel-header-default-top-bg.gif), stretch:bottom"}.x-panel-header-default-bottom:after{display:none;content:"x-slicer:bg:url(images/panel-header/panel-header-default-bottom-bg.gif), stretch:bottom"}.x-panel-header-default-left:after{display:none;content:"x-slicer:bg:url(images/panel-header/panel-header-default-left-bg.gif), stretch:left"}.x-panel-header-default-right:after{display:none;content:"x-slicer:bg:url(images/panel-header/panel-header-default-right-bg.gif), stretch:left"}.x-panel-header-default-vertical .x-panel-header-text-container{-webkit-transform:rotate(90deg);-webkit-transform-origin:0 0;-moz-transform:rotate(90deg);-moz-transform-origin:0 0;-o-transform:rotate(90deg);-o-transform-origin:0 0;transform:rotate(90deg);transform-origin:0 0}.x-ie9m .x-panel-header-default-vertical .x-panel-header-text-container{background-color:#cbddf3;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1),progid:DXImageTransform.Microsoft.Chroma(color=#cbddf3)}.x-panel-header-default-top{-webkit-box-shadow:#f3f7fb 0 1px 0 0 inset;-moz-box-shadow:#f3f7fb 0 1px 0 0 inset;box-shadow:#f3f7fb 0 1px 0 0 inset}.x-panel-header-default-right{-webkit-box-shadow:#f3f7fb -1px 0 0 0 inset;-moz-box-shadow:#f3f7fb -1px 0 0 0 inset;box-shadow:#f3f7fb -1px 0 0 0 inset}.x-panel-header-default-bottom{-webkit-box-shadow:#f3f7fb 0 -1px 0 0 inset;-moz-box-shadow:#f3f7fb 0 -1px 0 0 inset;box-shadow:#f3f7fb 0 -1px 0 0 inset}.x-panel-header-default-left{-webkit-box-shadow:#f3f7fb 1px 0 0 0 inset;-moz-box-shadow:#f3f7fb 1px 0 0 0 inset;box-shadow:#f3f7fb 1px 0 0 0 inset}.x-panel-header-default .x-panel-header-icon{width:16px;height:16px;background-position:center center}.x-panel-header-default .x-panel-header-glyph{color:#04408c;font-size:16px;line-height:16px;opacity:.5}.x-ie8m .x-panel-header-default .x-panel-header-glyph{color:#678ebf}.x-panel-header-default-horizontal .x-panel-header-icon-before-title{margin:0 2px 0 0}.x-panel-header-default-horizontal .x-panel-header-icon-after-title{margin:0 0 0 2px}.x-panel-header-default-vertical .x-panel-header-icon-before-title{margin:0 0 2px 0}.x-panel-header-default-vertical .x-panel-header-icon-after-title{margin:2px 0 0 0}.x-panel-header-default-horizontal .x-tool-after-title{margin:0 0 0 2px}.x-panel-header-default-horizontal .x-tool-before-title{margin:0 2px 0 0}.x-panel-header-default-vertical .x-tool-after-title{margin:2px 0 0 0}.x-panel-header-default-vertical .x-tool-before-title{margin:0 0 2px 0}.x-panel-default-resizable .x-panel-handle{filter:alpha(opacity=0);opacity:0}.x-panel-default-framed{border-color:#99bce8;padding:4px}.x-panel-header-default-framed{font-size:11px;border:1px solid #99bce8}.x-panel-header-default-framed-horizontal{padding:4px 5px 4px 5px}.x-panel-header-default-framed-horizontal-noborder{padding:5px 6px 4px 6px}.x-panel-header-default-framed-vertical{padding:5px 4px 5px 4px}.x-panel-header-default-framed-vertical-noborder{padding:6px 5px 6px 4px}.x-panel-header-text-container-default-framed{color:#04408c;font-size:11px;font-weight:bold;font-family:tahoma,arial,verdana,sans-serif;line-height:15px;padding:0 2px 1px;text-transform:none}.x-panel-body-default-framed{background:#dfe9f6;border-color:#99bce8;color:black;font-size:12px;font-size:normal;border-width:0;border-style:solid}.x-panel-default-framed{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;padding:4px 4px 4px 4px;border-width:1px;border-style:solid;background-color:#dfe9f6}.x-panel-default-framed-mc{background-color:#dfe9f6}.x-nbr .x-panel-default-framed{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-panel-default-framed-frameInfo{font-family:dh-4-4-4-4-1-1-1-1-4-4-4-4}.x-panel-default-framed-tl{background-position:0 -8px}.x-panel-default-framed-tr{background-position:right -12px}.x-panel-default-framed-bl{background-position:0 -16px}.x-panel-default-framed-br{background-position:right -20px}.x-panel-default-framed-ml{background-position:0 top}.x-panel-default-framed-mr{background-position:right top}.x-panel-default-framed-tc{background-position:0 0}.x-panel-default-framed-bc{background-position:0 -4px}.x-panel-default-framed-tr,.x-panel-default-framed-br,.x-panel-default-framed-mr{padding-right:4px}.x-panel-default-framed-tl,.x-panel-default-framed-bl,.x-panel-default-framed-ml{padding-left:4px}.x-panel-default-framed-tc{height:4px}.x-panel-default-framed-bc{height:4px}.x-panel-default-framed-tl,.x-panel-default-framed-bl,.x-panel-default-framed-tr,.x-panel-default-framed-br,.x-panel-default-framed-tc,.x-panel-default-framed-bc,.x-panel-default-framed-ml,.x-panel-default-framed-mr{zoom:1;background-image:url(images/panel/panel-default-framed-corners.gif)}.x-panel-default-framed-ml,.x-panel-default-framed-mr{zoom:1;background-image:url(images/panel/panel-default-framed-sides.gif);background-repeat:repeat-y}.x-panel-default-framed-mc{padding:1px 1px 1px 1px}.x-strict .x-ie7 .x-panel-default-framed-tl,.x-strict .x-ie7 .x-panel-default-framed-bl{position:relative;right:0}.x-panel-default-framed:after{display:none;content:"x-slicer:corners:url(images/panel/panel-default-framed-corners.gif), sides:url(images/panel/panel-default-framed-sides.gif)"}.x-panel-header-default-framed-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:4px 5px 4px 5px;border-width:1px 1px 0 1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-top-mc{background-image:url(images/panel-header/panel-header-default-framed-top-fbg.gif);background-position:0 top;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-top{background-image:url(images/panel-header/panel-header-default-framed-top-bg.gif);background-position:0 top}.x-nbr .x-panel-header-default-framed-top{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-top-frameInfo{font-family:dh-4-4-0-0-1-1-0-1-4-5-4-5}.x-panel-header-default-framed-top-tl{background-position:0 -8px}.x-panel-header-default-framed-top-tr{background-position:right -12px}.x-panel-header-default-framed-top-bl{background-position:0 -16px}.x-panel-header-default-framed-top-br{background-position:right -20px}.x-panel-header-default-framed-top-ml{background-position:0 top}.x-panel-header-default-framed-top-mr{background-position:right top}.x-panel-header-default-framed-top-tc{background-position:0 0}.x-panel-header-default-framed-top-bc{background-position:0 -4px}.x-panel-header-default-framed-top-tr,.x-panel-header-default-framed-top-br,.x-panel-header-default-framed-top-mr{padding-right:4px}.x-panel-header-default-framed-top-tl,.x-panel-header-default-framed-top-bl,.x-panel-header-default-framed-top-ml{padding-left:4px}.x-panel-header-default-framed-top-tc{height:4px}.x-panel-header-default-framed-top-bc{height:0}.x-panel-header-default-framed-top-tl,.x-panel-header-default-framed-top-bl,.x-panel-header-default-framed-top-tr,.x-panel-header-default-framed-top-br,.x-panel-header-default-framed-top-tc,.x-panel-header-default-framed-top-bc,.x-panel-header-default-framed-top-ml,.x-panel-header-default-framed-top-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-top-corners.gif)}.x-panel-header-default-framed-top-ml,.x-panel-header-default-framed-top-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-top-sides.gif)}.x-panel-header-default-framed-top-mc{padding:1px 2px 4px 2px}.x-strict .x-ie7 .x-panel-header-default-framed-top-tl,.x-strict .x-ie7 .x-panel-header-default-framed-top-bl{position:relative;right:0}.x-panel-header-default-framed-top:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/panel-header/panel-header-default-framed-top-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-top-bg.gif), corners:url(images/panel-header/panel-header-default-framed-top-corners.gif), sides:url(images/panel-header/panel-header-default-framed-top-sides.gif)"}.x-panel-header-default-framed-right{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:5px 4px 5px 4px;border-width:1px 1px 1px 0;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,100% 50%,0% 50%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-right-mc{background-image:url(images/panel-header/panel-header-default-framed-right-fbg.gif);background-position:right 0;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-right{background-image:url(images/panel-header/panel-header-default-framed-right-bg.gif);background-position:right 0}.x-nbr .x-panel-header-default-framed-right{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-right-frameInfo{font-family:dv-0-4-4-0-1-1-1-0-5-4-5-4}.x-panel-header-default-framed-right-tl{background-position:0 0}.x-panel-header-default-framed-right-tr{background-position:0 -4px}.x-panel-header-default-framed-right-bl{background-position:0 -8px}.x-panel-header-default-framed-right-br{background-position:0 -12px}.x-panel-header-default-framed-right-ml{background-position:-4px 0}.x-panel-header-default-framed-right-mr{background-position:right 0}.x-panel-header-default-framed-right-tc{background-position:right 0}.x-panel-header-default-framed-right-bc{background-position:right -4px}.x-panel-header-default-framed-right-tr,.x-panel-header-default-framed-right-br,.x-panel-header-default-framed-right-mr{padding-right:4px}.x-panel-header-default-framed-right-tl,.x-panel-header-default-framed-right-bl,.x-panel-header-default-framed-right-ml{padding-left:0}.x-panel-header-default-framed-right-tc{height:4px}.x-panel-header-default-framed-right-bc{height:4px}.x-panel-header-default-framed-right-tl,.x-panel-header-default-framed-right-bl,.x-panel-header-default-framed-right-tr,.x-panel-header-default-framed-right-br,.x-panel-header-default-framed-right-tc,.x-panel-header-default-framed-right-bc,.x-panel-header-default-framed-right-ml,.x-panel-header-default-framed-right-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-right-corners.gif)}.x-panel-header-default-framed-right-tc,.x-panel-header-default-framed-right-bc{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-right-sides.gif);background-repeat:repeat-x}.x-panel-header-default-framed-right-mc{padding:2px 1px 2px 4px}.x-strict .x-ie7 .x-panel-header-default-framed-right-tl,.x-strict .x-ie7 .x-panel-header-default-framed-right-bl{position:relative;right:0}.x-panel-header-default-framed-right:after{display:none;content:"x-slicer:stretch:left, frame-bg:url(images/panel-header/panel-header-default-framed-right-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-right-bg.gif), corners:url(images/panel-header/panel-header-default-framed-right-corners.gif), sides:url(images/panel-header/panel-header-default-framed-right-sides.gif)"}.x-panel-header-default-framed-bottom{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:4px 5px 4px 5px;border-width:0 1px 1px 1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-bottom-mc{background-image:url(images/panel-header/panel-header-default-framed-bottom-fbg.gif);background-position:0 bottom;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-bottom{background-image:url(images/panel-header/panel-header-default-framed-bottom-bg.gif);background-position:0 bottom}.x-nbr .x-panel-header-default-framed-bottom{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-bottom-frameInfo{font-family:dh-0-0-4-4-0-1-1-1-4-5-4-5}.x-panel-header-default-framed-bottom-tl{background-position:0 -8px}.x-panel-header-default-framed-bottom-tr{background-position:right -12px}.x-panel-header-default-framed-bottom-bl{background-position:0 -16px}.x-panel-header-default-framed-bottom-br{background-position:right -20px}.x-panel-header-default-framed-bottom-ml{background-position:0 bottom}.x-panel-header-default-framed-bottom-mr{background-position:right bottom}.x-panel-header-default-framed-bottom-tc{background-position:0 0}.x-panel-header-default-framed-bottom-bc{background-position:0 -4px}.x-panel-header-default-framed-bottom-tr,.x-panel-header-default-framed-bottom-br,.x-panel-header-default-framed-bottom-mr{padding-right:4px}.x-panel-header-default-framed-bottom-tl,.x-panel-header-default-framed-bottom-bl,.x-panel-header-default-framed-bottom-ml{padding-left:4px}.x-panel-header-default-framed-bottom-tc{height:0}.x-panel-header-default-framed-bottom-bc{height:4px}.x-panel-header-default-framed-bottom-tl,.x-panel-header-default-framed-bottom-bl,.x-panel-header-default-framed-bottom-tr,.x-panel-header-default-framed-bottom-br,.x-panel-header-default-framed-bottom-tc,.x-panel-header-default-framed-bottom-bc,.x-panel-header-default-framed-bottom-ml,.x-panel-header-default-framed-bottom-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-bottom-corners.gif)}.x-panel-header-default-framed-bottom-ml,.x-panel-header-default-framed-bottom-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-bottom-sides.gif)}.x-panel-header-default-framed-bottom-mc{padding:4px 2px 1px 2px}.x-strict .x-ie7 .x-panel-header-default-framed-bottom-tl,.x-strict .x-ie7 .x-panel-header-default-framed-bottom-bl{position:relative;right:0}.x-panel-header-default-framed-bottom:after{display:none;content:"x-slicer:stretch:top, frame-bg:url(images/panel-header/panel-header-default-framed-bottom-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-bottom-bg.gif), corners:url(images/panel-header/panel-header-default-framed-bottom-corners.gif), sides:url(images/panel-header/panel-header-default-framed-bottom-sides.gif)"}.x-panel-header-default-framed-left{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:5px 4px 5px 4px;border-width:1px 0 1px 1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,100% 50%,0% 50%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-left-mc{background-image:url(images/panel-header/panel-header-default-framed-left-fbg.gif);background-position:left 0;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-left{background-image:url(images/panel-header/panel-header-default-framed-left-bg.gif);background-position:left 0}.x-nbr .x-panel-header-default-framed-left{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-left-frameInfo{font-family:dv-4-0-0-4-1-0-1-1-5-4-5-4}.x-panel-header-default-framed-left-tl{background-position:0 0}.x-panel-header-default-framed-left-tr{background-position:0 -4px}.x-panel-header-default-framed-left-bl{background-position:0 -8px}.x-panel-header-default-framed-left-br{background-position:0 -12px}.x-panel-header-default-framed-left-ml{background-position:-4px 0}.x-panel-header-default-framed-left-mr{background-position:right 0}.x-panel-header-default-framed-left-tc{background-position:left 0}.x-panel-header-default-framed-left-bc{background-position:left -4px}.x-panel-header-default-framed-left-tr,.x-panel-header-default-framed-left-br,.x-panel-header-default-framed-left-mr{padding-right:0}.x-panel-header-default-framed-left-tl,.x-panel-header-default-framed-left-bl,.x-panel-header-default-framed-left-ml{padding-left:4px}.x-panel-header-default-framed-left-tc{height:4px}.x-panel-header-default-framed-left-bc{height:4px}.x-panel-header-default-framed-left-tl,.x-panel-header-default-framed-left-bl,.x-panel-header-default-framed-left-tr,.x-panel-header-default-framed-left-br,.x-panel-header-default-framed-left-tc,.x-panel-header-default-framed-left-bc,.x-panel-header-default-framed-left-ml,.x-panel-header-default-framed-left-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-left-corners.gif)}.x-panel-header-default-framed-left-tc,.x-panel-header-default-framed-left-bc{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-left-sides.gif);background-repeat:repeat-x}.x-panel-header-default-framed-left-mc{padding:2px 4px 2px 1px}.x-strict .x-ie7 .x-panel-header-default-framed-left-tl,.x-strict .x-ie7 .x-panel-header-default-framed-left-bl{position:relative;right:0}.x-panel-header-default-framed-left:after{display:none;content:"x-slicer:stretch:right, frame-bg:url(images/panel-header/panel-header-default-framed-left-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-left-bg.gif), corners:url(images/panel-header/panel-header-default-framed-left-corners.gif), sides:url(images/panel-header/panel-header-default-framed-left-sides.gif)"}.x-panel-header-default-framed-collapsed-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:4px 5px 4px 5px;border-width:1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-collapsed-top-mc{background-image:url(images/panel-header/panel-header-default-framed-collapsed-top-fbg.gif);background-position:0 top;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-collapsed-top{background-image:url(images/panel-header/panel-header-default-framed-collapsed-top-bg.gif);background-position:0 top}.x-nbr .x-panel-header-default-framed-collapsed-top{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-collapsed-top-frameInfo{font-family:dh-4-4-4-4-1-1-1-1-4-5-4-5}.x-panel-header-default-framed-collapsed-top-tl{background-position:0 -8px}.x-panel-header-default-framed-collapsed-top-tr{background-position:right -12px}.x-panel-header-default-framed-collapsed-top-bl{background-position:0 -16px}.x-panel-header-default-framed-collapsed-top-br{background-position:right -20px}.x-panel-header-default-framed-collapsed-top-ml{background-position:0 top}.x-panel-header-default-framed-collapsed-top-mr{background-position:right top}.x-panel-header-default-framed-collapsed-top-tc{background-position:0 0}.x-panel-header-default-framed-collapsed-top-bc{background-position:0 -4px}.x-panel-header-default-framed-collapsed-top-tr,.x-panel-header-default-framed-collapsed-top-br,.x-panel-header-default-framed-collapsed-top-mr{padding-right:4px}.x-panel-header-default-framed-collapsed-top-tl,.x-panel-header-default-framed-collapsed-top-bl,.x-panel-header-default-framed-collapsed-top-ml{padding-left:4px}.x-panel-header-default-framed-collapsed-top-tc{height:4px}.x-panel-header-default-framed-collapsed-top-bc{height:4px}.x-panel-header-default-framed-collapsed-top-tl,.x-panel-header-default-framed-collapsed-top-bl,.x-panel-header-default-framed-collapsed-top-tr,.x-panel-header-default-framed-collapsed-top-br,.x-panel-header-default-framed-collapsed-top-tc,.x-panel-header-default-framed-collapsed-top-bc,.x-panel-header-default-framed-collapsed-top-ml,.x-panel-header-default-framed-collapsed-top-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-top-corners.gif)}.x-panel-header-default-framed-collapsed-top-ml,.x-panel-header-default-framed-collapsed-top-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-top-sides.gif)}.x-panel-header-default-framed-collapsed-top-mc{padding:1px 2px 1px 2px}.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-top-tl,.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-top-bl{position:relative;right:0}.x-panel-header-default-framed-collapsed-top:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/panel-header/panel-header-default-framed-collapsed-top-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-collapsed-top-bg.gif), corners:url(images/panel-header/panel-header-default-framed-collapsed-top-corners.gif), sides:url(images/panel-header/panel-header-default-framed-collapsed-top-sides.gif)"}.x-panel-header-default-framed-collapsed-right{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:5px 4px 5px 4px;border-width:1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,100% 50%,0% 50%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-collapsed-right-mc{background-image:url(images/panel-header/panel-header-default-framed-collapsed-right-fbg.gif);background-position:right 0;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-collapsed-right{background-image:url(images/panel-header/panel-header-default-framed-collapsed-right-bg.gif);background-position:right 0}.x-nbr .x-panel-header-default-framed-collapsed-right{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-collapsed-right-frameInfo{font-family:dv-4-4-4-4-1-1-1-1-5-4-5-4}.x-panel-header-default-framed-collapsed-right-tl{background-position:0 0}.x-panel-header-default-framed-collapsed-right-tr{background-position:0 -4px}.x-panel-header-default-framed-collapsed-right-bl{background-position:0 -8px}.x-panel-header-default-framed-collapsed-right-br{background-position:0 -12px}.x-panel-header-default-framed-collapsed-right-ml{background-position:-4px 0}.x-panel-header-default-framed-collapsed-right-mr{background-position:right 0}.x-panel-header-default-framed-collapsed-right-tc{background-position:right 0}.x-panel-header-default-framed-collapsed-right-bc{background-position:right -4px}.x-panel-header-default-framed-collapsed-right-tr,.x-panel-header-default-framed-collapsed-right-br,.x-panel-header-default-framed-collapsed-right-mr{padding-right:4px}.x-panel-header-default-framed-collapsed-right-tl,.x-panel-header-default-framed-collapsed-right-bl,.x-panel-header-default-framed-collapsed-right-ml{padding-left:4px}.x-panel-header-default-framed-collapsed-right-tc{height:4px}.x-panel-header-default-framed-collapsed-right-bc{height:4px}.x-panel-header-default-framed-collapsed-right-tl,.x-panel-header-default-framed-collapsed-right-bl,.x-panel-header-default-framed-collapsed-right-tr,.x-panel-header-default-framed-collapsed-right-br,.x-panel-header-default-framed-collapsed-right-tc,.x-panel-header-default-framed-collapsed-right-bc,.x-panel-header-default-framed-collapsed-right-ml,.x-panel-header-default-framed-collapsed-right-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-right-corners.gif)}.x-panel-header-default-framed-collapsed-right-tc,.x-panel-header-default-framed-collapsed-right-bc{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-right-sides.gif);background-repeat:repeat-x}.x-panel-header-default-framed-collapsed-right-mc{padding:2px 1px 2px 1px}.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-right-tl,.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-right-bl{position:relative;right:0}.x-panel-header-default-framed-collapsed-right:after{display:none;content:"x-slicer:stretch:left, frame-bg:url(images/panel-header/panel-header-default-framed-collapsed-right-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-collapsed-right-bg.gif), corners:url(images/panel-header/panel-header-default-framed-collapsed-right-corners.gif), sides:url(images/panel-header/panel-header-default-framed-collapsed-right-sides.gif)"}.x-panel-header-default-framed-collapsed-bottom{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:4px 5px 4px 5px;border-width:1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(top,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-collapsed-bottom-mc{background-image:url(images/panel-header/panel-header-default-framed-collapsed-bottom-fbg.gif);background-position:0 bottom;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-collapsed-bottom{background-image:url(images/panel-header/panel-header-default-framed-collapsed-bottom-bg.gif);background-position:0 bottom}.x-nbr .x-panel-header-default-framed-collapsed-bottom{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-collapsed-bottom-frameInfo{font-family:dh-4-4-4-4-1-1-1-1-4-5-4-5}.x-panel-header-default-framed-collapsed-bottom-tl{background-position:0 -8px}.x-panel-header-default-framed-collapsed-bottom-tr{background-position:right -12px}.x-panel-header-default-framed-collapsed-bottom-bl{background-position:0 -16px}.x-panel-header-default-framed-collapsed-bottom-br{background-position:right -20px}.x-panel-header-default-framed-collapsed-bottom-ml{background-position:0 bottom}.x-panel-header-default-framed-collapsed-bottom-mr{background-position:right bottom}.x-panel-header-default-framed-collapsed-bottom-tc{background-position:0 0}.x-panel-header-default-framed-collapsed-bottom-bc{background-position:0 -4px}.x-panel-header-default-framed-collapsed-bottom-tr,.x-panel-header-default-framed-collapsed-bottom-br,.x-panel-header-default-framed-collapsed-bottom-mr{padding-right:4px}.x-panel-header-default-framed-collapsed-bottom-tl,.x-panel-header-default-framed-collapsed-bottom-bl,.x-panel-header-default-framed-collapsed-bottom-ml{padding-left:4px}.x-panel-header-default-framed-collapsed-bottom-tc{height:4px}.x-panel-header-default-framed-collapsed-bottom-bc{height:4px}.x-panel-header-default-framed-collapsed-bottom-tl,.x-panel-header-default-framed-collapsed-bottom-bl,.x-panel-header-default-framed-collapsed-bottom-tr,.x-panel-header-default-framed-collapsed-bottom-br,.x-panel-header-default-framed-collapsed-bottom-tc,.x-panel-header-default-framed-collapsed-bottom-bc,.x-panel-header-default-framed-collapsed-bottom-ml,.x-panel-header-default-framed-collapsed-bottom-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-bottom-corners.gif)}.x-panel-header-default-framed-collapsed-bottom-ml,.x-panel-header-default-framed-collapsed-bottom-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-bottom-sides.gif)}.x-panel-header-default-framed-collapsed-bottom-mc{padding:1px 2px 1px 2px}.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-bottom-tl,.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-bottom-bl{position:relative;right:0}.x-panel-header-default-framed-collapsed-bottom:after{display:none;content:"x-slicer:stretch:top, frame-bg:url(images/panel-header/panel-header-default-framed-collapsed-bottom-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-collapsed-bottom-bg.gif), corners:url(images/panel-header/panel-header-default-framed-collapsed-bottom-corners.gif), sides:url(images/panel-header/panel-header-default-framed-collapsed-bottom-sides.gif)"}.x-panel-header-default-framed-collapsed-left{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:5px 4px 5px 4px;border-width:1px;border-style:solid;background-image:none;background-color:#cbddf3;background-image:-webkit-gradient(linear,100% 50%,0% 50%,color-stop(0%,#dae7f6),color-stop(45%,#cddef3),color-stop(46%,#abc7ec),color-stop(50%,#abc7ec),color-stop(51%,#b8cfee),color-stop(100%,#cbddf3));background-image:-webkit-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-moz-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:-o-linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3);background-image:linear-gradient(right,#dae7f6,#cddef3 45%,#abc7ec 46%,#abc7ec 50%,#b8cfee 51%,#cbddf3)}.x-panel-header-default-framed-collapsed-left-mc{background-image:url(images/panel-header/panel-header-default-framed-collapsed-left-fbg.gif);background-position:left 0;background-color:#cbddf3}.x-nlg .x-panel-header-default-framed-collapsed-left{background-image:url(images/panel-header/panel-header-default-framed-collapsed-left-bg.gif);background-position:left 0}.x-nbr .x-panel-header-default-framed-collapsed-left{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-panel-header-default-framed-collapsed-left-frameInfo{font-family:dv-4-4-4-4-1-1-1-1-5-4-5-4}.x-panel-header-default-framed-collapsed-left-tl{background-position:0 0}.x-panel-header-default-framed-collapsed-left-tr{background-position:0 -4px}.x-panel-header-default-framed-collapsed-left-bl{background-position:0 -8px}.x-panel-header-default-framed-collapsed-left-br{background-position:0 -12px}.x-panel-header-default-framed-collapsed-left-ml{background-position:-4px 0}.x-panel-header-default-framed-collapsed-left-mr{background-position:right 0}.x-panel-header-default-framed-collapsed-left-tc{background-position:left 0}.x-panel-header-default-framed-collapsed-left-bc{background-position:left -4px}.x-panel-header-default-framed-collapsed-left-tr,.x-panel-header-default-framed-collapsed-left-br,.x-panel-header-default-framed-collapsed-left-mr{padding-right:4px}.x-panel-header-default-framed-collapsed-left-tl,.x-panel-header-default-framed-collapsed-left-bl,.x-panel-header-default-framed-collapsed-left-ml{padding-left:4px}.x-panel-header-default-framed-collapsed-left-tc{height:4px}.x-panel-header-default-framed-collapsed-left-bc{height:4px}.x-panel-header-default-framed-collapsed-left-tl,.x-panel-header-default-framed-collapsed-left-bl,.x-panel-header-default-framed-collapsed-left-tr,.x-panel-header-default-framed-collapsed-left-br,.x-panel-header-default-framed-collapsed-left-tc,.x-panel-header-default-framed-collapsed-left-bc,.x-panel-header-default-framed-collapsed-left-ml,.x-panel-header-default-framed-collapsed-left-mr{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-left-corners.gif)}.x-panel-header-default-framed-collapsed-left-tc,.x-panel-header-default-framed-collapsed-left-bc{zoom:1;background-image:url(images/panel-header/panel-header-default-framed-collapsed-left-sides.gif);background-repeat:repeat-x}.x-panel-header-default-framed-collapsed-left-mc{padding:2px 1px 2px 1px}.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-left-tl,.x-strict .x-ie7 .x-panel-header-default-framed-collapsed-left-bl{position:relative;right:0}.x-panel-header-default-framed-collapsed-left:after{display:none;content:"x-slicer:stretch:right, frame-bg:url(images/panel-header/panel-header-default-framed-collapsed-left-fbg.gif), bg:url(images/panel-header/panel-header-default-framed-collapsed-left-bg.gif), corners:url(images/panel-header/panel-header-default-framed-collapsed-left-corners.gif), sides:url(images/panel-header/panel-header-default-framed-collapsed-left-sides.gif)"}.x-panel .x-panel-header-default-framed-top{border-bottom-width:1px!important}.x-panel .x-panel-header-default-framed-right{border-left-width:1px!important}.x-panel .x-panel-header-default-framed-bottom{border-top-width:1px!important}.x-panel .x-panel-header-default-framed-left{border-right-width:1px!important}.x-nbr .x-panel-header-default-framed-collapsed-top{border-bottom-width:0!important}.x-nbr .x-panel-header-default-framed-collapsed-right{border-left-width:0!important}.x-nbr .x-panel-header-default-framed-collapsed-bottom{border-top-width:0!important}.x-nbr .x-panel-header-default-framed-collapsed-left{border-right-width:0!important}.x-panel-header-default-framed-vertical .x-panel-header-text-container{-webkit-transform:rotate(90deg);-webkit-transform-origin:0 0;-moz-transform:rotate(90deg);-moz-transform-origin:0 0;-o-transform:rotate(90deg);-o-transform-origin:0 0;transform:rotate(90deg);transform-origin:0 0}.x-ie9m .x-panel-header-default-framed-vertical .x-panel-header-text-container{background-color:#cbddf3;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1),progid:DXImageTransform.Microsoft.Chroma(color=#cbddf3)}.x-panel-header-default-framed-top{-webkit-box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb -1px 0 0 0 inset,#f3f7fb 1px 0 0 0 inset;-moz-box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb -1px 0 0 0 inset,#f3f7fb 1px 0 0 0 inset;box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb -1px 0 0 0 inset,#f3f7fb 1px 0 0 0 inset}.x-panel-header-default-framed-right{-webkit-box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb 0 -1px 0 0 inset,#f3f7fb -1px 0 0 0 inset;-moz-box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb 0 -1px 0 0 inset,#f3f7fb -1px 0 0 0 inset;box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb 0 -1px 0 0 inset,#f3f7fb -1px 0 0 0 inset}.x-panel-header-default-framed-bottom{-webkit-box-shadow:#f3f7fb 0 -1px 0 0 inset,#f3f7fb -1px 0 0 0 inset,#f3f7fb 1px 0 0 0 inset;-moz-box-shadow:#f3f7fb 0 -1px 0 0 inset,#f3f7fb -1px 0 0 0 inset,#f3f7fb 1px 0 0 0 inset;box-shadow:#f3f7fb 0 -1px 0 0 inset,#f3f7fb -1px 0 0 0 inset,#f3f7fb 1px 0 0 0 inset}.x-panel-header-default-framed-left{-webkit-box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb 0 -1px 0 0 inset,#f3f7fb 1px 0 0 0 inset;-moz-box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb 0 -1px 0 0 inset,#f3f7fb 1px 0 0 0 inset;box-shadow:#f3f7fb 0 1px 0 0 inset,#f3f7fb 0 -1px 0 0 inset,#f3f7fb 1px 0 0 0 inset}.x-panel-header-default-framed .x-panel-header-icon{width:16px;height:16px;background-position:center center}.x-panel-header-default-framed .x-panel-header-glyph{color:#04408c;font-size:16px;line-height:16px;opacity:.5}.x-ie8m .x-panel-header-default-framed .x-panel-header-glyph{color:#678ebf}.x-panel-header-default-framed-horizontal .x-panel-header-icon-before-title{margin:0 2px 0 0}.x-panel-header-default-framed-horizontal .x-panel-header-icon-after-title{margin:0 0 0 2px}.x-panel-header-default-framed-vertical .x-panel-header-icon-before-title{margin:0 0 2px 0}.x-panel-header-default-framed-vertical .x-panel-header-icon-after-title{margin:2px 0 0 0}.x-panel-header-default-framed-horizontal .x-tool-after-title{margin:0 0 0 2px}.x-panel-header-default-framed-horizontal .x-tool-before-title{margin:0 2px 0 0}.x-panel-header-default-framed-vertical .x-tool-after-title{margin:2px 0 0 0}.x-panel-header-default-framed-vertical .x-tool-before-title{margin:0 0 2px 0}.x-panel-default-framed-resizable .x-panel-handle{filter:alpha(opacity=0);opacity:0}.x-tip-anchor{position:absolute;overflow:hidden;height:10px;width:10px;border-style:solid;border-width:5px;border-color:#8eaace;zoom:1}.x-content-box .x-tip-anchor{height:0;width:0}.x-tip-anchor-top{border-top-color:transparent;border-left-color:transparent;border-right-color:transparent;_border-top-color:pink;_border-left-color:pink;_border-right-color:pink;_filter:chroma(color=pink)}.x-tip-anchor-bottom{border-bottom-color:transparent;border-left-color:transparent;border-right-color:transparent;_border-bottom-color:pink;_border-left-color:pink;_border-right-color:pink;_filter:chroma(color=pink)}.x-tip-anchor-left{border-top-color:transparent;border-bottom-color:transparent;border-left-color:transparent;_border-top-color:pink;_border-bottom-color:pink;_border-left-color:pink;_filter:chroma(color=pink)}.x-tip-anchor-right{border-top-color:transparent;border-bottom-color:transparent;border-right-color:transparent;_border-top-color:pink;_border-bottom-color:pink;_border-right-color:pink;_filter:chroma(color=pink)}.x-tip-default{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:2px 2px 2px 2px;border-width:1px;border-style:solid;background-color:#e9f2ff}.x-tip-default-mc{background-color:#e9f2ff}.x-nbr .x-tip-default{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-tip-default-frameInfo{font-family:th-3-3-3-3-1-1-1-1-2-2-2-2}.x-tip-default-tl{background-position:0 -6px}.x-tip-default-tr{background-position:right -9px}.x-tip-default-bl{background-position:0 -12px}.x-tip-default-br{background-position:right -15px}.x-tip-default-ml{background-position:0 top}.x-tip-default-mr{background-position:right top}.x-tip-default-tc{background-position:0 0}.x-tip-default-bc{background-position:0 -3px}.x-tip-default-tr,.x-tip-default-br,.x-tip-default-mr{padding-right:3px}.x-tip-default-tl,.x-tip-default-bl,.x-tip-default-ml{padding-left:3px}.x-tip-default-tc{height:3px}.x-tip-default-bc{height:3px}.x-tip-default-tl,.x-tip-default-bl,.x-tip-default-tr,.x-tip-default-br,.x-tip-default-tc,.x-tip-default-bc,.x-tip-default-ml,.x-tip-default-mr{zoom:1;background-image:url(images/tip/tip-default-corners.gif)}.x-tip-default-ml,.x-tip-default-mr{zoom:1;background-image:url(images/tip/tip-default-sides.gif);background-repeat:repeat-y}.x-tip-default-mc{padding:0}.x-strict .x-ie7 .x-tip-default-tl,.x-strict .x-ie7 .x-tip-default-bl{position:relative;right:0}.x-tip-default:after{display:none;content:"x-slicer:corners:url(images/tip/tip-default-corners.gif), sides:url(images/tip/tip-default-sides.gif)"}.x-tip-default{border-color:#8eaace}.x-tip-default .x-tool-img{background-color:#e9f2ff}.x-tip-header-default .x-tool-after-title{margin:0 0 0 6px}.x-tip-header-default .x-tool-before-title{margin:0 6px 0 0}.x-tip-header-body-default{padding:3px 3px 0 3px}.x-tip-header-text-container-default{color:#444;font-size:11px;font-weight:bold}.x-tip-body-default{padding:3px;color:#444;font-size:11px;font-weight:normal}.x-tip-body-default a{color:#2a2a2a}.x-tip-form-invalid{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;padding:4px 4px 4px 4px;border-width:1px;border-style:solid;background-color:white}.x-tip-form-invalid-mc{background-color:white}.x-nbr .x-tip-form-invalid{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-tip-form-invalid-frameInfo{font-family:th-5-5-5-5-1-1-1-1-4-4-4-4}.x-tip-form-invalid-tl{background-position:0 -10px}.x-tip-form-invalid-tr{background-position:right -15px}.x-tip-form-invalid-bl{background-position:0 -20px}.x-tip-form-invalid-br{background-position:right -25px}.x-tip-form-invalid-ml{background-position:0 top}.x-tip-form-invalid-mr{background-position:right top}.x-tip-form-invalid-tc{background-position:0 0}.x-tip-form-invalid-bc{background-position:0 -5px}.x-tip-form-invalid-tr,.x-tip-form-invalid-br,.x-tip-form-invalid-mr{padding-right:5px}.x-tip-form-invalid-tl,.x-tip-form-invalid-bl,.x-tip-form-invalid-ml{padding-left:5px}.x-tip-form-invalid-tc{height:5px}.x-tip-form-invalid-bc{height:5px}.x-tip-form-invalid-tl,.x-tip-form-invalid-bl,.x-tip-form-invalid-tr,.x-tip-form-invalid-br,.x-tip-form-invalid-tc,.x-tip-form-invalid-bc,.x-tip-form-invalid-ml,.x-tip-form-invalid-mr{zoom:1;background-image:url(images/tip/tip-form-invalid-corners.gif)}.x-tip-form-invalid-ml,.x-tip-form-invalid-mr{zoom:1;background-image:url(images/tip/tip-form-invalid-sides.gif);background-repeat:repeat-y}.x-tip-form-invalid-mc{padding:0}.x-strict .x-ie7 .x-tip-form-invalid-tl,.x-strict .x-ie7 .x-tip-form-invalid-bl{position:relative;right:0}.x-tip-form-invalid:after{display:none;content:"x-slicer:corners:url(images/tip/tip-form-invalid-corners.gif), sides:url(images/tip/tip-form-invalid-sides.gif)"}.x-tip-form-invalid{border-color:#a1311f;-webkit-box-shadow:#d87166 0 1px 0 0 inset,#d87166 0 -1px 0 0 inset,#d87166 -1px 0 0 0 inset,#d87166 1px 0 0 0 inset;-moz-box-shadow:#d87166 0 1px 0 0 inset,#d87166 0 -1px 0 0 inset,#d87166 -1px 0 0 0 inset,#d87166 1px 0 0 0 inset;box-shadow:#d87166 0 1px 0 0 inset,#d87166 0 -1px 0 0 inset,#d87166 -1px 0 0 0 inset,#d87166 1px 0 0 0 inset}.x-tip-form-invalid .x-tool-img{background-color:white}.x-tip-header-form-invalid .x-tool-after-title{margin:0 0 0 6px}.x-tip-header-form-invalid .x-tool-before-title{margin:0 6px 0 0}.x-tip-header-body-form-invalid{padding:3px 3px 0 3px}.x-tip-header-text-container-form-invalid{color:#444;font-size:11px;font-weight:bold}.x-tip-body-form-invalid{padding:3px 3px 3px 22px;color:#444;font-size:11px;font-weight:normal}.x-tip-body-form-invalid a{color:#2a2a2a}.x-tip-body-form-invalid{background:1px 1px no-repeat;background-image:url(images/form/exclamation.gif)}.x-tip-body-form-invalid li{margin-bottom:4px}.x-tip-body-form-invalid li.last{margin-bottom:0}.x-btn-group-default{border-color:#b7c8d7;-webkit-box-shadow:#e3ebf5 0 1px 0 0 inset,#e3ebf5 0 -1px 0 0 inset,#e3ebf5 -1px 0 0 0 inset,#e3ebf5 1px 0 0 0 inset;-moz-box-shadow:#e3ebf5 0 1px 0 0 inset,#e3ebf5 0 -1px 0 0 inset,#e3ebf5 -1px 0 0 0 inset,#e3ebf5 1px 0 0 0 inset;box-shadow:#e3ebf5 0 1px 0 0 inset,#e3ebf5 0 -1px 0 0 inset,#e3ebf5 -1px 0 0 0 inset,#e3ebf5 1px 0 0 0 inset}.x-btn-group-header-default{margin:2px 2px 0 2px;padding:1px 0;line-height:15px;background:#c2d8f0;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}.x-btn-group-header-default .x-tool-img{background-color:#c2d8f0}.x-btn-group-header-text-container-default{font:normal 11px tahoma,arial,verdana,sans-serif;line-height:15px;color:#3e6aaa}.x-btn-group-body-default{padding:0 1px}.x-btn-group-body-default .x-table-layout{border-spacing:0}.x-btn-group-default-framed{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;padding:1px 1px 1px 1px;border-width:1px;border-style:solid;background-color:#d0def0}.x-btn-group-default-framed-mc{background-color:#d0def0}.x-nbr .x-btn-group-default-framed{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-btn-group-default-framed-frameInfo{font-family:dh-2-2-2-2-1-1-1-1-1-1-1-1}.x-btn-group-default-framed-tl{background-position:0 -4px}.x-btn-group-default-framed-tr{background-position:right -6px}.x-btn-group-default-framed-bl{background-position:0 -8px}.x-btn-group-default-framed-br{background-position:right -10px}.x-btn-group-default-framed-ml{background-position:0 top}.x-btn-group-default-framed-mr{background-position:right top}.x-btn-group-default-framed-tc{background-position:0 0}.x-btn-group-default-framed-bc{background-position:0 -2px}.x-btn-group-default-framed-tr,.x-btn-group-default-framed-br,.x-btn-group-default-framed-mr{padding-right:2px}.x-btn-group-default-framed-tl,.x-btn-group-default-framed-bl,.x-btn-group-default-framed-ml{padding-left:2px}.x-btn-group-default-framed-tc{height:2px}.x-btn-group-default-framed-bc{height:2px}.x-btn-group-default-framed-tl,.x-btn-group-default-framed-bl,.x-btn-group-default-framed-tr,.x-btn-group-default-framed-br,.x-btn-group-default-framed-tc,.x-btn-group-default-framed-bc,.x-btn-group-default-framed-ml,.x-btn-group-default-framed-mr{zoom:1;background-image:url(images/btn-group/btn-group-default-framed-corners.gif)}.x-btn-group-default-framed-ml,.x-btn-group-default-framed-mr{zoom:1;background-image:url(images/btn-group/btn-group-default-framed-sides.gif);background-repeat:repeat-y}.x-btn-group-default-framed-mc{padding:0}.x-strict .x-ie7 .x-btn-group-default-framed-tl,.x-strict .x-ie7 .x-btn-group-default-framed-bl{position:relative;right:0}.x-btn-group-default-framed:after{display:none;content:"x-slicer:corners:url(images/btn-group/btn-group-default-framed-corners.gif), sides:url(images/btn-group/btn-group-default-framed-sides.gif)"}.x-btn-group-default-framed-notitle{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;padding:1px 1px 1px 1px;border-width:1px;border-style:solid;background-color:#d0def0}.x-btn-group-default-framed-notitle-mc{background-color:#d0def0}.x-nbr .x-btn-group-default-framed-notitle{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-btn-group-default-framed-notitle-frameInfo{font-family:dh-2-2-2-2-1-1-1-1-1-1-1-1}.x-btn-group-default-framed-notitle-tl{background-position:0 -4px}.x-btn-group-default-framed-notitle-tr{background-position:right -6px}.x-btn-group-default-framed-notitle-bl{background-position:0 -8px}.x-btn-group-default-framed-notitle-br{background-position:right -10px}.x-btn-group-default-framed-notitle-ml{background-position:0 top}.x-btn-group-default-framed-notitle-mr{background-position:right top}.x-btn-group-default-framed-notitle-tc{background-position:0 0}.x-btn-group-default-framed-notitle-bc{background-position:0 -2px}.x-btn-group-default-framed-notitle-tr,.x-btn-group-default-framed-notitle-br,.x-btn-group-default-framed-notitle-mr{padding-right:2px}.x-btn-group-default-framed-notitle-tl,.x-btn-group-default-framed-notitle-bl,.x-btn-group-default-framed-notitle-ml{padding-left:2px}.x-btn-group-default-framed-notitle-tc{height:2px}.x-btn-group-default-framed-notitle-bc{height:2px}.x-btn-group-default-framed-notitle-tl,.x-btn-group-default-framed-notitle-bl,.x-btn-group-default-framed-notitle-tr,.x-btn-group-default-framed-notitle-br,.x-btn-group-default-framed-notitle-tc,.x-btn-group-default-framed-notitle-bc,.x-btn-group-default-framed-notitle-ml,.x-btn-group-default-framed-notitle-mr{zoom:1;background-image:url(images/btn-group/btn-group-default-framed-notitle-corners.gif)}.x-btn-group-default-framed-notitle-ml,.x-btn-group-default-framed-notitle-mr{zoom:1;background-image:url(images/btn-group/btn-group-default-framed-notitle-sides.gif);background-repeat:repeat-y}.x-btn-group-default-framed-notitle-mc{padding:0}.x-strict .x-ie7 .x-btn-group-default-framed-notitle-tl,.x-strict .x-ie7 .x-btn-group-default-framed-notitle-bl{position:relative;right:0}.x-btn-group-default-framed-notitle:after{display:none;content:"x-slicer:corners:url(images/btn-group/btn-group-default-framed-notitle-corners.gif), sides:url(images/btn-group/btn-group-default-framed-notitle-sides.gif)"}.x-btn-group-default-framed{border-color:#b7c8d7;-webkit-box-shadow:#e3ebf5 0 1px 0 0 inset,#e3ebf5 0 -1px 0 0 inset,#e3ebf5 -1px 0 0 0 inset,#e3ebf5 1px 0 0 0 inset;-moz-box-shadow:#e3ebf5 0 1px 0 0 inset,#e3ebf5 0 -1px 0 0 inset,#e3ebf5 -1px 0 0 0 inset,#e3ebf5 1px 0 0 0 inset;box-shadow:#e3ebf5 0 1px 0 0 inset,#e3ebf5 0 -1px 0 0 inset,#e3ebf5 -1px 0 0 0 inset,#e3ebf5 1px 0 0 0 inset}.x-btn-group-header-default-framed{margin:2px 2px 0 2px;padding:1px 0;line-height:15px;background:#c2d8f0;-moz-border-radius-topleft:2px;-webkit-border-top-left-radius:2px;border-top-left-radius:2px;-moz-border-radius-topright:2px;-webkit-border-top-right-radius:2px;border-top-right-radius:2px}.x-btn-group-header-default-framed .x-tool-img{background-color:#c2d8f0}.x-btn-group-header-text-container-default-framed{font:normal 11px tahoma,arial,verdana,sans-serif;line-height:15px;color:#3e6aaa}.x-btn-group-body-default-framed{padding:0 1px 0 1px}.x-btn-group-body-default-framed .x-table-layout{border-spacing:0}.x-window-ghost{filter:alpha(opacity=65);opacity:.65}.x-window-default{border-color:#a2b1c5;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset;-moz-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset;box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset}.x-window-default{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;padding:4px 4px 4px 4px;border-width:1px;border-style:solid;background-color:#ced9e7}.x-window-default-mc{background-color:#ced9e7}.x-nbr .x-window-default{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-default-frameInfo{font-family:dh-5-5-5-5-1-1-1-1-4-4-4-4}.x-window-default-tl{background-position:0 -10px}.x-window-default-tr{background-position:right -15px}.x-window-default-bl{background-position:0 -20px}.x-window-default-br{background-position:right -25px}.x-window-default-ml{background-position:0 top}.x-window-default-mr{background-position:right top}.x-window-default-tc{background-position:0 0}.x-window-default-bc{background-position:0 -5px}.x-window-default-tr,.x-window-default-br,.x-window-default-mr{padding-right:5px}.x-window-default-tl,.x-window-default-bl,.x-window-default-ml{padding-left:5px}.x-window-default-tc{height:5px}.x-window-default-bc{height:5px}.x-window-default-tl,.x-window-default-bl,.x-window-default-tr,.x-window-default-br,.x-window-default-tc,.x-window-default-bc,.x-window-default-ml,.x-window-default-mr{zoom:1;background-image:url(images/window/window-default-corners.gif)}.x-window-default-ml,.x-window-default-mr{zoom:1;background-image:url(images/window/window-default-sides.gif);background-repeat:repeat-y}.x-window-default-mc{padding:0}.x-strict .x-ie7 .x-window-default-tl,.x-strict .x-ie7 .x-window-default-bl{position:relative;right:0}.x-window-default:after{display:none;content:"x-slicer:corners:url(images/window/window-default-corners.gif), sides:url(images/window/window-default-sides.gif)"}.x-window-body-default{border-color:#99bbe8;border-width:1px;border-style:solid;background:#dfe8f6;color:black}.x-window-header-default{font-size:11px;border-color:#a2b1c5;zoom:1;background-color:#ced9e7}.x-window-header-default .x-tool-img{background-color:#ced9e7}.x-window-header-default-vertical .x-window-header-text-container{-webkit-transform:rotate(90deg);-webkit-transform-origin:0 0;-moz-transform:rotate(90deg);-moz-transform-origin:0 0;-o-transform:rotate(90deg);-o-transform-origin:0 0;transform:rotate(90deg);transform-origin:0 0}.x-ie9m .x-window-header-default-vertical .x-window-header-text-container{background-color:#ced9e7;filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1),progid:DXImageTransform.Microsoft.Chroma(color=#ced9e7)}.x-window-header-text-container-default{color:#04468c;font-weight:bold;line-height:15px;font-family:tahoma,arial,verdana,sans-serif;font-size:11px;padding:0 2px 1px;text-transform:none}.x-window-header-default-top{-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;border-top-left-radius:5px;-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:4px 5px 0 5px;border-width:1px 1px 0 1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-top-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-top{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-top-frameInfo{font-family:dh-5-5-0-0-1-1-0-1-4-5-0-5}.x-window-header-default-top-tl{background-position:0 -10px}.x-window-header-default-top-tr{background-position:right -15px}.x-window-header-default-top-bl{background-position:0 -20px}.x-window-header-default-top-br{background-position:right -25px}.x-window-header-default-top-ml{background-position:0 top}.x-window-header-default-top-mr{background-position:right top}.x-window-header-default-top-tc{background-position:0 0}.x-window-header-default-top-bc{background-position:0 -5px}.x-window-header-default-top-tr,.x-window-header-default-top-br,.x-window-header-default-top-mr{padding-right:5px}.x-window-header-default-top-tl,.x-window-header-default-top-bl,.x-window-header-default-top-ml{padding-left:5px}.x-window-header-default-top-tc{height:5px}.x-window-header-default-top-bc{height:0}.x-window-header-default-top-tl,.x-window-header-default-top-bl,.x-window-header-default-top-tr,.x-window-header-default-top-br,.x-window-header-default-top-tc,.x-window-header-default-top-bc,.x-window-header-default-top-ml,.x-window-header-default-top-mr{zoom:1;background-image:url(images/window-header/window-header-default-top-corners.gif)}.x-window-header-default-top-ml,.x-window-header-default-top-mr{zoom:1;background-image:url(images/window-header/window-header-default-top-sides.gif);background-repeat:repeat-y}.x-window-header-default-top-mc{padding:0 1px 0 1px}.x-strict .x-ie7 .x-window-header-default-top-tl,.x-strict .x-ie7 .x-window-header-default-top-bl{position:relative;right:0}.x-window-header-default-top:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-top-corners.gif), sides:url(images/window-header/window-header-default-top-sides.gif)"}.x-window-header-default-right{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:5px 4px 5px 0;border-width:1px 1px 1px 0;border-style:solid;background-color:#ced9e7}.x-window-header-default-right-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-right{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-right-frameInfo{font-family:dh-0-5-5-0-1-1-1-0-5-4-5-0}.x-window-header-default-right-tl{background-position:0 -10px}.x-window-header-default-right-tr{background-position:right -15px}.x-window-header-default-right-bl{background-position:0 -20px}.x-window-header-default-right-br{background-position:right -25px}.x-window-header-default-right-ml{background-position:0 top}.x-window-header-default-right-mr{background-position:right top}.x-window-header-default-right-tc{background-position:0 0}.x-window-header-default-right-bc{background-position:0 -5px}.x-window-header-default-right-tr,.x-window-header-default-right-br,.x-window-header-default-right-mr{padding-right:5px}.x-window-header-default-right-tl,.x-window-header-default-right-bl,.x-window-header-default-right-ml{padding-left:0}.x-window-header-default-right-tc{height:5px}.x-window-header-default-right-bc{height:5px}.x-window-header-default-right-tl,.x-window-header-default-right-bl,.x-window-header-default-right-tr,.x-window-header-default-right-br,.x-window-header-default-right-tc,.x-window-header-default-right-bc,.x-window-header-default-right-ml,.x-window-header-default-right-mr{zoom:1;background-image:url(images/window-header/window-header-default-right-corners.gif)}.x-window-header-default-right-ml,.x-window-header-default-right-mr{zoom:1;background-image:url(images/window-header/window-header-default-right-sides.gif);background-repeat:repeat-y}.x-window-header-default-right-mc{padding:1px 0 1px 0}.x-strict .x-ie7 .x-window-header-default-right-tl,.x-strict .x-ie7 .x-window-header-default-right-bl{position:relative;right:0}.x-window-header-default-right:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-right-corners.gif), sides:url(images/window-header/window-header-default-right-sides.gif)"}.x-window-header-default-bottom{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px;-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;border-bottom-left-radius:5px;padding:0 5px 4px 5px;border-width:0 1px 1px 1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-bottom-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-bottom{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-bottom-frameInfo{font-family:dh-0-0-5-5-0-1-1-1-0-5-4-5}.x-window-header-default-bottom-tl{background-position:0 -10px}.x-window-header-default-bottom-tr{background-position:right -15px}.x-window-header-default-bottom-bl{background-position:0 -20px}.x-window-header-default-bottom-br{background-position:right -25px}.x-window-header-default-bottom-ml{background-position:0 top}.x-window-header-default-bottom-mr{background-position:right top}.x-window-header-default-bottom-tc{background-position:0 0}.x-window-header-default-bottom-bc{background-position:0 -5px}.x-window-header-default-bottom-tr,.x-window-header-default-bottom-br,.x-window-header-default-bottom-mr{padding-right:5px}.x-window-header-default-bottom-tl,.x-window-header-default-bottom-bl,.x-window-header-default-bottom-ml{padding-left:5px}.x-window-header-default-bottom-tc{height:0}.x-window-header-default-bottom-bc{height:5px}.x-window-header-default-bottom-tl,.x-window-header-default-bottom-bl,.x-window-header-default-bottom-tr,.x-window-header-default-bottom-br,.x-window-header-default-bottom-tc,.x-window-header-default-bottom-bc,.x-window-header-default-bottom-ml,.x-window-header-default-bottom-mr{zoom:1;background-image:url(images/window-header/window-header-default-bottom-corners.gif)}.x-window-header-default-bottom-ml,.x-window-header-default-bottom-mr{zoom:1;background-image:url(images/window-header/window-header-default-bottom-sides.gif);background-repeat:repeat-y}.x-window-header-default-bottom-mc{padding:0 1px 0 1px}.x-strict .x-ie7 .x-window-header-default-bottom-tl,.x-strict .x-ie7 .x-window-header-default-bottom-bl{position:relative;right:0}.x-window-header-default-bottom:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-bottom-corners.gif), sides:url(images/window-header/window-header-default-bottom-sides.gif)"}.x-window-header-default-left{-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;border-top-left-radius:5px;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;border-bottom-left-radius:5px;padding:5px 0 5px 4px;border-width:1px 0 1px 1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-left-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-left{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-left-frameInfo{font-family:dh-5-0-0-5-1-0-1-1-5-0-5-4}.x-window-header-default-left-tl{background-position:0 -10px}.x-window-header-default-left-tr{background-position:right -15px}.x-window-header-default-left-bl{background-position:0 -20px}.x-window-header-default-left-br{background-position:right -25px}.x-window-header-default-left-ml{background-position:0 top}.x-window-header-default-left-mr{background-position:right top}.x-window-header-default-left-tc{background-position:0 0}.x-window-header-default-left-bc{background-position:0 -5px}.x-window-header-default-left-tr,.x-window-header-default-left-br,.x-window-header-default-left-mr{padding-right:0}.x-window-header-default-left-tl,.x-window-header-default-left-bl,.x-window-header-default-left-ml{padding-left:5px}.x-window-header-default-left-tc{height:5px}.x-window-header-default-left-bc{height:5px}.x-window-header-default-left-tl,.x-window-header-default-left-bl,.x-window-header-default-left-tr,.x-window-header-default-left-br,.x-window-header-default-left-tc,.x-window-header-default-left-bc,.x-window-header-default-left-ml,.x-window-header-default-left-mr{zoom:1;background-image:url(images/window-header/window-header-default-left-corners.gif)}.x-window-header-default-left-ml,.x-window-header-default-left-mr{zoom:1;background-image:url(images/window-header/window-header-default-left-sides.gif);background-repeat:repeat-y}.x-window-header-default-left-mc{padding:1px 0 1px 0}.x-strict .x-ie7 .x-window-header-default-left-tl,.x-strict .x-ie7 .x-window-header-default-left-bl{position:relative;right:0}.x-window-header-default-left:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-left-corners.gif), sides:url(images/window-header/window-header-default-left-sides.gif)"}.x-window-header-default-collapsed-top{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;padding:4px 5px 4px 5px;border-width:1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-collapsed-top-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-collapsed-top{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-collapsed-top-frameInfo{font-family:dh-5-5-5-5-1-1-1-1-4-5-4-5}.x-window-header-default-collapsed-top-tl{background-position:0 -10px}.x-window-header-default-collapsed-top-tr{background-position:right -15px}.x-window-header-default-collapsed-top-bl{background-position:0 -20px}.x-window-header-default-collapsed-top-br{background-position:right -25px}.x-window-header-default-collapsed-top-ml{background-position:0 top}.x-window-header-default-collapsed-top-mr{background-position:right top}.x-window-header-default-collapsed-top-tc{background-position:0 0}.x-window-header-default-collapsed-top-bc{background-position:0 -5px}.x-window-header-default-collapsed-top-tr,.x-window-header-default-collapsed-top-br,.x-window-header-default-collapsed-top-mr{padding-right:5px}.x-window-header-default-collapsed-top-tl,.x-window-header-default-collapsed-top-bl,.x-window-header-default-collapsed-top-ml{padding-left:5px}.x-window-header-default-collapsed-top-tc{height:5px}.x-window-header-default-collapsed-top-bc{height:5px}.x-window-header-default-collapsed-top-tl,.x-window-header-default-collapsed-top-bl,.x-window-header-default-collapsed-top-tr,.x-window-header-default-collapsed-top-br,.x-window-header-default-collapsed-top-tc,.x-window-header-default-collapsed-top-bc,.x-window-header-default-collapsed-top-ml,.x-window-header-default-collapsed-top-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-top-corners.gif)}.x-window-header-default-collapsed-top-ml,.x-window-header-default-collapsed-top-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-top-sides.gif);background-repeat:repeat-y}.x-window-header-default-collapsed-top-mc{padding:0 1px 0 1px}.x-strict .x-ie7 .x-window-header-default-collapsed-top-tl,.x-strict .x-ie7 .x-window-header-default-collapsed-top-bl{position:relative;right:0}.x-window-header-default-collapsed-top:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-collapsed-top-corners.gif), sides:url(images/window-header/window-header-default-collapsed-top-sides.gif)"}.x-window-header-default-collapsed-right{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;padding:5px 4px 5px 4px;border-width:1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-collapsed-right-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-collapsed-right{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-collapsed-right-frameInfo{font-family:dh-5-5-5-5-1-1-1-1-5-4-5-4}.x-window-header-default-collapsed-right-tl{background-position:0 -10px}.x-window-header-default-collapsed-right-tr{background-position:right -15px}.x-window-header-default-collapsed-right-bl{background-position:0 -20px}.x-window-header-default-collapsed-right-br{background-position:right -25px}.x-window-header-default-collapsed-right-ml{background-position:0 top}.x-window-header-default-collapsed-right-mr{background-position:right top}.x-window-header-default-collapsed-right-tc{background-position:0 0}.x-window-header-default-collapsed-right-bc{background-position:0 -5px}.x-window-header-default-collapsed-right-tr,.x-window-header-default-collapsed-right-br,.x-window-header-default-collapsed-right-mr{padding-right:5px}.x-window-header-default-collapsed-right-tl,.x-window-header-default-collapsed-right-bl,.x-window-header-default-collapsed-right-ml{padding-left:5px}.x-window-header-default-collapsed-right-tc{height:5px}.x-window-header-default-collapsed-right-bc{height:5px}.x-window-header-default-collapsed-right-tl,.x-window-header-default-collapsed-right-bl,.x-window-header-default-collapsed-right-tr,.x-window-header-default-collapsed-right-br,.x-window-header-default-collapsed-right-tc,.x-window-header-default-collapsed-right-bc,.x-window-header-default-collapsed-right-ml,.x-window-header-default-collapsed-right-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-right-corners.gif)}.x-window-header-default-collapsed-right-ml,.x-window-header-default-collapsed-right-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-right-sides.gif);background-repeat:repeat-y}.x-window-header-default-collapsed-right-mc{padding:1px 0 1px 0}.x-strict .x-ie7 .x-window-header-default-collapsed-right-tl,.x-strict .x-ie7 .x-window-header-default-collapsed-right-bl{position:relative;right:0}.x-window-header-default-collapsed-right:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-collapsed-right-corners.gif), sides:url(images/window-header/window-header-default-collapsed-right-sides.gif)"}.x-window-header-default-collapsed-bottom{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;padding:4px 5px 4px 5px;border-width:1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-collapsed-bottom-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-collapsed-bottom{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-collapsed-bottom-frameInfo{font-family:dh-5-5-5-5-1-1-1-1-4-5-4-5}.x-window-header-default-collapsed-bottom-tl{background-position:0 -10px}.x-window-header-default-collapsed-bottom-tr{background-position:right -15px}.x-window-header-default-collapsed-bottom-bl{background-position:0 -20px}.x-window-header-default-collapsed-bottom-br{background-position:right -25px}.x-window-header-default-collapsed-bottom-ml{background-position:0 top}.x-window-header-default-collapsed-bottom-mr{background-position:right top}.x-window-header-default-collapsed-bottom-tc{background-position:0 0}.x-window-header-default-collapsed-bottom-bc{background-position:0 -5px}.x-window-header-default-collapsed-bottom-tr,.x-window-header-default-collapsed-bottom-br,.x-window-header-default-collapsed-bottom-mr{padding-right:5px}.x-window-header-default-collapsed-bottom-tl,.x-window-header-default-collapsed-bottom-bl,.x-window-header-default-collapsed-bottom-ml{padding-left:5px}.x-window-header-default-collapsed-bottom-tc{height:5px}.x-window-header-default-collapsed-bottom-bc{height:5px}.x-window-header-default-collapsed-bottom-tl,.x-window-header-default-collapsed-bottom-bl,.x-window-header-default-collapsed-bottom-tr,.x-window-header-default-collapsed-bottom-br,.x-window-header-default-collapsed-bottom-tc,.x-window-header-default-collapsed-bottom-bc,.x-window-header-default-collapsed-bottom-ml,.x-window-header-default-collapsed-bottom-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-bottom-corners.gif)}.x-window-header-default-collapsed-bottom-ml,.x-window-header-default-collapsed-bottom-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-bottom-sides.gif);background-repeat:repeat-y}.x-window-header-default-collapsed-bottom-mc{padding:0 1px 0 1px}.x-strict .x-ie7 .x-window-header-default-collapsed-bottom-tl,.x-strict .x-ie7 .x-window-header-default-collapsed-bottom-bl{position:relative;right:0}.x-window-header-default-collapsed-bottom:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-collapsed-bottom-corners.gif), sides:url(images/window-header/window-header-default-collapsed-bottom-sides.gif)"}.x-window-header-default-collapsed-left{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;padding:5px 4px 5px 4px;border-width:1px;border-style:solid;background-color:#ced9e7}.x-window-header-default-collapsed-left-mc{background-color:#ced9e7}.x-nbr .x-window-header-default-collapsed-left{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-window-header-default-collapsed-left-frameInfo{font-family:dh-5-5-5-5-1-1-1-1-5-4-5-4}.x-window-header-default-collapsed-left-tl{background-position:0 -10px}.x-window-header-default-collapsed-left-tr{background-position:right -15px}.x-window-header-default-collapsed-left-bl{background-position:0 -20px}.x-window-header-default-collapsed-left-br{background-position:right -25px}.x-window-header-default-collapsed-left-ml{background-position:0 top}.x-window-header-default-collapsed-left-mr{background-position:right top}.x-window-header-default-collapsed-left-tc{background-position:0 0}.x-window-header-default-collapsed-left-bc{background-position:0 -5px}.x-window-header-default-collapsed-left-tr,.x-window-header-default-collapsed-left-br,.x-window-header-default-collapsed-left-mr{padding-right:5px}.x-window-header-default-collapsed-left-tl,.x-window-header-default-collapsed-left-bl,.x-window-header-default-collapsed-left-ml{padding-left:5px}.x-window-header-default-collapsed-left-tc{height:5px}.x-window-header-default-collapsed-left-bc{height:5px}.x-window-header-default-collapsed-left-tl,.x-window-header-default-collapsed-left-bl,.x-window-header-default-collapsed-left-tr,.x-window-header-default-collapsed-left-br,.x-window-header-default-collapsed-left-tc,.x-window-header-default-collapsed-left-bc,.x-window-header-default-collapsed-left-ml,.x-window-header-default-collapsed-left-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-left-corners.gif)}.x-window-header-default-collapsed-left-ml,.x-window-header-default-collapsed-left-mr{zoom:1;background-image:url(images/window-header/window-header-default-collapsed-left-sides.gif);background-repeat:repeat-y}.x-window-header-default-collapsed-left-mc{padding:1px 0 1px 0}.x-strict .x-ie7 .x-window-header-default-collapsed-left-tl,.x-strict .x-ie7 .x-window-header-default-collapsed-left-bl{position:relative;right:0}.x-window-header-default-collapsed-left:after{display:none;content:"x-slicer:corners:url(images/window-header/window-header-default-collapsed-left-corners.gif), sides:url(images/window-header/window-header-default-collapsed-left-sides.gif)"}.x-window-header-default-top{-webkit-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset;-moz-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset;box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset}.x-window-header-default-right{-webkit-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset;-moz-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset;box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset}.x-window-header-default-bottom{-webkit-box-shadow:#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset;-moz-box-shadow:#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset;box-shadow:#ecf2fb 0 -1px 0 0 inset,#ecf2fb -1px 0 0 0 inset,#ecf2fb 1px 0 0 0 inset}.x-window-header-default-left{-webkit-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb 1px 0 0 0 inset;-moz-box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb 1px 0 0 0 inset;box-shadow:#ecf2fb 0 1px 0 0 inset,#ecf2fb 0 -1px 0 0 inset,#ecf2fb 1px 0 0 0 inset}.x-window-header-default .x-window-header-icon{width:16px;height:16px;color:#04468c;font-size:16px;line-height:16px;background-position:center center}.x-window-header-default .x-window-header-glyph{color:#04468c;font-size:16px;line-height:16px;opacity:.5}.x-ie8m .x-window-header-default .x-window-header-glyph{color:#698fb9}.x-window-header-default-horizontal .x-window-header-icon-before-title{margin:0 2px 0 0}.x-window-header-default-horizontal .x-window-header-icon-after-title{margin:0 0 0 2px}.x-window-header-default-vertical .x-window-header-icon-before-title{margin:0 0 2px 0}.x-window-header-default-vertical .x-window-header-icon-after-title{margin:2px 0 0 0}.x-window-header-default-horizontal .x-tool-after-title{margin:0 0 0 2px}.x-window-header-default-horizontal .x-tool-before-title{margin:0 2px 0 0}.x-window-header-default-vertical .x-tool-after-title{margin:2px 0 0 0}.x-window-header-default-vertical .x-tool-before-title{margin:0 0 2px 0}.x-window-default-collapsed .x-window-header{border-width:1px!important}.x-nbr .x-window-default-collapsed .x-window-header{border-width:0!important}.x-form-invalid-under{padding:2px 2px 2px 20px;color:#c0272b;font:normal 11px tahoma,arial,verdana,sans-serif;line-height:16px;background:no-repeat 0 2px;background-image:url(images/form/exclamation.gif)}div.x-lbl-top-err-icon{margin-bottom:3px}.x-form-invalid-icon{width:16px;height:16px;margin:0 1px;background-image:url(images/form/exclamation.gif);background-repeat:no-repeat}.x-form-item-label{color:black;font:normal 12px/14px tahoma,arial,verdana,sans-serif;margin-top:4px}.x-toolbar-item .x-form-item-label{font:normal 11px/13px tahoma,arial,verdana,sans-serif;margin-top:4px}.x-autocontainer-form-item,.x-anchor-form-item,.x-vbox-form-item,.x-table-form-item{margin-bottom:5px}.x-ie6 .x-form-form-item td{border-top-width:0}.x-ie6 td.x-form-item-pad{height:5px}.x-form-field{color:black}.x-form-item,.x-form-field{font:normal 12px tahoma,arial,verdana,sans-serif}.x-form-type-text textarea.x-form-invalid-field,.x-form-type-text input.x-form-invalid-field,.x-form-type-password textarea.x-form-invalid-field,.x-form-type-password input.x-form-invalid-field,.x-form-type-number textarea.x-form-invalid-field,.x-form-type-number input.x-form-invalid-field,.x-form-type-email textarea.x-form-invalid-field,.x-form-type-email input.x-form-invalid-field,.x-form-type-search textarea.x-form-invalid-field,.x-form-type-search input.x-form-invalid-field,.x-form-type-tel textarea.x-form-invalid-field,.x-form-type-tel input.x-form-invalid-field{background-color:white;background-image:url(images/grid/invalid_line.gif);background-repeat:repeat-x;background-position:bottom;border-color:#c30}.x-item-disabled .x-form-item-label,.x-item-disabled .x-form-field,.x-item-disabled .x-form-display-field,.x-item-disabled .x-form-cb-label,.x-item-disabled .x-form-trigger{filter:alpha(opacity=30);opacity:.3}.x-form-text{color:black;padding:1px 3px 2px 3px;background:white repeat-x 0 0;border-width:1px;border-style:solid;border-color:#b5b8c8;background-image:url(images/form/text-bg.gif);height:22px;line-height:17px}.x-field-toolbar .x-form-text{height:20px;line-height:15px}.x-content-box .x-form-text{height:17px}.x-content-box .x-field-toolbar .x-form-text{height:15px}.x-form-focus{border-color:#7eadd9}.x-form-empty-field,textarea.x-form-empty-field{color:gray}.x-quirks .x-ie .x-form-text,.x-ie7m .x-form-text{margin-top:-1px;margin-bottom:-1px}.x-form-textarea{line-height:normal;height:auto;background-image:url(images/form/text-bg.gif)}.x-form-display-field-body{height:22px}.x-toolbar-item .x-form-display-field-body{height:20px}.x-form-display-field{font:normal 12px/14px tahoma,arial,verdana,sans-serif;color:black;margin-top:4px}.x-toolbar-item .x-form-display-field{margin-top:4px;font:normal 11px/13px tahoma,arial,verdana,sans-serif}.x-message-box .x-window-body{background-color:#ced9e7;border-width:0}.x-message-box-info,.x-message-box-warning,.x-message-box-question,.x-message-box-error{background-position:top left;background-repeat:no-repeat}.x-message-box-info{background-image:url(images/shared/icon-info.gif)}.x-message-box-warning{background-image:url(images/shared/icon-warning.gif)}.x-message-box-question{background-image:url(images/shared/icon-question.gif)}.x-message-box-error{background-image:url(images/shared/icon-error.gif)}.x-form-cb-wrap{height:22px}.x-toolbar-item .x-form-cb-wrap{height:20px}.x-form-cb{margin-top:5px}.x-toolbar-item .x-form-cb{margin-top:4px}.x-form-checkbox{width:13px;height:13px;background:url(images/form/checkbox.gif) no-repeat}.x-form-cb-checked .x-form-checkbox{background-position:0 -13px}.x-form-checkbox-focus{background-position:-13px 0}.x-form-cb-checked .x-form-checkbox-focus{background-position:-13px -13px}.x-form-cb-label{margin-top:4px;font:normal 12px/14px tahoma,arial,verdana,sans-serif}.x-toolbar-item .x-form-cb-label{font:normal 11px/13px tahoma,arial,verdana,sans-serif;margin-top:4px}.x-form-cb-label-before{margin-right:4px}.x-form-cb-label-after{margin-left:4px}.x-form-checkboxgroup-body{padding:0 4px}.x-form-invalid .x-form-checkboxgroup-body{border:1px solid #c30;background-image:url(images/grid/invalid_line.gif);background-repeat:repeat-x;background-position:bottom}.x-check-group-alt{background:#d1ddef;border-top:1px dotted #b5b8c8;border-bottom:1px dotted #b5b8c8}.x-form-check-group-label{color:black;padding:2px;margin:0 30px 5px 0;border-width:0 0 1px 0;border-style:solid;border-color:black}.x-fieldset{border:1px solid #b5b8c8;padding:0 10px;margin:0 0 10px}.x-ie8m .x-fieldset,.x-quirks .x-ie .x-fieldset{padding-top:0}.x-ie8m .x-fieldset .x-fieldset-body,.x-quirks .x-ie .x-fieldset .x-fieldset-body{padding-top:0}.x-fieldset-header-checkbox{line-height:14px;margin:1px 3px 0 0}.x-fieldset-header{padding:0 3px 1px}.x-fieldset-header .x-tool{margin-top:1px;padding:0}.x-fieldset-header .x-form-cb-wrap{padding:1px 0}.x-fieldset-header-text{font:11px/14px bold tahoma,arial,verdana,sans-serif;color:#15428b;padding:1px 0}.x-fieldset-header-text-collapsible{cursor:pointer}.x-fieldset-with-title .x-fieldset-header-checkbox,.x-fieldset-with-title .x-tool{margin:1px 3px 0 0}.x-webkit .x-fieldset-header{-webkit-padding-start:3px;-webkit-padding-end:3px}.x-opera .x-fieldset-with-legend{margin-top:-1px}.x-opera.x-mac .x-fieldset-header-text{padding:2px 0 0}.x-strict .x-ie8 .x-fieldset-header{margin-bottom:-1px}.x-strict .x-ie8 .x-fieldset-header .x-tool,.x-strict .x-ie8 .x-fieldset-header .x-fieldset-header-text,.x-strict .x-ie8 .x-fieldset-header .x-fieldset-header-checkbox{position:relative;top:-1px}.x-quirks .x-ie .x-fieldset-header,.x-ie8m .x-fieldset-header{padding-left:1px;padding-right:1px}.x-fieldset-collapsed .x-fieldset-body{display:none}.x-fieldset-collapsed{padding-bottom:0!important;border-width:1px 1px 0 1px!important;border-left-color:transparent!important;border-right-color:transparent!important}.x-ie6 .x-fieldset-collapsed{border-width:1px 0 0 0!important;padding-bottom:0!important;margin-left:1px;margin-right:1px}.x-ie .x-fieldset-bwrap{zoom:1}.x-fieldset .x-tool-toggle{background-position:0 -60px}.x-fieldset .x-tool-over .x-tool-toggle{background-position:-15px -60px}.x-fieldset-collapsed .x-tool-toggle{background-position:0 -75px}.x-fieldset-collapsed .x-tool-over .x-tool-toggle{background-position:-15px -75px}.x-ie .x-fieldset-noborder legend{position:relative;margin-bottom:23px}.x-ie .x-fieldset-noborder legend span{position:absolute;left:16px}.x-fieldset{overflow:hidden}.x-fieldset-bwrap{overflow:hidden;zoom:1}.x-fieldset-body{overflow:hidden}.x-form-radio{width:13px;height:13px;background:url(images/form/radio.gif) no-repeat}.x-form-cb-checked .x-form-radio{background-position:0 -13px}.x-form-radio-focus{background-position:-13px 0}.x-form-cb-checked .x-form-radio-focus{background-position:-13px -13px}.x-form-trigger{background:url(images/form/trigger.gif);width:17px;border-width:0 0 1px;border-color:#b5b8c8;border-style:solid}.x-trigger-cell{background-color:white;width:17px}.x-form-trigger-over{background-position:-17px 0;border-color:#7eadd9}.x-form-trigger-wrap-focus .x-form-trigger{background-position:-51px 0;border-color:#7eadd9}.x-form-trigger-wrap-focus .x-form-trigger-over{background-position:-68px 0}.x-form-trigger-click,.x-form-trigger-wrap-focus .x-form-trigger-click{background-position:-34px 0}.x-form-clear-trigger{background-image:url(images/form/clear-trigger.gif)}.x-form-search-trigger{background-image:url(images/form/search-trigger.gif)}.x-quirks .prefixie6 .x-form-trigger-input-cell{height:22px}.x-quirks .prefixie6 .x-field-toolbar .x-form-trigger-input-cell{height:20px}div.x-form-spinner-up,div.x-form-spinner-down{background-image:url(images/form/spinner.gif);background-color:white;width:17px;height:11px}.x-form-spinner-down{background-position:0 -11px}.x-form-trigger-wrap-focus .x-form-spinner-down{background-position:-51px -11px}.x-form-trigger-wrap .x-form-spinner-down-over{background-position:-17px -11px}.x-form-trigger-wrap-focus .x-form-spinner-down-over{background-position:-68px -11px}.x-form-trigger-wrap .x-form-spinner-down-click{background-position:-34px -11px}.x-toolbar-item div.x-form-spinner-up,.x-toolbar-item div.x-form-spinner-down{background-image:url(images/form/spinner-small.gif);height:10px}.x-toolbar-item .x-form-spinner-down{background-position:0 -10px}.x-toolbar-item .x-form-trigger-wrap-focus .x-form-spinner-down{background-position:-51px -10px}.x-toolbar-item .x-form-trigger-wrap .x-form-spinner-down-over{background-position:-17px -10px}.x-toolbar-item .x-form-trigger-wrap-focus .x-form-spinner-down-over{background-position:-68px -10px}.x-toolbar-item .x-form-trigger-wrap .x-form-spinner-down-click{background-position:-34px -10px}.x-tbar-page-number{width:30px}.x-tbar-page-first{background-image:url(images/grid/page-first.gif)}.x-tbar-page-prev{background-image:url(images/grid/page-prev.gif)}.x-tbar-page-next{background-image:url(images/grid/page-next.gif)}.x-tbar-page-last{background-image:url(images/grid/page-last.gif)}.x-tbar-loading{background-image:url(images/grid/refresh.gif)}.x-item-disabled .x-tbar-page-first{background-image:url(images/grid/page-first-disabled.gif)}.x-item-disabled .x-tbar-page-prev{background-image:url(images/grid/page-prev-disabled.gif)}.x-item-disabled .x-tbar-page-next{background-image:url(images/grid/page-next-disabled.gif)}.x-item-disabled .x-tbar-page-last{background-image:url(images/grid/page-last-disabled.gif)}.x-item-disabled .x-tbar-loading{background-image:url(images/grid/refresh-disabled.gif)}.x-boundlist{border-width:1px;border-style:solid;border-color:#98c0f4;background:white}.x-strict .x-ie7m .x-boundlist-list-ct{position:relative}.x-boundlist-item{padding:0 3px;line-height:20px;cursor:pointer;cursor:hand;position:relative;zoom:1;border-width:1px;border-style:dotted;border-color:white}.x-boundlist-selected{background:#cbdaf0;border-color:#8eabe4}.x-boundlist-item-over{background:#dfe8f6;border-color:#a3bae9}.x-boundlist-floating{border-top-width:0}.x-boundlist-above{border-top-width:1px;border-bottom-width:1px}.x-datepicker{border-width:1px;border-style:solid;border-color:#1b376c;background-color:white;width:177px}.x-datepicker-header{padding:3px 6px;text-align:center;background-image:none;background-color:#23427c;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#264888),color-stop(100%,#1f3a6c));background-image:-webkit-linear-gradient(top,#264888,#1f3a6c);background-image:-moz-linear-gradient(top,#264888,#1f3a6c);background-image:-o-linear-gradient(top,#264888,#1f3a6c);background-image:linear-gradient(top,#264888,#1f3a6c)}.x-datepicker-arrow{width:15px;height:15px;top:6px;cursor:pointer;background-color:#23427c;filter:alpha(opacity=70);opacity:.7}a.x-datepicker-arrow:hover{filter:alpha(opacity=100);opacity:1}.x-datepicker-next{right:6px;background-image:url(images/shared/right-btn.gif)}.x-datepicker-prev{left:6px;background-image:url(images/shared/left-btn.gif)}.x-datepicker-month .x-btn,.x-datepicker-month .x-btn .x-btn-tc,.x-datepicker-month .x-btn .x-btn-tl,.x-datepicker-month .x-btn .x-btn-tr,.x-datepicker-month .x-btn .x-btn-mc,.x-datepicker-month .x-btn .x-btn-ml,.x-datepicker-month .x-btn .x-btn-mr,.x-datepicker-month .x-btn .x-btn-bc,.x-datepicker-month .x-btn .x-btn-bl,.x-datepicker-month .x-btn .x-btn-br{background:transparent;border-width:0!important}.x-datepicker-month .x-btn-inner{color:white}.x-datepicker-month .x-btn-split-right{background-image:url(images/button/s-arrow-light.gif);padding-right:12px}.x-datepicker-column-header{width:25px;color:#233d6d;font:normal 10px tahoma,arial,verdana,sans-serif;text-align:right;border-width:0 0 1px;border-style:solid;border-color:#b2d1f5;background-image:none;background-color:#dfecfb;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#edf4fd),color-stop(100%,#cde1f9));background-image:-webkit-linear-gradient(top,#edf4fd,#cde1f9);background-image:-moz-linear-gradient(top,#edf4fd,#cde1f9);background-image:-o-linear-gradient(top,#edf4fd,#cde1f9);background-image:linear-gradient(top,#edf4fd,#cde1f9)}.x-datepicker-column-header-inner{line-height:19px;padding:0 7px 0 0}.x-datepicker-cell{text-align:right;border-width:1px;border-style:solid;border-color:white}.x-datepicker-date{padding:0 4px 0 0;font:normal 11px tahoma,arial,verdana,sans-serif;color:black;cursor:pointer;line-height:18px}a.x-datepicker-date:hover{color:black;background-color:#ddecfe}.x-datepicker-selected{border-style:solid;border-color:#8db2e3}.x-datepicker-selected .x-datepicker-date{background-color:#dae5f3;font-weight:bold}.x-datepicker-today{border-color:darkred;border-style:solid}.x-datepicker-prevday .x-datepicker-date,.x-datepicker-nextday .x-datepicker-date{color:#aaa}.x-datepicker-disabled a.x-datepicker-date{background-color:#eee;cursor:default;color:#bbb}.x-datepicker-disabled a.x-datepicker-date:hover{background-color:#eee}.x-datepicker-footer,.x-monthpicker-buttons{padding:4px 0;border-width:1px 0 0;border-style:solid;border-color:#b2d1f5;background-image:none;background-color:#dfecfb;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dee8f5),color-stop(49%,#d1dff0),color-stop(51%,#c7d8ed),color-stop(100%,#cbdaee));background-image:-webkit-linear-gradient(top,#dee8f5,#d1dff0 49%,#c7d8ed 51%,#cbdaee);background-image:-moz-linear-gradient(top,#dee8f5,#d1dff0 49%,#c7d8ed 51%,#cbdaee);background-image:-o-linear-gradient(top,#dee8f5,#d1dff0 49%,#c7d8ed 51%,#cbdaee);background-image:linear-gradient(top,#dee8f5,#d1dff0 49%,#c7d8ed 51%,#cbdaee);text-align:center}.x-datepicker-footer .x-btn,.x-monthpicker-buttons .x-btn{margin:0 2px 0 2px}.x-monthpicker{width:177px;border-width:1px;border-style:solid;border-color:#1b376c;background-color:white}.x-monthpicker-months{border-width:0 1px 0 0;border-color:#1b376c;border-style:solid;width:87px}.x-monthpicker-months .x-monthpicker-item{width:43px}.x-monthpicker-years{width:88px}.x-monthpicker-years .x-monthpicker-item{width:44px}.x-monthpicker-item{margin:5px 0 4px;font:normal 11px tahoma,arial,verdana,sans-serif;text-align:center}.x-monthpicker-item-inner{margin:0 5px 0 5px;color:#15428b;border-width:1px;border-style:solid;border-color:white;line-height:16px;cursor:pointer}a.x-monthpicker-item-inner:hover{background-color:#ddecfe}.x-monthpicker-selected{background-color:#dae5f3;border-style:solid;border-color:#8db2e3}.x-monthpicker-yearnav{height:27px}.x-monthpicker-yearnav-button-ct{width:44px}.x-monthpicker-yearnav-button{height:15px;width:15px;cursor:pointer;margin-top:6px;background-color:white}.x-monthpicker-yearnav-next{background-image:url(images/tools/tool-sprites.gif);background-position:0 -120px}.x-monthpicker-yearnav-next-over{background-position:-15px -120px}.x-monthpicker-yearnav-prev{background-image:url(images/tools/tool-sprites.gif);background-position:0 -105px}.x-monthpicker-yearnav-prev-over{background-position:-15px -105px}.x-monthpicker-small .x-monthpicker-item{margin:2px 0 2px}.x-monthpicker-small .x-monthpicker-item-inner{margin:0 5px 0 5px}.x-monthpicker-small .x-monthpicker-yearnav{height:22px}.x-monthpicker-small .x-monthpicker-yearnav-button{margin-top:3px}.x-nlg .x-datepicker-header{background-image:url(images/datepicker/datepicker-header-bg.gif);background-repeat:repeat-x;background-position:top left}.x-nlg .x-datepicker-footer,.x-nlg .x-monthpicker-buttons{background-image:url(images/datepicker/datepicker-footer-bg.gif);background-repeat:repeat-x;background-position:top left}.x-datepicker-header:after{display:none;content:"x-slicer:bg:url(images/datepicker/datepicker-header-bg.gif)"}.x-datepicker-footer:after{display:none;content:"x-slicer:bg:url(images/datepicker/datepicker-footer-bg.gif)"}.x-form-date-trigger{background-image:url(images/form/date-trigger.gif)}.x-form-file-wrap .x-form-text{color:gray}.x-color-picker{width:144px;height:90px;background-color:white;border-color:white;border-width:0;border-style:solid}.x-color-picker-item{width:18px;height:18px;border-width:1px;border-color:white;border-style:solid;background-color:white;cursor:pointer;padding:2px}.x-content-box .x-color-picker-item{width:12px;height:12px}a.x-color-picker-item:hover{border-color:#8bb8f3;background-color:#deecfd}.x-color-picker-selected{border-color:#8bb8f3;background-color:#deecfd}.x-color-picker-item-inner{line-height:10px;border-color:#aca899;border-width:1px;border-style:solid}.x-html-editor-tb .x-btn-text{background:transparent no-repeat;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-bold,.x-menu-item div.x-edit-bold{background-position:0 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-italic,.x-menu-item div.x-edit-italic{background-position:-16px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-underline,.x-menu-item div.x-edit-underline{background-position:-32px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-forecolor,.x-menu-item div.x-edit-forecolor{background-position:-160px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-backcolor,.x-menu-item div.x-edit-backcolor{background-position:-176px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-justifyleft,.x-menu-item div.x-edit-justifyleft{background-position:-112px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-justifycenter,.x-menu-item div.x-edit-justifycenter{background-position:-128px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-justifyright,.x-menu-item div.x-edit-justifyright{background-position:-144px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-insertorderedlist,.x-menu-item div.x-edit-insertorderedlist{background-position:-80px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-insertunorderedlist,.x-menu-item div.x-edit-insertunorderedlist{background-position:-96px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-increasefontsize,.x-menu-item div.x-edit-increasefontsize{background-position:-48px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-decreasefontsize,.x-menu-item div.x-edit-decreasefontsize{background-position:-64px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-sourceedit,.x-menu-item div.x-edit-sourceedit{background-position:-192px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tb .x-edit-createlink,.x-menu-item div.x-edit-createlink{background-position:-208px 0;background-image:url(images/editor/tb-sprite.gif)}.x-html-editor-tip .x-tip-bd .x-tip-bd-inner{padding:5px;padding-bottom:1px}.x-html-editor-tb .x-font-select{font-size:11px;font-family:inherit}.x-html-editor-wrap textarea{font:normal 12px tahoma,arial,verdana,sans-serif;background-color:white;resize:none}.x-grid-body{background:white;border-width:1px;border-style:solid;border-color:#99bce8}.x-grid-empty{padding:10px;color:gray;background-color:white;font:normal 11px tahoma,arial,verdana,sans-serif}.x-grid-cell{color:null;font:normal 11px/13px tahoma,arial,verdana,sans-serif;background-color:white;border-color:#ededed #d0d0d0 #ededed #d0d0d0;border-style:solid}.x-grid-row-alt .x-grid-td{background-color:#fafafa}.x-grid-row-before-over .x-grid-td{border-bottom-style:solid;border-bottom-color:#ddd}.x-grid-row-over .x-grid-td{border-bottom-style:solid;border-bottom-color:#ddd}.x-grid-row-before-selected .x-grid-td{border-bottom-style:dotted;border-bottom-color:#a3bae9}.x-grid-row-selected .x-grid-td{border-bottom-style:dotted;border-bottom-color:#a3bae9}.x-grid-row-before-focused .x-grid-td{border-bottom-style:dotted;border-bottom-color:#464646;border-bottom-width:1px}.x-grid-row-focused .x-grid-td{background-color:#efefef}.x-grid-row-over .x-grid-td{background-color:#efefef}.x-grid-row-selected .x-grid-td{background-color:#dfe8f6}.x-grid-row-focused .x-grid-td{border-bottom-style:dotted;border-bottom-color:#464646;border-bottom-width:1px}.x-grid-table .x-grid-row-focused-first .x-grid-td{border-top:1px dotted #464646}.x-grid-row-selected .x-grid-row-summary .x-grid-td{border-bottom-color:#dfe8f6;border-top-width:0}.x-grid-row-focused .x-grid-row-summary .x-grid-td{border-bottom-color:#efefef;border-top-width:0}.x-grid-with-row-lines .x-grid-td{border-bottom-width:1px}.x-grid-with-row-lines .x-grid-table{border-top:1px solid white}.x-grid-with-row-lines .x-grid-table-over-first{border-top-style:solid;border-top-color:#ddd}.x-grid-with-row-lines .x-grid-table-selected-first{border-top-style:dotted;border-top-color:#a3bae9}.x-grid-body .x-grid-table-focused-first{border-top:1px dotted #464646}.x-grid-cell-inner{text-overflow:ellipsis;padding:3px 6px 4px 6px}.x-grid-no-row-lines .x-grid-row-focused .x-grid-cell-inner{padding-top:2px;padding-bottom:3px}.x-grid-cell-special{border-color:#ededed #d0d0d0 #ededed #d0d0d0;border-style:solid;border-right-width:1px;background-image:none;background-color:#f6f6f6;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f6f6f6),color-stop(100%,#e9e9e9));background-image:-webkit-linear-gradient(top,#f6f6f6,#e9e9e9);background-image:-moz-linear-gradient(top,#f6f6f6,#e9e9e9);background-image:-o-linear-gradient(top,#f6f6f6,#e9e9e9);background-image:linear-gradient(top,#f6f6f6,#e9e9e9)}.x-grid-row-selected .x-grid-cell-special{border-right-color:#ededed #aaccf6;background-image:none;background-color:#dfe8f6;background-image:-webkit-gradient(linear,0% 50%,100% 50%,color-stop(0%,#dfe8f6),color-stop(100%,#cbdaf0));background-image:-webkit-linear-gradient(left,#dfe8f6,#cbdaf0);background-image:-moz-linear-gradient(left,#dfe8f6,#cbdaf0);background-image:-o-linear-gradient(left,#dfe8f6,#cbdaf0);background-image:linear-gradient(left,#dfe8f6,#cbdaf0)}.x-nlg .x-grid-cell-special{background-repeat:repeat-y;background-image:url(images/grid/cell-special-bg.gif)}.x-nlg .x-grid-row-selected .x-grid-cell-special{background-image:url(images/grid/cell-special-selected-bg.gif)}.x-grid-cell-special .x-grid-cell-special:after{display:none;content:"x-slicer:bg:url(images/grid/cell-special-bg.gif)"}.x-grid-cell-special .x-grid-cell-special-selected:after{display:none;content:"x-slicer:bg:url(images/grid/cell-special-selected-bg.gif)"}.x-grid-dirty-cell{background:url(images/grid/dirty.gif) no-repeat 0 0}.x-grid-row .x-grid-cell-selected{color:null;background-color:#b8cfee}.x-grid-with-col-lines .x-grid-cell{border-right-width:1px}.x-grid-resize-marker{width:1px;background-color:#0f0f0f}.x-grid-drop-indicator{position:absolute;height:1px;line-height:0;background-color:#77bc71;overflow:visible;pointer-events:none}.x-grid-drop-indicator .x-grid-drop-indicator-left{position:absolute;top:-8px;left:-12px;background-image:url(images/grid/dd-insert-arrow-right.png);height:16px;width:16px}.x-grid-drop-indicator .x-grid-drop-indicator-right{position:absolute;top:-8px;right:-11px;background-image:url(images/grid/dd-insert-arrow-left.png);height:16px;width:16px}.x-ie6 .x-grid-drop-indicator-left{background-image:url(images/grid/dd-insert-arrow-right.gif)}.x-ie6 .x-grid-drop-indicator-right{background-image:url(images/grid/dd-insert-arrow-left.gif)}.col-move-top,.col-move-bottom{width:9px;height:9px}.col-move-top{background-image:url(images/grid/col-move-top.gif)}.col-move-bottom{background-image:url(images/grid/col-move-bottom.gif)}.x-grid-header-ct{border:1px solid #99bce8;border-bottom-color:#c5c5c5;background-color:#c5c5c5;background-image:none;background-color:#c5c5c5;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f9f9f9),color-stop(100%,#e3e4e6));background-image:-webkit-linear-gradient(top,#f9f9f9,#e3e4e6);background-image:-moz-linear-gradient(top,#f9f9f9,#e3e4e6);background-image:-o-linear-gradient(top,#f9f9f9,#e3e4e6);background-image:linear-gradient(top,#f9f9f9,#e3e4e6)}.x-accordion-item .x-grid-header-ct{border-width:0 0 1px!important}.x-accordion-item .x-grid-header-ct-hidden{border:0!important}.x-grid-body{border-top-color:#c5c5c5}.x-hmenu-sort-asc .x-menu-item-icon{background-image:url(images/grid/hmenu-asc.gif)}.x-hmenu-sort-desc .x-menu-item-icon{background-image:url(images/grid/hmenu-desc.gif)}.x-cols-icon .x-menu-item-icon{background-image:url(images/grid/columns.gif)}.x-column-header{border-right:1px solid #c5c5c5;color:black;font:normal 11px/13px tahoma,arial,verdana,sans-serif;background-image:none;background-color:#c5c5c5;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f9f9f9),color-stop(100%,#e3e4e6));background-image:-webkit-linear-gradient(top,#f9f9f9,#e3e4e6);background-image:-moz-linear-gradient(top,#f9f9f9,#e3e4e6);background-image:-o-linear-gradient(top,#f9f9f9,#e3e4e6);background-image:linear-gradient(top,#f9f9f9,#e3e4e6)}.x-group-sub-header{background:transparent;border-top:1px solid #c5c5c5}.x-group-sub-header .x-column-header-inner{padding:3px 6px 5px 6px}.x-column-header-inner{padding:4px 6px 5px 6px;text-overflow:ellipsis}.x-column-header-over,.x-column-header-sort-ASC,.x-column-header-sort-DESC{background-image:none;background-color:#aaccf6;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#ebf3fd),color-stop(39%,#ebf3fd),color-stop(40%,#d9e8fb),color-stop(100%,#d9e8fb));background-image:-webkit-linear-gradient(top,#ebf3fd,#ebf3fd 39%,#d9e8fb 40%,#d9e8fb);background-image:-moz-linear-gradient(top,#ebf3fd,#ebf3fd 39%,#d9e8fb 40%,#d9e8fb);background-image:-o-linear-gradient(top,#ebf3fd,#ebf3fd 39%,#d9e8fb 40%,#d9e8fb);background-image:linear-gradient(top,#ebf3fd,#ebf3fd 39%,#d9e8fb 40%,#d9e8fb)}.x-nlg .x-grid-header-ct,.x-nlg .x-column-header{background-image:url(images/grid/column-header-bg.gif)}.x-nlg .x-column-header-over,.x-nlg .x-column-header-sort-ASC,.x-nlg .x-column-header-sort-DESC{background-image:url(images/grid/column-header-over-bg.gif)}.x-column-header-open{background-color:transparent}.x-column-header-open .x-column-header-trigger{background-color:transparent}.x-column-header-trigger{width:14px;cursor:pointer;background-color:transparent;background-position:0 center}.x-column-header-align-right .x-column-header-text{margin-right:9px}.x-column-header-sort-ASC .x-column-header-text,.x-column-header-sort-DESC .x-column-header-text{padding-right:12px;background-position:right center}.x-column-header-sort-ASC .x-column-header-text{background-image:url(images/grid/sort_asc.gif)}.x-column-header-sort-DESC .x-column-header-text{background-image:url(images/grid/sort_desc.gif)}.x-column-header:after{display:none;content:"x-slicer:bg:url(images/grid/column-header-bg.gif), stretch:bottom"}.x-column-header-over:after{display:none;content:"x-slicer:bg:url(images/grid/column-header-over-bg.gif), stretch:bottom"}.x-grid-cell-inner-action-col{padding:2px 2px 2px 2px}.x-grid-no-row-lines .x-grid-row-focused .x-grid-cell-inner-action-col{padding-top:1px;padding-bottom:1px}.x-action-col-cell .x-item-disabled{filter:alpha(opacity=30);opacity:.3}.x-action-col-icon{height:16px;width:16px;cursor:pointer}.x-grid-cell-inner-checkcolumn{padding:4px 6px 3px 6px}.x-grid-no-row-lines .x-grid-row-focused .x-grid-cell-inner-checkcolumn{padding-top:3px;padding-bottom:2px}.x-grid-checkcolumn{width:13px;height:13px;background:url(images/form/checkbox.gif) 0 0 no-repeat}.x-item-disabled .x-grid-checkcolumn{filter:alpha(opacity=30);opacity:.3}.x-grid-checkcolumn-checked{background-position:0 -13px}.x-grid-cell-inner-row-numberer{padding:3px 5px 4px 3px}.x-grid-group-hd{border-width:0 0 2px 0;border-style:solid;border-color:#99bbe8;padding:10px 4px 4px 4px;background:white;cursor:pointer}.x-grid-group-hd-not-collapsible{cursor:default}.x-grid-group-hd-collapsible .x-grid-group-title{background-repeat:no-repeat;background-position:left center;background-image:url(images/grid/group-collapse.gif);padding:0 0 0 14px}.x-grid-group-title{color:#3764a0;font:bold 11px/13px tahoma,arial,verdana,sans-serif}.x-grid-group-hd-collapsed .x-grid-group-title{background-image:url(images/grid/group-expand.gif)}.x-grid-group-collapsed .x-grid-group-title{background-image:url(images/grid/group-expand.gif)}.x-group-by-icon{background-image:url(images/grid/group-by.gif)}.x-show-groups-icon{background-image:url(images/grid/group-by.gif)}.x-grid-rowbody{font:normal 11px/13px tahoma,arial,verdana,sans-serif;padding:5px 6px 5px 6px}.x-grid-no-row-lines .x-grid-row-focused .x-grid-rowbody{padding-top:6px;padding-bottom:4px}.x-grid-rowwrap{border-color:#ededed #d0d0d0 #ededed #d0d0d0;border-style:solid}.x-summary-bottom{border-bottom-color:#c5c5c5}.x-docked-summary{border-width:1px;border-color:#99bce8;border-style:solid}.x-docked-summary .x-grid-table{width:100%}.x-grid-row-summary .x-grid-cell,.x-grid-row-summary .x-grid-rowwrap,.x-grid-row-summary .x-grid-cell-rowbody{border-color:#ededed #d0d0d0 #ededed #d0d0d0;background-color:transparent!important;border-top-width:0;font:normal 11px/13px tahoma,arial,verdana,sans-serif}.x-grid-with-row-lines .x-grid-table-summary{border:0}.x-grid-locked .x-grid-inner-locked{border-width:0 1px 0 0;border-style:solid}.x-grid-inner-locked .x-column-header-last,.x-grid-inner-locked .x-grid-cell-last{border-right-width:0!important}.x-hmenu-lock .x-menu-item-icon{background-image:url(images/grid/hmenu-lock.gif)}.x-hmenu-unlock .x-menu-item-icon{background-image:url(images/grid/hmenu-unlock.gif)}.x-grid-editor .x-form-text{font:normal 11px/15px tahoma,arial,verdana,sans-serif;padding:1px 5px 2px 5px;height:20px}.x-content-box .x-grid-editor .x-form-text{height:15px}.x-gecko .x-grid-editor .x-form-text{padding-left:4px;padding-right:4px}.x-grid-editor .x-form-trigger{height:20px}.x-grid-editor .x-form-spinner-up,.x-grid-editor .x-form-spinner-down{height:10px}.x-grid-editor .x-form-cb{margin-top:4px}.x-grid-editor .x-form-cb-wrap{height:20px}.x-grid-editor .x-form-display-field-body{height:20px}.x-grid-editor .x-form-display-field{font:normal 11px/15px tahoma,arial,verdana,sans-serif;padding:2px 6px 3px 6px;text-overflow:ellipsis}.x-grid-editor .x-form-action-col-field{padding:2px 2px 2px 2px}.x-tree-cell-editor .x-form-text{padding-left:2px;padding-right:2px}.x-gecko .x-tree-cell-editor .x-form-text{padding-left:1px;padding-right:1px}.x-grid-row-editor .x-field{margin:0 1px 0 1px}.x-grid-row-editor .x-form-display-field{padding:2px 5px 3px 5px}.x-grid-row-editor .x-form-action-col-field{padding:2px 1px 2px 1px}.x-grid-row-editor .x-form-text{padding:1px 4px 2px 4px}.x-gecko .x-grid-row-editor .x-form-text{padding-left:3px;padding-right:3px}.x-grid-row-editor .x-panel-body{border-top:1px solid #99bce8!important;border-bottom:1px solid #99bce8!important;padding:4px 0 4px 0;background-color:#eaf1fb}.x-grid-with-col-lines .x-grid-row-editor .x-form-cb{margin-right:1px}.x-grid-row-editor-buttons-default-bottom{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px;-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;border-bottom-left-radius:5px;padding:4px 4px 4px 4px;border-width:0 1px 1px 1px;border-style:solid;background-color:#eaf1fb}.x-grid-row-editor-buttons-default-bottom-mc{background-color:#eaf1fb}.x-nbr .x-grid-row-editor-buttons-default-bottom{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-grid-row-editor-buttons-default-bottom-frameInfo{font-family:th-0-0-5-5-0-1-1-1-4-4-4-4}.x-grid-row-editor-buttons-default-bottom-tl{background-position:0 -10px}.x-grid-row-editor-buttons-default-bottom-tr{background-position:right -15px}.x-grid-row-editor-buttons-default-bottom-bl{background-position:0 -20px}.x-grid-row-editor-buttons-default-bottom-br{background-position:right -25px}.x-grid-row-editor-buttons-default-bottom-ml{background-position:0 top}.x-grid-row-editor-buttons-default-bottom-mr{background-position:right top}.x-grid-row-editor-buttons-default-bottom-tc{background-position:0 0}.x-grid-row-editor-buttons-default-bottom-bc{background-position:0 -5px}.x-grid-row-editor-buttons-default-bottom-tr,.x-grid-row-editor-buttons-default-bottom-br,.x-grid-row-editor-buttons-default-bottom-mr{padding-right:5px}.x-grid-row-editor-buttons-default-bottom-tl,.x-grid-row-editor-buttons-default-bottom-bl,.x-grid-row-editor-buttons-default-bottom-ml{padding-left:5px}.x-grid-row-editor-buttons-default-bottom-tc{height:0}.x-grid-row-editor-buttons-default-bottom-bc{height:5px}.x-grid-row-editor-buttons-default-bottom-tl,.x-grid-row-editor-buttons-default-bottom-bl,.x-grid-row-editor-buttons-default-bottom-tr,.x-grid-row-editor-buttons-default-bottom-br,.x-grid-row-editor-buttons-default-bottom-tc,.x-grid-row-editor-buttons-default-bottom-bc,.x-grid-row-editor-buttons-default-bottom-ml,.x-grid-row-editor-buttons-default-bottom-mr{zoom:1;background-image:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-bottom-corners.gif)}.x-grid-row-editor-buttons-default-bottom-ml,.x-grid-row-editor-buttons-default-bottom-mr{zoom:1;background-image:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-bottom-sides.gif);background-repeat:repeat-y}.x-grid-row-editor-buttons-default-bottom-mc{padding:4px 0 0 0}.x-strict .x-ie7 .x-grid-row-editor-buttons-default-bottom-tl,.x-strict .x-ie7 .x-grid-row-editor-buttons-default-bottom-bl{position:relative;right:0}.x-grid-row-editor-buttons-default-bottom:after{display:none;content:"x-slicer:corners:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-bottom-corners.gif), sides:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-bottom-sides.gif)"}.x-grid-row-editor-buttons-default-top{-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;border-top-left-radius:5px;-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:4px 4px 4px 4px;border-width:1px 1px 0 1px;border-style:solid;background-color:#eaf1fb}.x-grid-row-editor-buttons-default-top-mc{background-color:#eaf1fb}.x-nbr .x-grid-row-editor-buttons-default-top{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent}body.x-nbr .x-grid-row-editor-buttons-default-top-frameInfo{font-family:th-5-5-0-0-1-1-0-1-4-4-4-4}.x-grid-row-editor-buttons-default-top-tl{background-position:0 -10px}.x-grid-row-editor-buttons-default-top-tr{background-position:right -15px}.x-grid-row-editor-buttons-default-top-bl{background-position:0 -20px}.x-grid-row-editor-buttons-default-top-br{background-position:right -25px}.x-grid-row-editor-buttons-default-top-ml{background-position:0 top}.x-grid-row-editor-buttons-default-top-mr{background-position:right top}.x-grid-row-editor-buttons-default-top-tc{background-position:0 0}.x-grid-row-editor-buttons-default-top-bc{background-position:0 -5px}.x-grid-row-editor-buttons-default-top-tr,.x-grid-row-editor-buttons-default-top-br,.x-grid-row-editor-buttons-default-top-mr{padding-right:5px}.x-grid-row-editor-buttons-default-top-tl,.x-grid-row-editor-buttons-default-top-bl,.x-grid-row-editor-buttons-default-top-ml{padding-left:5px}.x-grid-row-editor-buttons-default-top-tc{height:5px}.x-grid-row-editor-buttons-default-top-bc{height:0}.x-grid-row-editor-buttons-default-top-tl,.x-grid-row-editor-buttons-default-top-bl,.x-grid-row-editor-buttons-default-top-tr,.x-grid-row-editor-buttons-default-top-br,.x-grid-row-editor-buttons-default-top-tc,.x-grid-row-editor-buttons-default-top-bc,.x-grid-row-editor-buttons-default-top-ml,.x-grid-row-editor-buttons-default-top-mr{zoom:1;background-image:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-top-corners.gif)}.x-grid-row-editor-buttons-default-top-ml,.x-grid-row-editor-buttons-default-top-mr{zoom:1;background-image:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-top-sides.gif);background-repeat:repeat-y}.x-grid-row-editor-buttons-default-top-mc{padding:0 0 4px 0}.x-strict .x-ie7 .x-grid-row-editor-buttons-default-top-tl,.x-strict .x-ie7 .x-grid-row-editor-buttons-default-top-bl{position:relative;right:0}.x-grid-row-editor-buttons-default-top:after{display:none;content:"x-slicer:corners:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-top-corners.gif), sides:url(images/grid-row-editor-buttons/grid-row-editor-buttons-default-top-sides.gif)"}.x-grid-row-editor-buttons-default-bottom{top:29px}.x-grid-row-editor-buttons-default-top{bottom:29px}.x-grid-row-editor-buttons{border-color:#99bce8}.x-row-editor-update-button{margin-right:2px}.x-row-editor-cancel-button{margin-left:2px}.x-grid-row-editor-errors .x-tip-body{padding:5px}.x-grid-row-editor-errors-item{list-style:disc;margin-left:15px}.x-grid-cell-inner-row-expander{padding:6px 7px 5px 7px}.x-grid-no-row-lines .x-grid-row-focused .x-grid-cell-inner-row-expander{padding-top:5px;padding-bottom:4px}.x-grid-row-expander{width:9px;height:9px;cursor:pointer;background-image:url(images/grid/group-collapse.gif)}.x-grid-row-collapsed .x-grid-row-expander{background-image:url(images/grid/group-expand.gif)}.x-grid-cell-inner-property-name{background-image:url(images/grid/property-cell-bg.gif);background-repeat:no-repeat;background-position:-16px 2px;padding-left:12px}.x-accordion-layout-ct{background-color:white;padding:0}.x-accordion-hd .x-panel-header-text-container{color:black;font-weight:normal;font-family:tahoma,arial,verdana,sans-serif;text-transform:none}.x-accordion-item{margin:0}.x-accordion-item .x-accordion-hd{background:#d9e7f8;border-top-color:#f3f7fb;padding:4px 5px 5px 5px}.x-accordion-item .x-accordion-hd-sibling-expanded{border-top-color:#99bce8}.x-accordion-item .x-accordion-hd-last-collapsed{border-bottom-color:#d9e7f8}.x-accordion-item .x-accordion-body{border-width:0}.x-accordion-hd .x-tool-collapse-top,.x-accordion-hd .x-tool-collapse-bottom{background-position:0 -255px}.x-accordion-hd .x-tool-expand-top,.x-accordion-hd .x-tool-expand-bottom{background-position:0 -240px}.x-accordion-hd .x-tool-over .x-tool-collapse-top,.x-accordion-hd .x-tool-over .x-tool-collapse-bottom{background-position:-15px -255px}.x-accordion-hd .x-tool-over .x-tool-expand-top,.x-accordion-hd .x-tool-over .x-tool-expand-bottom{background-position:-15px -240px}.x-accordion-hd .x-tool-img{background-color:#d9e7f8}.x-collapse-el{cursor:pointer}.x-layout-split-left,.x-layout-split-right{top:50%;margin-top:-18px;width:5px;height:35px}.x-layout-split-top,.x-layout-split-bottom{left:50%;width:35px;height:5px;margin-left:-18px}.x-layout-split-left{background-image:url(images/util/splitter/mini-left.gif)}.x-layout-split-right{background-image:url(images/util/splitter/mini-right.gif)}.x-layout-split-top{background-image:url(images/util/splitter/mini-top.gif)}.x-layout-split-bottom{background-image:url(images/util/splitter/mini-bottom.gif)}.x-splitter-collapsed .x-layout-split-left{background-image:url(images/util/splitter/mini-right.gif)}.x-splitter-collapsed .x-layout-split-right{background-image:url(images/util/splitter/mini-left.gif)}.x-splitter-collapsed .x-layout-split-top{background-image:url(images/util/splitter/mini-bottom.gif)}.x-splitter-collapsed .x-layout-split-bottom{background-image:url(images/util/splitter/mini-top.gif)}.x-splitter-active{background-color:#b4b4b4;filter:alpha(opacity=80);opacity:.8}.x-splitter-active .x-collapse-el{filter:alpha(opacity=30);opacity:.3}.x-border-layout-ct{background-color:#dfe8f6}.x-menu-body{background:#f0f0f0;padding:2px}.x-menu-icon-separator{left:24px;border-left:solid 1px #e0e0e0;background-color:white;width:2px}.x-menu-item{padding:1px;cursor:pointer}.x-menu-item-indent{margin-left:30px}.x-menu-item-active{background-image:none;background-color:#d9e8fb;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e7f0fc),color-stop(100%,#c7ddf9));background-image:-webkit-linear-gradient(top,#e7f0fc,#c7ddf9);background-image:-moz-linear-gradient(top,#e7f0fc,#c7ddf9);background-image:-o-linear-gradient(top,#e7f0fc,#c7ddf9);background-image:linear-gradient(top,#e7f0fc,#c7ddf9);border-color:#a9cbf5;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;padding:0}.x-nlg .x-menu-item-active{background:#d9e8fb repeat-x left top;background-image:url(images/menu/menu-item-active-bg.gif)}.x-menu-item-link{line-height:22px;padding:0 0 0 30px;display:inline-block}.x-right-check-item-text{padding-right:22px}.x-menu-item-icon{width:16px;height:16px;top:4px;left:3px;background-position:center center}.x-menu-item-glyph{font-size:16px;line-height:16px;color:#222;opacity:.5}.x-ie8m .x-menu-item-glyph{color:#898989}.x-gecko .x-menu-item-active .x-menu-item-icon,.x-quirks .x-menu-item-active .x-menu-item-icon,.x-ie9m .x-menu-item-active .x-menu-item-icon{top:3px;left:2px}.x-menu-item-icon-right{width:16px;height:16px;top:3px;right:3px;background-position:center center}.x-menu-item-text{font-size:11px;color:#222;cursor:pointer;margin-right:16px}.x-menu-item-checked .x-menu-item-icon,.x-menu-item-checked .x-menu-item-icon-right{background-image:url(images/menu/checked.gif)}.x-menu-item-checked .x-menu-group-icon{background-image:url(images/menu/group-checked.gif)}.x-menu-item-unchecked .x-menu-item-icon,.x-menu-item-unchecked .x-menu-item-icon-right{background-image:url(images/menu/unchecked.gif)}.x-menu-item-unchecked .x-menu-group-icon{background-image:none}.x-menu-item-separator{height:2px;border-top:solid 1px #e0e0e0;background-color:white;margin:2px 0;padding:0}.x-menu-item-arrow{width:12px;height:9px;top:7px;right:0;background-image:url(images/menu/menu-parent.gif)}.x-gecko .x-menu-item-active .x-menu-item-arrow,.x-quirks .x-menu-item-active .x-menu-item-arrow,.x-ie9m .x-menu-item-active .x-menu-item-arrow{top:6px;right:-1px}.x-menu-item-disabled{filter:alpha(opacity=50);opacity:.5}.x-content-box .x-menu-icon-separator{width:1px}.x-content-box .x-menu-item-separator{height:1px}.x-ie .x-menu-item-disabled .x-menu-item-icon{filter:alpha(opacity=50);opacity:.5}.x-ie .x-menu-item-disabled .x-menu-item-text{background-color:transparent}.x-menu-date-item{border-color:#99bbe8}.x-menu-item .x-form-item-label{font-size:11px;color:#222}.x-menu-scroll-top{height:8px;background-image:url(images/menu/scroll-top.gif)}.x-menu-scroll-bottom{height:8px;background-image:url(images/menu/scroll-bottom.gif)}.x-menu-scroll-top,.x-menu-scroll-bottom{background-color:#f0f0f0}.x-menu-item-link:after{display:none;content:"x-slicer:bg:url(images/menu/menu-item-active-bg.gif)"}.x-tool{cursor:pointer}.x-tool-img{overflow:hidden;width:15px;height:15px;background-image:url(images/tools/tool-sprites.gif);margin:0}.x-tool-placeholder{visibility:hidden}.x-tool-close{background-position:0 0}.x-tool-minimize{background-position:0 -15px}.x-tool-maximize{background-position:0 -30px}.x-tool-restore{background-position:0 -45px}.x-tool-toggle{background-position:0 -60px}.x-panel-collapsed .x-tool-toggle{background-position:0 -75px}.x-tool-gear{background-position:0 -90px}.x-tool-prev{background-position:0 -105px}.x-tool-next{background-position:0 -120px}.x-tool-pin{background-position:0 -135px}.x-tool-unpin{background-position:0 -150px}.x-tool-right{background-position:0 -165px}.x-tool-left{background-position:0 -180px}.x-tool-down{background-position:0 -195px}.x-tool-up{background-position:0 -210px}.x-tool-refresh{background-position:0 -225px}.x-tool-plus{background-position:0 -240px}.x-tool-minus{background-position:0 -255px}.x-tool-search{background-position:0 -270px}.x-tool-save{background-position:0 -285px}.x-tool-help{background-position:0 -300px}.x-tool-print{background-position:0 -315px}.x-tool-expand{background-position:0 -330px}.x-tool-collapse{background-position:0 -345px}.x-tool-resize{background-position:0 -360px}.x-tool-move{background-position:0 -375px}.x-tool-expand-bottom,.x-tool-collapse-bottom{background-position:0 -195px}.x-tool-expand-top,.x-tool-collapse-top{background-position:0 -210px}.x-tool-expand-left,.x-tool-collapse-left{background-position:0 -180px}.x-tool-expand-right,.x-tool-collapse-right{background-position:0 -165px}.x-tool-over .x-tool-close{background-position:-15px 0}.x-tool-over .x-tool-minimize{background-position:-15px -15px}.x-tool-over .x-tool-maximize{background-position:-15px -30px}.x-tool-over .x-tool-restore{background-position:-15px -45px}.x-tool-over .x-tool-toggle{background-position:-15px -60px}.x-panel-collapsed .x-tool-over .x-tool-toggle{background-position:-15px -75px}.x-tool-over .x-tool-gear{background-position:-15px -90px}.x-tool-over .x-tool-prev{background-position:-15px -105px}.x-tool-over .x-tool-next{background-position:-15px -120px}.x-tool-over .x-tool-pin{background-position:-15px -135px}.x-tool-over .x-tool-unpin{background-position:-15px -150px}.x-tool-over .x-tool-right{background-position:-15px -165px}.x-tool-over .x-tool-left{background-position:-15px -180px}.x-tool-over .x-tool-down{background-position:-15px -195px}.x-tool-over .x-tool-up{background-position:-15px -210px}.x-tool-over .x-tool-refresh{background-position:-15px -225px}.x-tool-over .x-tool-plus{background-position:-15px -240px}.x-tool-over .x-tool-minus{background-position:-15px -255px}.x-tool-over .x-tool-search{background-position:-15px -270px}.x-tool-over .x-tool-save{background-position:-15px -285px}.x-tool-over .x-tool-help{background-position:-15px -300px}.x-tool-over .x-tool-print{background-position:-15px -315px}.x-tool-over .x-tool-expand{background-position:-15px -330px}.x-tool-over .x-tool-collapse{background-position:-15px -345px}.x-tool-over .x-tool-resize{background-position:-15px -360px}.x-tool-over .x-tool-move{background-position:-15px -375px}.x-tool-over .x-tool-expand-bottom,.x-tool-over .x-tool-collapse-bottom{background-position:-15px -195px}.x-tool-over .x-tool-expand-top,.x-tool-over .x-tool-collapse-top{background-position:-15px -210px}.x-tool-over .x-tool-expand-left,.x-tool-over .x-tool-collapse-left{background-position:-15px -180px}.x-tool-over .x-tool-expand-right,.x-tool-over .x-tool-collapse-right{background-position:-15px -165px}.x-resizable-handle{position:absolute;z-index:100;font-size:1px;line-height:6px;overflow:hidden;zoom:1;filter:alpha(opacity=0);opacity:0;background-color:#fff}.x-collapsed .x-resizable-handle{display:none}.x-resizable-over .x-resizable-handle-north{cursor:n-resize}.x-resizable-over .x-resizable-handle-south{cursor:s-resize}.x-resizable-over .x-resizable-handle-east{cursor:e-resize}.x-resizable-over .x-resizable-handle-west{cursor:w-resize}.x-resizable-over .x-resizable-handle-southeast{cursor:se-resize}.x-resizable-over .x-resizable-handle-northwest{cursor:nw-resize}.x-resizable-over .x-resizable-handle-northeast{cursor:ne-resize}.x-resizable-over .x-resizable-handle-southwest{cursor:sw-resize}.x-resizable-handle-east{width:6px;height:100%;right:0;top:0}.x-resizable-handle-south{width:100%;height:6px;left:0;bottom:0}.x-resizable-handle-west{width:6px;height:100%;left:0;top:0}.x-resizable-handle-north{width:100%;height:6px;left:0;top:0}.x-resizable-handle-southeast{width:6px;height:6px;right:0;bottom:0;z-index:101}.x-resizable-handle-northwest{width:6px;height:6px;left:0;top:0;z-index:101}.x-resizable-handle-northeast{width:6px;height:6px;right:0;top:0;z-index:101}.x-resizable-handle-southwest{width:6px;height:6px;left:0;bottom:0;z-index:101}.x-ie .x-resizable-handle-east{margin-right:-1px}.x-ie .x-resizable-handle-south{margin-bottom:-1px}.x-resizable-pinned .x-resizable-handle,.x-resizable-over .x-resizable-handle{filter:alpha(opacity=100);opacity:1}.x-window .x-window-handle{filter:alpha(opacity=0);opacity:0}.x-window-collapsed .x-window-handle{display:none}.x-resizable-proxy{border:1px dashed #3b5a82;position:absolute;overflow:hidden;z-index:50000}.x-resizable-over .x-resizable-handle-east,.x-resizable-over .x-resizable-handle-west,.x-resizable-pinned .x-resizable-handle-east,.x-resizable-pinned .x-resizable-handle-west{background-image:url(images/sizer/e-handle.gif)}.x-resizable-over .x-resizable-handle-south,.x-resizable-over .x-resizable-handle-north,.x-resizable-pinned .x-resizable-handle-south,.x-resizable-pinned .x-resizable-handle-north{background-image:url(images/sizer/s-handle.gif)}.x-resizable-over .x-resizable-handle-southeast,.x-resizable-pinned .x-resizable-handle-southeast{background-position:top left;background-image:url(images/sizer/se-handle.gif)}.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{background-position:bottom right;background-image:url(images/sizer/nw-handle.gif)}.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{background-position:bottom left;background-image:url(images/sizer/ne-handle.gif)}.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{background-position:top right;background-image:url(images/sizer/sw-handle.gif)}.x-slider-horz{padding-left:7px;background:no-repeat 0 -15px}.x-slider-horz .x-slider-end{padding-right:7px;background:no-repeat right -30px}.x-slider-horz .x-slider-inner{height:15px}.x-ie6 .x-form-item .x-slider-horz,.x-ie7 .x-form-item .x-slider-horz,.x-quirks .x-ie .x-form-item .x-slider-horz{margin-top:4px}.x-slider-horz .x-slider-thumb{width:14px;height:15px;margin-left:-7px;background-image:url(images/slider/slider-thumb.png)}.x-slider-horz .x-slider-thumb-over{background-position:-14px -15px}.x-slider-horz .x-slider-thumb-drag{background-position:-28px -30px}.x-slider-vert{padding-top:7px;background:no-repeat -30px 0}.x-slider-vert .x-slider-end{padding-bottom:7px;background:no-repeat -15px bottom;width:15px}.x-slider-vert .x-slider-inner{width:15px}.x-slider-vert .x-slider-thumb{width:15px;height:14px;margin-bottom:-7px;background-image:url(images/slider/slider-v-thumb.png)}.x-slider-vert .x-slider-thumb-over{background-position:-15px -14px}.x-slider-vert .x-slider-thumb-drag{background-position:-30px -28px}.x-slider-horz,.x-slider-horz .x-slider-end,.x-slider-horz .x-slider-inner{background-image:url(images/slider/slider-bg.png)}.x-slider-vert,.x-slider-vert .x-slider-end,.x-slider-vert .x-slider-inner{background-image:url(images/slider/slider-v-bg.png)}.x-tab-default-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:3px 9px 3px 9px;border-width:1px 1px 0 1px;border-style:solid;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#ccdef6),color-stop(25%,#d6e6fa),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-moz-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-o-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%)}.x-tab-default-top-mc{background-image:url(images/tab/tab-default-top-fbg.gif);background-position:0 top;background-color:#deecfd}.x-nlg .x-tab-default-top{background-image:url(images/tab/tab-default-top-bg.gif);background-position:0 top}.x-nbr .x-tab-default-top{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-tab-default-top-frameInfo{font-family:th-4-4-0-0-1-1-0-1-3-9-3-9}.x-tab-default-top-tl{background-position:0 -8px}.x-tab-default-top-tr{background-position:right -12px}.x-tab-default-top-bl{background-position:0 -16px}.x-tab-default-top-br{background-position:right -20px}.x-tab-default-top-ml{background-position:0 top}.x-tab-default-top-mr{background-position:right top}.x-tab-default-top-tc{background-position:0 0}.x-tab-default-top-bc{background-position:0 -4px}.x-tab-default-top-tr,.x-tab-default-top-br,.x-tab-default-top-mr{padding-right:4px}.x-tab-default-top-tl,.x-tab-default-top-bl,.x-tab-default-top-ml{padding-left:4px}.x-tab-default-top-tc{height:4px}.x-tab-default-top-bc{height:0}.x-tab-default-top-tl,.x-tab-default-top-bl,.x-tab-default-top-tr,.x-tab-default-top-br,.x-tab-default-top-tc,.x-tab-default-top-bc,.x-tab-default-top-ml,.x-tab-default-top-mr{zoom:1;background-image:url(images/tab/tab-default-top-corners.gif)}.x-tab-default-top-ml,.x-tab-default-top-mr{zoom:1;background-image:url(images/tab/tab-default-top-sides.gif)}.x-tab-default-top-mc{padding:0 6px 3px 6px}.x-strict .x-ie7 .x-tab-default-top-tl,.x-strict .x-ie7 .x-tab-default-top-bl{position:relative;right:0}.x-tab-default-top:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/tab/tab-default-top-fbg.gif), bg:url(images/tab/tab-default-top-bg.gif), corners:url(images/tab/tab-default-top-corners.gif), sides:url(images/tab/tab-default-top-sides.gif)"}.x-tab-default-bottom{-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;padding:3px 9px 3px 9px;border-width:0 1px 1px 1px;border-style:solid;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 100%,50% 0,color-stop(0%,#ccdef6),color-stop(25%,#d6e6fa),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-moz-linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-o-linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%)}.x-tab-default-bottom-mc{background-image:url(images/tab/tab-default-bottom-fbg.gif);background-position:0 top;background-color:#deecfd}.x-nlg .x-tab-default-bottom{background-image:url(images/tab/tab-default-bottom-bg.gif);background-position:0 top}.x-nbr .x-tab-default-bottom{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-tab-default-bottom-frameInfo{font-family:th-0-0-4-4-0-1-1-1-3-9-3-9}.x-tab-default-bottom-tl{background-position:0 -8px}.x-tab-default-bottom-tr{background-position:right -12px}.x-tab-default-bottom-bl{background-position:0 -16px}.x-tab-default-bottom-br{background-position:right -20px}.x-tab-default-bottom-ml{background-position:0 top}.x-tab-default-bottom-mr{background-position:right top}.x-tab-default-bottom-tc{background-position:0 0}.x-tab-default-bottom-bc{background-position:0 -4px}.x-tab-default-bottom-tr,.x-tab-default-bottom-br,.x-tab-default-bottom-mr{padding-right:4px}.x-tab-default-bottom-tl,.x-tab-default-bottom-bl,.x-tab-default-bottom-ml{padding-left:4px}.x-tab-default-bottom-tc{height:0}.x-tab-default-bottom-bc{height:4px}.x-tab-default-bottom-tl,.x-tab-default-bottom-bl,.x-tab-default-bottom-tr,.x-tab-default-bottom-br,.x-tab-default-bottom-tc,.x-tab-default-bottom-bc,.x-tab-default-bottom-ml,.x-tab-default-bottom-mr{zoom:1;background-image:url(images/tab/tab-default-bottom-corners.gif)}.x-tab-default-bottom-ml,.x-tab-default-bottom-mr{zoom:1;background-image:url(images/tab/tab-default-bottom-sides.gif)}.x-tab-default-bottom-mc{padding:3px 6px 0 6px}.x-strict .x-ie7 .x-tab-default-bottom-tl,.x-strict .x-ie7 .x-tab-default-bottom-bl{position:relative;right:0}.x-tab-default-bottom:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/tab/tab-default-bottom-fbg.gif), bg:url(images/tab/tab-default-bottom-bg.gif), corners:url(images/tab/tab-default-bottom-corners.gif), sides:url(images/tab/tab-default-bottom-sides.gif)"}.x-tab-default-left{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:3px 9px 3px 9px;border-width:1px 1px 0 1px;border-style:solid;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#ccdef6),color-stop(25%,#d6e6fa),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-moz-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-o-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%)}.x-tab-default-left-mc{background-image:url(images/tab/tab-default-top-fbg.gif);background-position:0 top;background-color:#deecfd}.x-nlg .x-tab-default-left{background-image:url(images/tab/tab-default-top-bg.gif);background-position:0 top}.x-nbr .x-tab-default-left{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-tab-default-left-frameInfo{font-family:th-4-4-0-0-1-1-0-1-3-9-3-9}.x-tab-default-left-tl{background-position:0 -8px}.x-tab-default-left-tr{background-position:right -12px}.x-tab-default-left-bl{background-position:0 -16px}.x-tab-default-left-br{background-position:right -20px}.x-tab-default-left-ml{background-position:0 top}.x-tab-default-left-mr{background-position:right top}.x-tab-default-left-tc{background-position:0 0}.x-tab-default-left-bc{background-position:0 -4px}.x-tab-default-left-tr,.x-tab-default-left-br,.x-tab-default-left-mr{padding-right:4px}.x-tab-default-left-tl,.x-tab-default-left-bl,.x-tab-default-left-ml{padding-left:4px}.x-tab-default-left-tc{height:4px}.x-tab-default-left-bc{height:0}.x-tab-default-left-tl,.x-tab-default-left-bl,.x-tab-default-left-tr,.x-tab-default-left-br,.x-tab-default-left-tc,.x-tab-default-left-bc,.x-tab-default-left-ml,.x-tab-default-left-mr{zoom:1;background-image:url(images/tab/tab-default-top-corners.gif)}.x-tab-default-left-ml,.x-tab-default-left-mr{zoom:1;background-image:url(images/tab/tab-default-top-sides.gif)}.x-tab-default-left-mc{padding:0 6px 3px 6px}.x-strict .x-ie7 .x-tab-default-left-tl,.x-strict .x-ie7 .x-tab-default-left-bl{position:relative;right:0}.x-tab-default-left:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/tab/tab-default-top-fbg.gif), bg:url(images/tab/tab-default-top-bg.gif), corners:url(images/tab/tab-default-top-corners.gif), sides:url(images/tab/tab-default-top-sides.gif)"}.x-tab-default-right{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;padding:3px 9px 3px 9px;border-width:1px 1px 0 1px;border-style:solid;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#ccdef6),color-stop(25%,#d6e6fa),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-moz-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-o-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%)}.x-tab-default-right-mc{background-image:url(images/tab/tab-default-top-fbg.gif);background-position:0 top;background-color:#deecfd}.x-nlg .x-tab-default-right{background-image:url(images/tab/tab-default-top-bg.gif);background-position:0 top}.x-nbr .x-tab-default-right{padding:0!important;border-width:0!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;background-color:transparent;background-image:none}body.x-nbr .x-tab-default-right-frameInfo{font-family:th-4-4-0-0-1-1-0-1-3-9-3-9}.x-tab-default-right-tl{background-position:0 -8px}.x-tab-default-right-tr{background-position:right -12px}.x-tab-default-right-bl{background-position:0 -16px}.x-tab-default-right-br{background-position:right -20px}.x-tab-default-right-ml{background-position:0 top}.x-tab-default-right-mr{background-position:right top}.x-tab-default-right-tc{background-position:0 0}.x-tab-default-right-bc{background-position:0 -4px}.x-tab-default-right-tr,.x-tab-default-right-br,.x-tab-default-right-mr{padding-right:4px}.x-tab-default-right-tl,.x-tab-default-right-bl,.x-tab-default-right-ml{padding-left:4px}.x-tab-default-right-tc{height:4px}.x-tab-default-right-bc{height:0}.x-tab-default-right-tl,.x-tab-default-right-bl,.x-tab-default-right-tr,.x-tab-default-right-br,.x-tab-default-right-tc,.x-tab-default-right-bc,.x-tab-default-right-ml,.x-tab-default-right-mr{zoom:1;background-image:url(images/tab/tab-default-top-corners.gif)}.x-tab-default-right-ml,.x-tab-default-right-mr{zoom:1;background-image:url(images/tab/tab-default-top-sides.gif)}.x-tab-default-right-mc{padding:0 6px 3px 6px}.x-strict .x-ie7 .x-tab-default-right-tl,.x-strict .x-ie7 .x-tab-default-right-bl{position:relative;right:0}.x-tab-default-right:after{display:none;content:"x-slicer:stretch:bottom, frame-bg:url(images/tab/tab-default-top-fbg.gif), bg:url(images/tab/tab-default-top-bg.gif), corners:url(images/tab/tab-default-top-corners.gif), sides:url(images/tab/tab-default-top-sides.gif)"}.x-tab-default{border-color:#8db3e3;margin:0 0 0 2px;cursor:pointer}.x-tab-default .x-tab-inner{font-size:11px;font-weight:bold;font-family:tahoma,arial,verdana,sans-serif;color:#416da3;line-height:13px}.x-tab-default .x-tab-icon-el{width:16px;height:16px;line-height:16px;background-position:center center}.x-tab-default .x-tab-glyph{font-size:16px;color:#416da3;opacity:.5}.x-ie8m .x-tab-default .x-tab-glyph{color:#8facd0}.x-strict .x-ie9 .x-tab-bar-vertical .x-tab-default{padding-left:0}.x-strict .x-ie9 .x-tab-bar-vertical .x-tab-default .x-tab-button{padding-left:9px}.x-strict .x-ie9 .x-tab-bar-vertical .x-tab-default .x-tab-icon-el{left:9px}.x-tab-default-icon .x-tab-inner{width:16px}.x-tab-default-left{margin:0 2px 0 0}.x-tab-default-top,.x-tab-default-left,.x-tab-default-right{border-bottom:1px solid #99bce8;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#ccdef6),color-stop(25%,#d6e6fa),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-moz-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-o-linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:linear-gradient(top,#ccdef6,#d6e6fa 25%,#deecfd 45%);-webkit-box-shadow:white 0 1px 0 0 inset,white -1px 0 0 0 inset,white 1px 0 0 0 inset;-moz-box-shadow:white 0 1px 0 0 inset,white -1px 0 0 0 inset,white 1px 0 0 0 inset;box-shadow:white 0 1px 0 0 inset,white -1px 0 0 0 inset,white 1px 0 0 0 inset}.x-nlg .x-tab-default-top,.x-nlg .x-tab-default-left,.x-nlg .x-tab-default-right{background-image:url(images/tab/tab-default-top-bg.gif)}.x-tab-default-bottom{border-top:1px solid #99bce8;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 100%,50% 0,color-stop(0%,#ccdef6),color-stop(25%,#d6e6fa),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-moz-linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:-o-linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);background-image:linear-gradient(bottom,#ccdef6,#d6e6fa 25%,#deecfd 45%);-webkit-box-shadow:white 0 -1px 0 0 inset,white -1px 0 0 0 inset,white 1px 0 0 0 inset;-moz-box-shadow:white 0 -1px 0 0 inset,white -1px 0 0 0 inset,white 1px 0 0 0 inset;box-shadow:white 0 -1px 0 0 inset,white -1px 0 0 0 inset,white 1px 0 0 0 inset}.x-nlg .x-tab-default-bottom{background-image:url(images/tab/tab-default-bottom-bg.gif)}.x-tab-default-left{-webkit-transform:rotate(270deg);-webkit-transform-origin:100% 0;-moz-transform:rotate(270deg);-moz-transform-origin:100% 0;-o-transform:rotate(270deg);-o-transform-origin:100% 0;transform:rotate(270deg);transform-origin:100% 0}.x-ie9m .x-tab-default-left{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}.x-tab-default-right{-webkit-transform:rotate(90deg);-webkit-transform-origin:0 0;-moz-transform:rotate(90deg);-moz-transform-origin:0 0;-o-transform:rotate(90deg);-o-transform-origin:0 0;transform:rotate(90deg);transform-origin:0 0}.x-ie9m .x-tab-default-right{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)}.x-tab-default-icon-text-left .x-tab-inner{padding-left:20px}.x-tab-default-over{background-color:#e8f2ff}.x-tab-default-over .x-tab-glyph{color:#416da3}.x-ie8m .x-tab-default-over .x-tab-glyph{color:#94afd1}.x-tab-default-top-over,.x-tab-default-left-over,.x-tab-default-right-over{background-image:none;background-color:#e8f2ff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#d7e5fd),color-stop(25%,#e0edff),color-stop(45%,#e8f2ff));background-image:-webkit-linear-gradient(top,#d7e5fd,#e0edff 25%,#e8f2ff 45%);background-image:-moz-linear-gradient(top,#d7e5fd,#e0edff 25%,#e8f2ff 45%);background-image:-o-linear-gradient(top,#d7e5fd,#e0edff 25%,#e8f2ff 45%);background-image:linear-gradient(top,#d7e5fd,#e0edff 25%,#e8f2ff 45%)}.x-nlg .x-tab-default-top-over,.x-nlg .x-tab-default-left-over,.x-nlg .x-tab-default-right-over{background-image:url(images/tab/tab-default-top-over-bg.gif)}.x-tab-default-bottom-over{background-image:none;background-color:#e8f2ff;background-image:-webkit-gradient(linear,50% 100%,50% 0,color-stop(0%,#d7e5fd),color-stop(25%,#e0edff),color-stop(45%,#e8f2ff));background-image:-webkit-linear-gradient(bottom,#d7e5fd,#e0edff 25%,#e8f2ff 45%);background-image:-moz-linear-gradient(bottom,#d7e5fd,#e0edff 25%,#e8f2ff 45%);background-image:-o-linear-gradient(bottom,#d7e5fd,#e0edff 25%,#e8f2ff 45%);background-image:linear-gradient(bottom,#d7e5fd,#e0edff 25%,#e8f2ff 45%)}.x-nlg .x-tab-default-bottom-over{background-image:url(images/tab/tab-default-bottom-over-bg.gif)}.x-tab-default-active{background-color:#deecfd}.x-tab-default-active .x-tab-inner{color:#15498b}.x-tab-default-active .x-tab-glyph{color:#15498b}.x-ie8m .x-tab-default-active .x-tab-glyph{color:#799ac4}.x-tab-default-top-active,.x-tab-default-left-active,.x-tab-default-right-active{border-bottom:1px solid #deecfd;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#fff),color-stop(25%,#f5f9fe),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(top,#fff,#f5f9fe 25%,#deecfd 45%);background-image:-moz-linear-gradient(top,#fff,#f5f9fe 25%,#deecfd 45%);background-image:-o-linear-gradient(top,#fff,#f5f9fe 25%,#deecfd 45%);background-image:linear-gradient(top,#fff,#f5f9fe 25%,#deecfd 45%)}.x-nlg .x-tab-default-top-active,.x-nlg .x-tab-default-left-active,.x-nlg .x-tab-default-right-active{background-image:url(images/tab/tab-default-top-active-bg.gif)}.x-tab-default-bottom-active{border-top:1px solid #deecfd;background-image:none;background-color:#deecfd;background-image:-webkit-gradient(linear,50% 100%,50% 0,color-stop(0%,#fff),color-stop(25%,#f5f9fe),color-stop(45%,#deecfd));background-image:-webkit-linear-gradient(bottom,#fff,#f5f9fe 25%,#deecfd 45%);background-image:-moz-linear-gradient(bottom,#fff,#f5f9fe 25%,#deecfd 45%);background-image:-o-linear-gradient(bottom,#fff,#f5f9fe 25%,#deecfd 45%);background-image:linear-gradient(bottom,#fff,#f5f9fe 25%,#deecfd 45%)}.x-nlg .x-tab-default-bottom-active{background-image:url(images/tab/tab-default-bottom-active-bg.gif)}.x-tab-default-disabled{border-color:#bbd2ef;cursor:default}.x-tab-default-disabled .x-tab-inner{color:#c3b3b3}.x-tab-default-disabled .x-tab-icon-el{filter:alpha(opacity=50);opacity:.5}.x-tab-default-disabled .x-tab-glyph{color:#c3b3b3;opacity:.3;filter:none}.x-ie8m .x-tab-default-disabled .x-tab-glyph{color:#d8dae4}.x-tab-default-top-disabled,.x-tab-default-left-disabled,.x-tab-default-right-disabled{border-color:#bbd2ef #bbd2ef #99bce8}.x-tab-default-bottom-disabled{border-color:#99bce8 #bbd2ef #bbd2ef #bbd2ef}.x-tab-default-top-disabled,.x-tab-default-left-disabled,.x-tab-default-right-disabled{background-image:none;background-color:#e1ecfa;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#e1ecfa),color-stop(100%,#ecf4fe));background-image:-webkit-linear-gradient(top,#e1ecfa,#ecf4fe);background-image:-moz-linear-gradient(top,#e1ecfa,#ecf4fe);background-image:-o-linear-gradient(top,#e1ecfa,#ecf4fe);background-image:linear-gradient(top,#e1ecfa,#ecf4fe)}.x-nlg .x-tab-default-top-disabled,.x-nlg .x-tab-default-left-disabled,.x-nlg .x-tab-default-right-disabled{background-image:url(images/tab/tab-default-top-disabled-bg.gif)}.x-tab-default-bottom-disabled{background-image:none;background-color:#e1ecfa;background-image:-webkit-gradient(linear,50% 100%,50% 0,color-stop(0%,#e1ecfa),color-stop(100%,#ecf4fe));background-image:-webkit-linear-gradient(bottom,#e1ecfa,#ecf4fe);background-image:-moz-linear-gradient(bottom,#e1ecfa,#ecf4fe);background-image:-o-linear-gradient(bottom,#e1ecfa,#ecf4fe);background-image:linear-gradient(bottom,#e1ecfa,#ecf4fe)}.x-nlg .x-tab-default-bottom-disabled{background-image:url(images/tab/tab-default-bottom-disabled-bg.gif)}.x-nbr .x-tab-default{background-image:none}.x-tab-default-top-over .x-frame-tl,.x-tab-default-top-over .x-frame-bl,.x-tab-default-top-over .x-frame-tr,.x-tab-default-top-over .x-frame-br,.x-tab-default-top-over .x-frame-tc,.x-tab-default-top-over .x-frame-bc,.x-tab-default-left-over .x-frame-tl,.x-tab-default-left-over .x-frame-bl,.x-tab-default-left-over .x-frame-tr,.x-tab-default-left-over .x-frame-br,.x-tab-default-left-over .x-frame-tc,.x-tab-default-left-over .x-frame-bc,.x-tab-default-right-over .x-frame-tl,.x-tab-default-right-over .x-frame-bl,.x-tab-default-right-over .x-frame-tr,.x-tab-default-right-over .x-frame-br,.x-tab-default-right-over .x-frame-tc,.x-tab-default-right-over .x-frame-bc{background-image:url(images/tab/tab-default-top-over-corners.gif)}.x-tab-default-top-over .x-frame-ml,.x-tab-default-top-over .x-frame-mr,.x-tab-default-left-over .x-frame-ml,.x-tab-default-left-over .x-frame-mr,.x-tab-default-right-over .x-frame-ml,.x-tab-default-right-over .x-frame-mr{background-image:url(images/tab/tab-default-top-over-sides.gif)}.x-tab-default-top-over .x-frame-mc,.x-tab-default-left-over .x-frame-mc,.x-tab-default-right-over .x-frame-mc{background-color:#e8f2ff;background-repeat:repeat-x;background-image:url(images/tab/tab-default-top-over-fbg.gif)}.x-tab-default-bottom-over .x-frame-tl,.x-tab-default-bottom-over .x-frame-bl,.x-tab-default-bottom-over .x-frame-tr,.x-tab-default-bottom-over .x-frame-br,.x-tab-default-bottom-over .x-frame-tc,.x-tab-default-bottom-over .x-frame-bc{background-image:url(images/tab/tab-default-bottom-over-corners.gif)}.x-tab-default-bottom-over .x-frame-ml,.x-tab-default-bottom-over .x-frame-mr{background-image:url(images/tab/tab-default-bottom-over-sides.gif)}.x-tab-default-bottom-over .x-frame-mc{background-color:#e8f2ff;background-repeat:repeat-x;background-image:url(images/tab/tab-default-bottom-over-fbg.gif)}.x-tab-default-top-active .x-frame-tl,.x-tab-default-top-active .x-frame-bl,.x-tab-default-top-active .x-frame-tr,.x-tab-default-top-active .x-frame-br,.x-tab-default-top-active .x-frame-tc,.x-tab-default-top-active .x-frame-bc,.x-tab-default-left-active .x-frame-tl,.x-tab-default-left-active .x-frame-bl,.x-tab-default-left-active .x-frame-tr,.x-tab-default-left-active .x-frame-br,.x-tab-default-left-active .x-frame-tc,.x-tab-default-left-active .x-frame-bc,.x-tab-default-right-active .x-frame-tl,.x-tab-default-right-active .x-frame-bl,.x-tab-default-right-active .x-frame-tr,.x-tab-default-right-active .x-frame-br,.x-tab-default-right-active .x-frame-tc,.x-tab-default-right-active .x-frame-bc{background-image:url(images/tab/tab-default-top-active-corners.gif)}.x-tab-default-top-active .x-frame-ml,.x-tab-default-top-active .x-frame-mr,.x-tab-default-left-active .x-frame-ml,.x-tab-default-left-active .x-frame-mr,.x-tab-default-right-active .x-frame-ml,.x-tab-default-right-active .x-frame-mr{background-image:url(images/tab/tab-default-top-active-sides.gif)}.x-tab-default-top-active .x-frame-mc,.x-tab-default-left-active .x-frame-mc,.x-tab-default-right-active .x-frame-mc{background-color:#deecfd;background-repeat:repeat-x;background-image:url(images/tab/tab-default-top-active-fbg.gif)}.x-tab-default-bottom-active .x-frame-tl,.x-tab-default-bottom-active .x-frame-bl,.x-tab-default-bottom-active .x-frame-tr,.x-tab-default-bottom-active .x-frame-br,.x-tab-default-bottom-active .x-frame-tc,.x-tab-default-bottom-active .x-frame-bc{background-image:url(images/tab/tab-default-bottom-active-corners.gif)}.x-tab-default-bottom-active .x-frame-ml,.x-tab-default-bottom-active .x-frame-mr{background-image:url(images/tab/tab-default-bottom-active-sides.gif)}.x-tab-default-bottom-active .x-frame-mc{background-color:#deecfd;background-repeat:repeat-x;background-image:url(images/tab/tab-default-bottom-active-fbg.gif)}.x-tab-default-top-disabled .x-frame-tl,.x-tab-default-top-disabled .x-frame-bl,.x-tab-default-top-disabled .x-frame-tr,.x-tab-default-top-disabled .x-frame-br,.x-tab-default-top-disabled .x-frame-tc,.x-tab-default-top-disabled .x-frame-bc,.x-tab-default-left-disabled .x-frame-tl,.x-tab-default-left-disabled .x-frame-bl,.x-tab-default-left-disabled .x-frame-tr,.x-tab-default-left-disabled .x-frame-br,.x-tab-default-left-disabled .x-frame-tc,.x-tab-default-left-disabled .x-frame-bc,.x-tab-default-right-disabled .x-frame-tl,.x-tab-default-right-disabled .x-frame-bl,.x-tab-default-right-disabled .x-frame-tr,.x-tab-default-right-disabled .x-frame-br,.x-tab-default-right-disabled .x-frame-tc,.x-tab-default-right-disabled .x-frame-bc{background-image:url(images/tab/tab-default-top-disabled-corners.gif)}.x-tab-default-top-disabled .x-frame-ml,.x-tab-default-top-disabled .x-frame-mr,.x-tab-default-left-disabled .x-frame-ml,.x-tab-default-left-disabled .x-frame-mr,.x-tab-default-right-disabled .x-frame-ml,.x-tab-default-right-disabled .x-frame-mr{background-image:url(images/tab/tab-default-top-disabled-sides.gif)}.x-tab-default-top-disabled .x-frame-mc,.x-tab-default-left-disabled .x-frame-mc,.x-tab-default-right-disabled .x-frame-mc{background-color:#e1ecfa;background-repeat:repeat-x;background-image:url(images/tab/tab-default-top-disabled-fbg.gif)}.x-tab-default-bottom-disabled .x-frame-tl,.x-tab-default-bottom-disabled .x-frame-bl,.x-tab-default-bottom-disabled .x-frame-tr,.x-tab-default-bottom-disabled .x-frame-br,.x-tab-default-bottom-disabled .x-frame-tc,.x-tab-default-bottom-disabled .x-frame-bc{background-image:url(images/tab/tab-default-bottom-disabled-corners.gif)}.x-tab-default-bottom-disabled .x-frame-ml,.x-tab-default-bottom-disabled .x-frame-mr{background-image:url(images/tab/tab-default-bottom-disabled-sides.gif)}.x-tab-default-bottom-disabled .x-frame-mc{background-color:#e1ecfa;background-repeat:repeat-x;background-image:url(images/tab/tab-default-bottom-disabled-fbg.gif)}.x-nbr .x-tab-default-top,.x-nbr .x-tab-default-left,.x-nbr .x-tab-default-right{border-bottom-width:1px!important}.x-nbr .x-tab-default-bottom{border-top-width:1px!important}.x-tab-default .x-tab-close-btn{width:11px;height:11px;background-image:url(images/tab/tab-default-close.gif);filter:alpha(opacity=60);opacity:.6}.x-tab-default .x-tab-close-btn-over{filter:alpha(opacity=100);opacity:1}.x-tab-default .x-tab-close-btn{top:2px;right:2px}.x-tab-default-disabled .x-tab-close-btn{filter:alpha(opacity=30);opacity:.3}.x-tab-default-closable .x-tab-wrap{padding-right:14px}.x-tab-default-top-over:after{display:none;content:"x-slicer:bg:url(images/tab/tab-default-top-over-bg.gif), corners:url(images/tab/tab-default-top-over-corners.gif), sides:url(images/tab/tab-default-top-over-sides.gif), frame-bg:url(images/tab/tab-default-top-over-fbg.gif)"}.x-tab-default-bottom-over:after{display:none;content:"x-slicer:bg:url(images/tab/tab-default-bottom-over-bg.gif), corners:url(images/tab/tab-default-bottom-over-corners.gif), sides:url(images/tab/tab-default-bottom-over-sides.gif), frame-bg:url(images/tab/tab-default-bottom-over-fbg.gif)"}.x-tab-default-top-active:after{display:none;content:"x-slicer:bg:url(images/tab/tab-default-top-active-bg.gif), corners:url(images/tab/tab-default-top-active-corners.gif), sides:url(images/tab/tab-default-top-active-sides.gif), frame-bg:url(images/tab/tab-default-top-active-fbg.gif)"}.x-tab-default-bottom-active:after{display:none;content:"x-slicer:bg:url(images/tab/tab-default-bottom-active-bg.gif), corners:url(images/tab/tab-default-bottom-active-corners.gif), sides:url(images/tab/tab-default-bottom-active-sides.gif), frame-bg:url(images/tab/tab-default-bottom-active-fbg.gif)"}.x-tab-default-top-disabled:after{display:none;content:"x-slicer:bg:url(images/tab/tab-default-top-disabled-bg.gif), corners:url(images/tab/tab-default-top-disabled-corners.gif), sides:url(images/tab/tab-default-top-disabled-sides.gif), frame-bg:url(images/tab/tab-default-top-disabled-fbg.gif)"}.x-tab-default-bottom-disabled:after{display:none;content:"x-slicer:bg:url(images/tab/tab-default-bottom-disabled-bg.gif), corners:url(images/tab/tab-default-bottom-disabled-corners.gif), sides:url(images/tab/tab-default-bottom-disabled-sides.gif), frame-bg:url(images/tab/tab-default-bottom-disabled-fbg.gif)"}.x-tab-bar-default{border-style:solid;border-color:#99bce8}.x-tab-bar-default-top{padding:1px 0 0;border-width:1px 1px 0}.x-tab-bar-default-bottom{padding:0 0 1px 0;border-width:0 1px 1px 1px}.x-tab-bar-default-left{padding:0 0 0 1px;border-width:1px 0 1px 1px}.x-tab-bar-default-right{padding:0 1px 0 0;border-width:1px 1px 1px 0}.x-tab-bar-default-horizontal{height:25px}.x-content-box .x-tab-bar-default-horizontal{height:23px}.x-tab-bar-default-vertical{width:25px}.x-content-box .x-tab-bar-default-vertical{width:23px}.x-tab-bar-body-default-top{padding-bottom:2px}.x-tab-bar-body-default-bottom{padding-top:2px}.x-tab-bar-body-default-left{padding-right:2px}.x-tab-bar-body-default-right{padding-left:2px}.x-tab-bar-strip-default{border-style:solid;border-color:#99bce8;background-color:#deecfd}.x-content-box .x-tab-bar-strip-default-horizontal{height:2px}.x-content-box .x-tab-bar-strip-default-vertical{width:2px}.x-tab-bar-strip-default-top{border-width:1px 0 0 0;height:3px}.x-tab-bar-plain .x-tab-bar-strip-default-top{border-width:1px 1px 0}.x-tab-bar-strip-default-bottom{border-width:0 0 1px 0;height:3px}.x-tab-bar-plain .x-tab-bar-strip-default-bottom{border-width:0 1px 1px 1px}.x-tab-bar-strip-default-left{border-width:0 0 0 1px;width:3px}.x-tab-bar-plain .x-tab-bar-strip-default-left{border-width:1px 0 1px 1px}.x-tab-bar-strip-default-right{border-width:0 1px 0 0;width:3px}.x-tab-bar-plain .x-tab-bar-strip-default-right{border-width:1px 1px 1px 0}.x-tab-bar-default{background-color:#cbdbef}.x-tab-bar-default-top{background-image:none;background-color:#cbdbef;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#dde8f5),color-stop(100%,#cbdbef));background-image:-webkit-linear-gradient(top,#dde8f5,#cbdbef);background-image:-moz-linear-gradient(top,#dde8f5,#cbdbef);background-image:-o-linear-gradient(top,#dde8f5,#cbdbef);background-image:linear-gradient(top,#dde8f5,#cbdbef)}.x-nlg .x-tab-bar-default-top{background:url(images/tab-bar/tab-bar-default-top-bg.gif)}.x-tab-bar-default-bottom{background-image:none;background-color:#cbdbef;background-image:-webkit-gradient(linear,50% 100%,50% 0,color-stop(0%,#dde8f5),color-stop(100%,#cbdbef));background-image:-webkit-linear-gradient(bottom,#dde8f5,#cbdbef);background-image:-moz-linear-gradient(bottom,#dde8f5,#cbdbef);background-image:-o-linear-gradient(bottom,#dde8f5,#cbdbef);background-image:linear-gradient(bottom,#dde8f5,#cbdbef)}.x-nlg .x-tab-bar-default-bottom{background:url(images/tab-bar/tab-bar-default-bottom-bg.gif) bottom 0}.x-tab-bar-default-left{background-image:none;background-color:#cbdbef;background-image:-webkit-gradient(linear,0% 50%,100% 50%,color-stop(0%,#dde8f5),color-stop(100%,#cbdbef));background-image:-webkit-linear-gradient(left,#dde8f5,#cbdbef);background-image:-moz-linear-gradient(left,#dde8f5,#cbdbef);background-image:-o-linear-gradient(left,#dde8f5,#cbdbef);background-image:linear-gradient(left,#dde8f5,#cbdbef)}.x-nlg .x-tab-bar-default-left{background:url(images/tab-bar/tab-bar-default-left-bg.gif)}.x-tab-bar-default-right{background-image:none;background-color:#cbdbef;background-image:-webkit-gradient(linear,100% 50%,0% 50%,color-stop(0%,#dde8f5),color-stop(100%,#cbdbef));background-image:-webkit-linear-gradient(right,#dde8f5,#cbdbef);background-image:-moz-linear-gradient(right,#dde8f5,#cbdbef);background-image:-o-linear-gradient(right,#dde8f5,#cbdbef);background-image:linear-gradient(right,#dde8f5,#cbdbef)}.x-nlg .x-tab-bar-default-right{background:url(images/tab-bar/tab-bar-default-right-bg.gif) 0 right}.x-tab-bar-default .x-box-scroller{cursor:pointer}.x-tab-bar-default .x-tabbar-scroll-left,.x-tab-bar-default .x-tabbar-scroll-right{height:20px;width:18px}.x-tab-bar-default .x-tabbar-scroll-top,.x-tab-bar-default .x-tabbar-scroll-bottom{width:20px;height:18px}.x-tab-bar-default-bottom .x-box-scroller{margin-top:1px}.x-tab-bar-default-right .x-box-scroller{margin-left:1px}.x-tab-bar-default-top .x-tabbar-scroll-left{background-image:url(images/tab-bar/default-scroll-left-top.gif)}.x-tab-bar-default-top .x-tabbar-scroll-right{background-image:url(images/tab-bar/default-scroll-right-top.gif)}.x-tab-bar-default-bottom .x-tabbar-scroll-left{background-image:url(images/tab-bar/default-scroll-left-bottom.gif)}.x-tab-bar-default-bottom .x-tabbar-scroll-right{background-image:url(images/tab-bar/default-scroll-right-bottom.gif)}.x-tab-bar-default-left .x-tabbar-scroll-top{background-image:url(images/tab-bar/default-scroll-top-left.gif)}.x-tab-bar-default-left .x-tabbar-scroll-bottom{background-image:url(images/tab-bar/default-scroll-bottom-left.gif)}.x-tab-bar-default-right .x-tabbar-scroll-top{background-image:url(images/tab-bar/default-scroll-top-right.gif)}.x-tab-bar-default-right .x-tabbar-scroll-bottom{background-image:url(images/tab-bar/default-scroll-bottom-right.gif)}.x-tab-bar-default .x-tabbar-scroll-left-hover,.x-tab-bar-default .x-tabbar-scroll-right-hover{background-position:-18px 0}.x-tab-bar-default .x-tabbar-scroll-top-hover,.x-tab-bar-default .x-tabbar-scroll-bottom-hover{background-position:0 -18px}.x-tab-bar-default .x-box-scroller-disabled{filter:alpha(opacity=50);opacity:.5;cursor:default}.x-tab-bar-default-top:after{display:none;content:"x-slicer:bg:url(images/tab-bar/tab-bar-default-top-bg.gif), stretch:bottom"}.x-tab-bar-default-bottom:after{display:none;content:"x-slicer:bg:url(images/tab-bar/tab-bar-default-bottom-bg.gif), stretch:top"}.x-tab-bar-default-left:after{display:none;content:"x-slicer:bg:url(images/tab-bar/tab-bar-default-left-bg.gif), stretch:right"}.x-tab-bar-default-right:after{display:none;content:"x-slicer:bg:url(images/tab-bar/tab-bar-default-right-bg.gif), stretch:left"}.x-tab-bar-plain{border-width:0;padding:0;height:23px}.x-column-header-checkbox{border-color:#c5c5c5}.x-grid-row-checker,.x-column-header-checkbox .x-column-header-text{height:13px;width:13px;background-image:url(images/form/checkbox.gif);line-height:13px}.x-column-header-checkbox .x-column-header-inner{padding:5px 5px 4px 5px}.x-grid-cell-row-checker .x-grid-cell-inner{padding:4px 5px 3px 5px}.x-grid-no-row-lines .x-grid-row-focused .x-grid-cell-row-checker .x-grid-cell-inner{padding-top:3px;padding-bottom:2px}.x-grid-hd-checker-on .x-column-header-text,.x-grid-row-selected .x-grid-row-checker,.x-grid-row-checked .x-grid-row-checker{background-position:0 -13px}.x-tree-expander{cursor:pointer}.x-tree-arrows .x-tree-expander{background-image:url(images/tree/arrows.gif)}.x-tree-arrows .x-tree-expander-over .x-tree-expander{background-position:-32px center}.x-tree-arrows .x-grid-tree-node-expanded .x-tree-expander{background-position:-16px center}.x-tree-arrows .x-grid-tree-node-expanded .x-tree-expander-over .x-tree-expander{background-position:-48px center}.x-tree-lines .x-tree-elbow{background-image:url(images/tree/elbow.gif)}.x-tree-lines .x-tree-elbow-end{background-image:url(images/tree/elbow-end.gif)}.x-tree-lines .x-tree-elbow-plus{background-image:url(images/tree/elbow-plus.gif)}.x-tree-lines .x-tree-elbow-end-plus{background-image:url(images/tree/elbow-end-plus.gif)}.x-tree-lines .x-grid-tree-node-expanded .x-tree-elbow-plus{background-image:url(images/tree/elbow-minus.gif)}.x-tree-lines .x-grid-tree-node-expanded .x-tree-elbow-end-plus{background-image:url(images/tree/elbow-end-minus.gif)}.x-tree-lines .x-tree-elbow-line{background-image:url(images/tree/elbow-line.gif)}.x-tree-no-row-lines .x-tree-expander{background-image:url(images/tree/elbow-plus-nl.gif)}.x-tree-no-row-lines .x-grid-tree-node-expanded .x-tree-expander{background-image:url(images/tree/elbow-minus-nl.gif)}.x-tree-icon{width:16px;height:20px}.x-tree-elbow-img{width:16px;height:20px;margin-right:0}.x-tree-icon,.x-tree-elbow-img,.x-tree-checkbox{margin-top:-3px;margin-bottom:-4px}.x-tree-icon-leaf{background-image:url(images/tree/leaf.gif)}.x-tree-icon-parent{background-image:url(images/tree/folder.gif)}.x-grid-tree-node-expanded .x-tree-icon-parent{background-image:url(images/tree/folder-open.gif)}.x-tree-checkbox{margin-right:3px;top:4px;width:13px;height:13px;background-image:url(images/form/checkbox.gif)}.x-tree-checkbox-checked{background-position:0 -13px}.x-grid-tree-loading .x-tree-icon{background-image:url(images/tree/loading.gif)}.x-grid-cell-inner-treecolumn{font-size:1px;line-height:0}.x-tree-node-text{font-size:11px;line-height:13px;padding-left:3px}.x-grid-cell-inner-treecolumn{padding:3px 6px 4px 0}.x-tree-drop-ok-append .x-dd-drop-icon{background-image:url(images/tree/drop-append.gif)}.x-tree-drop-ok-above .x-dd-drop-icon{background-image:url(images/tree/drop-above.gif)}.x-tree-drop-ok-below .x-dd-drop-icon{background-image:url(images/tree/drop-below.gif)}.x-tree-drop-ok-between .x-dd-drop-icon{background-image:url(images/tree/drop-between.gif)}.x-tree-ddindicator{height:1px;border-width:1px 0 0;border-style:dotted;border-color:green}.x-box-tl{background:transparent no-repeat 0 0;zoom:1}.x-box-tc{height:8px;background:transparent repeat-x 0 0;overflow:hidden}.x-box-tr{background:transparent no-repeat right -8px}.x-box-ml{background:transparent repeat-y 0;padding-left:4px;overflow:hidden;zoom:1}.x-box-mc{background:repeat-x 0 -16px;padding:4px 10px}.x-box-mc h3{margin:0 0 4px 0;zoom:1}.x-box-mr{background:transparent repeat-y right;padding-right:4px;overflow:hidden}.x-box-bl{background:transparent no-repeat 0 -16px;zoom:1}.x-box-bc{background:transparent repeat-x 0 -8px;height:8px;overflow:hidden}.x-box-br{background:transparent no-repeat right -24px}.x-box-tl,.x-box-bl{padding-left:8px;overflow:hidden}.x-box-tr,.x-box-br{padding-right:8px;overflow:hidden}.x-box-tl{background-image:url(images/box/corners.gif)}.x-box-tc{background-image:url(images/box/tb.gif)}.x-box-tr{background-image:url(images/box/corners.gif)}.x-box-ml{background-image:url(images/box/l.gif)}.x-box-mc{background-color:#eee;background-image:url(images/box/tb.gif);font-family:"Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;color:#393939;font-size:15px}.x-box-mc h3{font-size:18px;font-weight:bold}.x-box-mr{background-image:url(images/box/r.gif)}.x-box-bl{background-image:url(images/box/corners.gif)}.x-box-bc{background-image:url(images/box/tb.gif)}.x-box-br{background-image:url(images/box/corners.gif)}.x-box-blue .x-box-bl,.x-box-blue .x-box-br,.x-box-blue .x-box-tl,.x-box-blue .x-box-tr{background-image:url(images/box/corners-blue.gif)}.x-box-blue .x-box-bc,.x-box-blue .x-box-mc,.x-box-blue .x-box-tc{background-image:url(images/box/tb-blue.gif)}.x-box-blue .x-box-mc{background-color:#c3daf9}.x-box-blue .x-box-mc h3{color:#17385b}.x-box-blue .x-box-ml{background-image:url(images/box/l-blue.gif)}.x-box-blue .x-box-mr{background-image:url(images/box/r-blue.gif)}.x-message-box .x-msg-box-wait{background-image:url(images/shared/blue-loading.gif)}.x-form-trigger{height:22px}.x-content-box .x-form-trigger{height:21px}.x-field-toolbar .x-form-trigger{height:20px}.x-content-box .x-field-toolbar .x-form-trigger{height:19px}.x-content-box div.x-form-spinner-up,.x-content-box div.x-form-spinner-down{height:10px}.x-content-box .x-toolbar-item div.x-form-spinner-up,.x-content-box .x-toolbar-item div.x-form-spinner-down{height:9px}.x-html-editor-wrap .x-toolbar{border-left-color:#b5b8c8;border-top-color:#b5b8c8;border-right-color:#b5b8c8}.x-html-editor-input{border:1px solid #b5b8c8;border-top-width:0}.x-column-header-trigger{background-color:#c5c5c5;background-image:url(images/grid/grid3-hd-btn.gif)}.x-content-box .x-grid-editor .x-form-trigger{height:19px}.x-grid-editor .x-form-spinner-up,.x-grid-editor .x-form-spinner-down{background-image:url(images/form/spinner-small.gif)}.x-content-box .x-grid-editor .x-form-spinner-up,.x-content-box .x-grid-editor .x-form-spinner-down{height:9px}.x-accordion-hd{border-width:1px 0!important;-webkit-box-shadow:inset 0 0 0 0 #d9e7f8;-moz-box-shadow:inset 0 0 0 0 #d9e7f8;box-shadow:inset 0 0 0 0 #d9e7f8}.x-accordion-hd-sibling-expanded{-webkit-box-shadow:inset 0 1px 0 0 #f3f7fb;-moz-box-shadow:inset 0 1px 0 0 #f3f7fb;box-shadow:inset 0 1px 0 0 #f3f7fb}.x-resizable-over .x-resizable-handle-east,.x-resizable-over .x-resizable-handle-west,.x-resizable-pinned .x-resizable-handle-east,.x-resizable-pinned .x-resizable-handle-west{background-position:left}.x-resizable-over .x-resizable-handle-south,.x-resizable-over .x-resizable-handle-north,.x-resizable-pinned .x-resizable-handle-south,.x-resizable-pinned .x-resizable-handle-north{background-position:top}.x-resizable-over .x-resizable-handle-southeast,.x-resizable-pinned .x-resizable-handle-southeast{background-position:top left}.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{background-position:bottom right}.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{background-position:bottom left}.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{background-position:top right}.x-ie6 .x-slider-horz,.x-ie6 .x-slider-horz .x-slider-end,.x-ie6 .x-slider-horz .x-slider-inner{background-image:url(images/slider/slider-bg.gif)}.x-ie6 .x-slider-horz .x-slider-thumb{background-image:url(images/slider/slider-thumb.gif)}.x-ie6 .x-slider-vert,.x-ie6 .x-slider-vert .x-slider-end,.x-ie6 .x-slider-vert .x-slider-inner{background-image:url(images/slider/slider-v-bg.gif)}.x-ie6 .x-slider-vert .x-slider-thumb{background-image:url(images/slider/slider-v-thumb.gif)}.x-tab-icon-el{top:-1px}.x-tab-noicon .x-tab-icon{display:none}.vendor-add {background:url('../../resources/themes/images/default/dd/drop-add.gif');}
js/amosoft/extjs/css/images/boundlist/trigger-arrow.png ADDED
Binary file
js/amosoft/extjs/css/images/box/corners-blue.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/corners.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/l-blue.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/l.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/r-blue.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/r.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/tb-blue.gif ADDED
Binary file
js/amosoft/extjs/css/images/box/tb.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/arrow.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/btn.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/group-cs.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/group-lr.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/group-tb.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow-b-noline.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow-b.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow-bo.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow-light.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow-noline.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow-o.gif ADDED
Binary file
js/amosoft/extjs/css/images/button/s-arrow.gif ADDED
Binary file
js/amosoft/extjs/css/images/datepicker/datepicker-footer-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/datepicker/datepicker-footer-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/datepicker/datepicker-header-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/datepicker/datepicker-header-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/dd/drop-add.gif ADDED
Binary file
js/amosoft/extjs/css/images/dd/drop-no.gif ADDED
Binary file
js/amosoft/extjs/css/images/dd/drop-yes.gif ADDED
Binary file
js/amosoft/extjs/css/images/editor/tb-sprite.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/checkbox.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/clear-trigger.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/date-trigger.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/error-tip-corners.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/exclamation.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/radio.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/search-trigger.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/spinner-small.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/spinner.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/text-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/trigger-square.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/trigger-tpl.gif ADDED
Binary file
js/amosoft/extjs/css/images/form/trigger.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/arrow-left-white.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/arrow-right-white.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/cell-special-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/cell-special-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/cell-special-selected-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/cell-special-selected-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/checked.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/col-move-bottom.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/col-move-top.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/column-header-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/column-header-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/column-header-over-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/column-header-over-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/columns.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/dd-insert-arrow-left.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/dd-insert-arrow-left.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/dd-insert-arrow-right.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/dd-insert-arrow-right.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/dirty.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/done.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/drop-no.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/drop-yes.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/footer-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid-blue-hd.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid-blue-split.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid-hrow.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid-loading.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid-split.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid-vista-hd.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid3-hd-btn.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid3-hrow-over.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid3-hrow.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/grid3-rowheader.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/group-by.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/group-collapse.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/group-expand-sprite.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/group-expand.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/hd-pop.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/hmenu-asc.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/hmenu-desc.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/hmenu-lock.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/hmenu-lock.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/hmenu-unlock.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/hmenu-unlock.png ADDED
Binary file
js/amosoft/extjs/css/images/grid/invalid_line.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/loading.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/mso-hd.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/nowait.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-first-disabled.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-first.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-last-disabled.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-last.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-next-disabled.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-next.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-prev-disabled.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/page-prev.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/pick-button.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/property-cell-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/property-cell-selected-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/refresh-disabled.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/refresh.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/row-check-sprite.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/row-expand-sprite.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/row-over.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/row-sel.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/sort-hd.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/sort_asc.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/sort_desc.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/unchecked.gif ADDED
Binary file
js/amosoft/extjs/css/images/grid/wait.gif ADDED
Binary file
js/amosoft/extjs/css/images/layout/mini-bottom.gif ADDED
Binary file
js/amosoft/extjs/css/images/layout/mini-left.gif ADDED
Binary file
js/amosoft/extjs/css/images/layout/mini-right.gif ADDED
Binary file
js/amosoft/extjs/css/images/layout/mini-top.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/checked.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/group-checked.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/item-over.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/menu-item-active-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/menu-item-active-corners.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/menu-item-active-sides.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/menu-parent.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/menu.gif ADDED
Binary file
js/amosoft/extjs/css/images/menu/unchecked.gif ADDED
Binary file
js/amosoft/extjs/css/images/progress/progress-default-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/blue-loading.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/calendar.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/glass-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/hd-sprite.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/icon-error.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/icon-info.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/icon-question.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/icon-warning.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/large-loading.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/left-btn.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/loading-balls.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/right-btn.gif ADDED
Binary file
js/amosoft/extjs/css/images/shared/shadow-c.png ADDED
Binary file
js/amosoft/extjs/css/images/shared/shadow-lr.png ADDED
Binary file
js/amosoft/extjs/css/images/shared/shadow.png ADDED
Binary file
js/amosoft/extjs/css/images/shared/warning.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/e-handle-dark.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/e-handle.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/ne-handle-dark.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/ne-handle.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/nw-handle-dark.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/nw-handle.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/s-handle-dark.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/s-handle.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/se-handle-dark.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/se-handle.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/square.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/sw-handle-dark.gif ADDED
Binary file
js/amosoft/extjs/css/images/sizer/sw-handle.gif ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-thumb.gif ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-thumb.png ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-v-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-v-bg.png ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-v-thumb.gif ADDED
Binary file
js/amosoft/extjs/css/images/slider/slider-v-thumb.png ADDED
Binary file
js/amosoft/extjs/css/images/tab-bar/scroll-left.gif ADDED
Binary file
js/amosoft/extjs/css/images/tab-bar/scroll-right.gif ADDED
Binary file
js/amosoft/extjs/css/images/tab-bar/tab-bar-default-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/tip/tip-corners.gif ADDED
Binary file
js/amosoft/extjs/css/images/tip/tip-sides.gif ADDED
Binary file
js/amosoft/extjs/css/images/toolbar/more.gif ADDED
Binary file
js/amosoft/extjs/css/images/toolbar/scroll-left.gif ADDED
Binary file
js/amosoft/extjs/css/images/toolbar/scroll-right.gif ADDED
Binary file
js/amosoft/extjs/css/images/toolbar/toolbar-default-bg.gif ADDED
Binary file
js/amosoft/extjs/css/images/tools/tool-sprite-tpl.gif ADDED
Binary file
js/amosoft/extjs/css/images/tools/tool-sprites.gif ADDED
Binary file
js/amosoft/extjs/css/images/tools/tools-sprites-trans.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/arrows.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-above.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-add.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-append.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-below.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-between.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-no.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-over.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-under.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/drop-yes.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-end-minus-nl.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-end-minus.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-end-plus-nl.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-end-plus.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-end.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-line.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-minus-nl.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-minus.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-plus-nl.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow-plus.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/elbow.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/folder-open.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/folder.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/leaf.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/loading.gif ADDED
Binary file
js/amosoft/extjs/css/images/tree/s.gif ADDED
Binary file
js/amosoft/extjs/css/images/util/splitter/mini-bottom.gif ADDED
Binary file
js/amosoft/extjs/css/images/util/splitter/mini-left.gif ADDED
Binary file
js/amosoft/extjs/css/images/util/splitter/mini-right.gif ADDED
Binary file
js/amosoft/extjs/css/images/util/splitter/mini-top.gif ADDED
Binary file
js/amosoft/extjs/dnd_grid_to_grid.js ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Ext.require([
2
+ 'Ext.grid.*',
3
+ 'Ext.data.*',
4
+ 'Ext.dd.*'
5
+ ]);
6
+
7
+ Ext.define('DataObject', {
8
+ extend: 'Ext.data.Model',
9
+ fields: ['name', 'column1', 'column2']
10
+ });
11
+
12
+ Ext.onReady(function(){
13
+
14
+ var myData = [
15
+ { name : "Rec 0", column1 : "0", column2 : "0" },
16
+ { name : "Rec 1", column1 : "1", column2 : "1" },
17
+ { name : "Rec 2", column1 : "2", column2 : "2" },
18
+ { name : "Rec 3", column1 : "3", column2 : "3" },
19
+ { name : "Rec 4", column1 : "4", column2 : "4" },
20
+ { name : "Rec 5", column1 : "5", column2 : "5" },
21
+ { name : "Rec 6", column1 : "6", column2 : "6" },
22
+ { name : "Rec 7", column1 : "7", column2 : "7" },
23
+ { name : "Rec 8", column1 : "8", column2 : "8" },
24
+ { name : "Rec 9", column1 : "9", column2 : "9" }
25
+ ];
26
+
27
+ // create the data store
28
+ var firstGridStore = Ext.create('Ext.data.Store', {
29
+ model: 'DataObject',
30
+ data: myData
31
+ });
32
+
33
+
34
+ // Column Model shortcut array
35
+ var columns = [
36
+ {text: "Record Name", flex: 1, sortable: true, dataIndex: 'name'},
37
+ {text: "column1", width: 70, sortable: true, dataIndex: 'column1'},
38
+ {text: "column2", width: 70, sortable: true, dataIndex: 'column2'}
39
+ ];
40
+
41
+ // declare the source Grid
42
+ var firstGrid = Ext.create('Ext.grid.Panel', {
43
+ viewConfig: {
44
+ plugins: {
45
+ ptype: 'gridviewdragdrop',
46
+ dragGroup: 'firstGridDDGroup',
47
+ dropGroup: 'secondGridDDGroup'
48
+ },
49
+ listeners: {
50
+ drop: function(node, data, dropRec, dropPosition) {
51
+ var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
52
+ Ext.example.msg("Drag from right to left", 'Dropped ' + data.records[0].get('name') + dropOn);
53
+ }
54
+ }
55
+ },
56
+ store : firstGridStore,
57
+ columns : columns,
58
+ stripeRows : true,
59
+ title : 'First Grid',
60
+ margins : '0 2 0 0'
61
+ });
62
+
63
+ var secondGridStore = Ext.create('Ext.data.Store', {
64
+ model: 'DataObject'
65
+ });
66
+
67
+ // create the destination Grid
68
+ var secondGrid = Ext.create('Ext.grid.Panel', {
69
+ viewConfig: {
70
+ plugins: {
71
+ ptype: 'gridviewdragdrop',
72
+ dragGroup: 'secondGridDDGroup',
73
+ dropGroup: 'firstGridDDGroup'
74
+ },
75
+ listeners: {
76
+ drop: function(node, data, dropRec, dropPosition) {
77
+ var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
78
+ Ext.example.msg("Drag from left to right", 'Dropped ' + data.records[0].get('name') + dropOn);
79
+ }
80
+ }
81
+ },
82
+ store : secondGridStore,
83
+ columns : columns,
84
+ stripeRows : true,
85
+ title : 'Second Grid',
86
+ margins : '0 0 0 3'
87
+ });
88
+
89
+ //Simple 'border layout' panel to house both grids
90
+ var displayPanel = Ext.create('Ext.Panel', {
91
+ width : 650,
92
+ height : 300,
93
+ layout : {
94
+ type: 'hbox',
95
+ align: 'stretch',
96
+ padding: 5
97
+ },
98
+ renderTo : 'panel',
99
+ defaults : { flex : 1 }, //auto stretch
100
+ items : [
101
+ firstGrid,
102
+ secondGrid
103
+ ],
104
+ dockedItems: {
105
+ xtype: 'toolbar',
106
+ dock: 'bottom',
107
+ items: ['->', // Fill
108
+ {
109
+ text: 'Reset both grids',
110
+ handler: function(){
111
+ //refresh source grid
112
+ firstGridStore.loadData(myData);
113
+
114
+ //purge destination grid
115
+ secondGridStore.removeAll();
116
+ }
117
+ }]
118
+ }
119
+ });
120
+ });
js/amosoft/extjs/examples.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Ext.example = function(){
2
+ var msgCt;
3
+
4
+ function createBox(t, s){
5
+ // return ['<div class="msg">',
6
+ // '<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
7
+ // '<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', t, '</h3>', s, '</div></div></div>',
8
+ // '<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
9
+ // '</div>'].join('');
10
+ return '<div class="msg"><h3>' + t + '</h3><p>' + s + '</p></div>';
11
+ }
12
+ return {
13
+ msg : function(title, format){
14
+ if(!msgCt){
15
+ msgCt = Ext.core.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
16
+ }
17
+ var s = Ext.String.format.apply(String, Array.prototype.slice.call(arguments, 1));
18
+ var m = Ext.core.DomHelper.append(msgCt, createBox(title, s), true);
19
+ m.hide();
20
+ m.slideIn('t').ghost("t", { delay: 1000, remove: true});
21
+ },
22
+
23
+ init : function(){
24
+ // var t = Ext.get('exttheme');
25
+ // if(!t){ // run locally?
26
+ // return;
27
+ // }
28
+ // var theme = Cookies.get('exttheme') || 'aero';
29
+ // if(theme){
30
+ // t.dom.value = theme;
31
+ // Ext.getBody().addClass('x-'+theme);
32
+ // }
33
+ // t.on('change', function(){
34
+ // Cookies.set('exttheme', t.getValue());
35
+ // setTimeout(function(){
36
+ // window.location.reload();
37
+ // }, 250);
38
+ // });
39
+ //
40
+ // var lb = Ext.get('lib-bar');
41
+ // if(lb){
42
+ // lb.show();
43
+ // }
44
+ }
45
+ };
46
+ }();
47
+
48
+ Ext.example.shortBogusMarkup = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, '+
49
+ 'sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales '+
50
+ 'non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet '+
51
+ 'tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla.</p>';
52
+
53
+ Ext.example.bogusMarkup = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, '+
54
+ 'porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, '+
55
+ 'lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis '+
56
+ 'vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>'+
57
+ 'Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing '+
58
+ 'eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt '+
59
+ 'diam nec urna. Curabitur velit. Lorem ipsum dolor sit amet.</p>';
60
+
61
+ //Ext.onReady(Ext.example.init, Ext.example);
62
+
63
+
64
+ // old school cookie functions
65
+ var Cookies = {};
66
+ Cookies.set = function(name, value){
67
+ var argv = arguments;
68
+ var argc = arguments.length;
69
+ var expires = (argc > 2) ? argv[2] : null;
70
+ var path = (argc > 3) ? argv[3] : '/';
71
+ var domain = (argc > 4) ? argv[4] : null;
72
+ var secure = (argc > 5) ? argv[5] : false;
73
+ document.cookie = name + "=" + escape (value) +
74
+ ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
75
+ ((path == null) ? "" : ("; path=" + path)) +
76
+ ((domain == null) ? "" : ("; domain=" + domain)) +
77
+ ((secure == true) ? "; secure" : "");
78
+ };
79
+
80
+ Cookies.get = function(name){
81
+ var arg = name + "=";
82
+ var alen = arg.length;
83
+ var clen = document.cookie.length;
84
+ var i = 0;
85
+ var j = 0;
86
+ while(i < clen){
87
+ j = i + alen;
88
+ if (document.cookie.substring(i, j) == arg)
89
+ return Cookies.getCookieVal(j);
90
+ i = document.cookie.indexOf(" ", i) + 1;
91
+ if(i == 0)
92
+ break;
93
+ }
94
+ return null;
95
+ };
96
+
97
+ Cookies.clear = function(name) {
98
+ if(Cookies.get(name)){
99
+ document.cookie = name + "=" +
100
+ "; expires=Thu, 01-Jan-70 00:00:01 GMT";
101
+ }
102
+ };
103
+
104
+ Cookies.getCookieVal = function(offset){
105
+ var endstr = document.cookie.indexOf(";", offset);
106
+ if(endstr == -1){
107
+ endstr = document.cookie.length;
108
+ }
109
+ return unescape(document.cookie.substring(offset, endstr));
110
+ };
js/amosoft/extjs/ext-all.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ This file is part of Ext JS 4.2
3
+
4
+ Copyright (c) 2011-2013 Sencha Inc
5
+
6
+ Contact: http://www.sencha.com/contact
7
+
8
+ GNU General Public License Usage
9
+ This file may be used under the terms of the GNU General Public License version 3.0 as
10
+ published by the Free Software Foundation and appearing in the file LICENSE included in the
11
+ packaging of this file.
12
+
13
+ Please review the following information to ensure the GNU General Public License version 3.0
14
+ requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15
+
16
+ If you are unsure which license is appropriate for your use, please contact the sales department
17
+ at http://www.sencha.com/contact.
18
+
19
+ Build date: 2013-05-16 14:36:50 (f9be68accb407158ba2b1be2c226a6ce1f649314)
20
+ */
21
+ var Ext=Ext||{};if(!Ext.Direct){Ext.Direct={}}if(!Ext.Toolbar){Ext.Toolbar={}}if(!Ext.app){Ext.app={}}if(!Ext.app.domain){Ext.app.domain={}}if(!Ext.button){Ext.button={}}if(!Ext.chart){Ext.chart={}}if(!Ext.chart.axis){Ext.chart.axis={}}if(!Ext.chart.series){Ext.chart.series={}}if(!Ext.chart.theme){Ext.chart.theme={}}if(!Ext.container){Ext.container={}}if(!Ext.core){Ext.core={}}if(!Ext.data){Ext.data={}}if(!Ext.data.association){Ext.data.association={}}if(!Ext.data.flash){Ext.data.flash={}}if(!Ext.data.proxy){Ext.data.proxy={}}if(!Ext.data.reader){Ext.data.reader={}}if(!Ext.data.writer){Ext.data.writer={}}if(!Ext.dd){Ext.dd={}}if(!Ext.direct){Ext.direct={}}if(!Ext.dom){Ext.dom={}}if(!Ext.draw){Ext.draw={}}if(!Ext.draw.engine){Ext.draw.engine={}}if(!Ext.flash){Ext.flash={}}if(!Ext.form){Ext.form={}}if(!Ext.form.Action){Ext.form.Action={}}if(!Ext.form.action){Ext.form.action={}}if(!Ext.form.field){Ext.form.field={}}if(!Ext.fx){Ext.fx={}}if(!Ext.fx.target){Ext.fx.target={}}if(!Ext.grid){Ext.grid={}}if(!Ext.grid.column){Ext.grid.column={}}if(!Ext.grid.feature){Ext.grid.feature={}}if(!Ext.grid.header){Ext.grid.header={}}if(!Ext.grid.locking){Ext.grid.locking={}}if(!Ext.grid.plugin){Ext.grid.plugin={}}if(!Ext.grid.property){Ext.grid.property={}}if(!Ext.layout){Ext.layout={}}if(!Ext.layout.boxOverflow){Ext.layout.boxOverflow={}}if(!Ext.layout.component){Ext.layout.component={}}if(!Ext.layout.component.field){Ext.layout.component.field={}}if(!Ext.layout.container){Ext.layout.container={}}if(!Ext.layout.container.border){Ext.layout.container.border={}}if(!Ext.layout.container.boxOverflow){Ext.layout.container.boxOverflow={}}if(!Ext.list){Ext.list={}}if(!Ext.menu){Ext.menu={}}if(!Ext.panel){Ext.panel={}}if(!Ext.perf){Ext.perf={}}if(!Ext.picker){Ext.picker={}}if(!Ext.resizer){Ext.resizer={}}if(!Ext.rtl){Ext.rtl={}}if(!Ext.rtl.button){Ext.rtl.button={}}if(!Ext.rtl.dd){Ext.rtl.dd={}}if(!Ext.rtl.dom){Ext.rtl.dom={}}if(!Ext.rtl.form){Ext.rtl.form={}}if(!Ext.rtl.form.field){Ext.rtl.form.field={}}if(!Ext.rtl.grid){Ext.rtl.grid={}}if(!Ext.rtl.grid.column){Ext.rtl.grid.column={}}if(!Ext.rtl.grid.plugin){Ext.rtl.grid.plugin={}}if(!Ext.rtl.layout){Ext.rtl.layout={}}if(!Ext.rtl.layout.component){Ext.rtl.layout.component={}}if(!Ext.rtl.layout.component.field){Ext.rtl.layout.component.field={}}if(!Ext.rtl.layout.container){Ext.rtl.layout.container={}}if(!Ext.rtl.layout.container.boxOverflow){Ext.rtl.layout.container.boxOverflow={}}if(!Ext.rtl.panel){Ext.rtl.panel={}}if(!Ext.rtl.resizer){Ext.rtl.resizer={}}if(!Ext.rtl.selection){Ext.rtl.selection={}}if(!Ext.rtl.slider){Ext.rtl.slider={}}if(!Ext.rtl.tab){Ext.rtl.tab={}}if(!Ext.rtl.tip){Ext.rtl.tip={}}if(!Ext.rtl.tree){Ext.rtl.tree={}}if(!Ext.rtl.util){Ext.rtl.util={}}if(!Ext.rtl.view){Ext.rtl.view={}}if(!Ext.selection){Ext.selection={}}if(!Ext.slider){Ext.slider={}}if(!Ext.state){Ext.state={}}if(!Ext.tab){Ext.tab={}}if(!Ext.tip){Ext.tip={}}if(!Ext.toolbar){Ext.toolbar={}}if(!Ext.tree){Ext.tree={}}if(!Ext.tree.plugin){Ext.tree.plugin={}}if(!Ext.util){Ext.util={}}if(!Ext.ux){Ext.ux={}}if(!Ext.ux.form){Ext.ux.form={}}if(!Ext.view){Ext.view={}}if(!Ext.window){Ext.window={}}(function(j){var l=[],m=["constructor","toString","valueOf","toLocaleString"],k={},p={},b=0,h,c,o,g,a=function(){var r,q;c=Ext.Base;o=Ext.ClassManager;for(r=m.length;r-->0;){q=(1<<r);p[k[q]=m[r]]=q}for(r in p){b|=p[r]}b=~b;Function.prototype.$isFunction=1;g=Ext.Class.getPreprocessor("config").fn;for(h in c){if(c.hasOwnProperty(h)){l.push(h)}}j.derive=d;return d.apply(this,arguments)},e=function(y,u,x){var r=x.enumerableMembers,v=y.prototype,t,w,s,q;if(!u){return}for(t in u){q=u[t];if(q&&q.$isFunction&&!q.$isClass&&q!==Ext.emptyFn&&q!==Ext.identityFn){v[t]=w=q;w.$owner=y;w.$name=t}else{v[t]=q}}for(s=1;r;s<<=1){if(r&s){r&=~s;t=k[s];v[t]=w=u[t];w.$owner=y;w.$name=t}}},n=function(u){var q=function t(){return u.apply(this,arguments)||null},s,r;q.prototype=Ext.Object.chain(u.prototype);for(s=l.length;s-->0;){r=l[s];q[r]=c[r]}return q},d=function(v,y,R,q,x,F,w,O,t,H,B){var r=function A(){return this.constructor.apply(this,arguments)||null},Q=r,s={enumerableMembers:q&b,onCreated:B,onBeforeCreated:e,aliases:O},E=R.alternateClassName||[],M=Ext.global,I,L,N,D,K,U,T,u,J,z,P,G,C,S;for(N=l.length;N-->0;){T=l[N];r[T]=c[T]}if(R.$isFunction){R=R(r)}s.data=R;z=R.statics,R.$className=v;if(R.$className){r.$className=R.$className}r.extend(y);J=r.prototype;r.xtype=R.xtype=x[0];if(x){J.xtypes=x}J.xtypesChain=F;J.xtypesMap=w;R.alias=O;Q.triggerExtended(r,R,s);if(R.onClassExtended){r.onExtended(R.onClassExtended,r);delete R.onClassExtended}if(z){for(P in z){if(z.hasOwnProperty(P)){S=z[P];if(S&&S.$isFunction&&!S.$isClass&&S!==Ext.emptyFn&&S!==Ext.identityFn){r[P]=C=S;C.$owner=r;C.$name=P}r[P]=S}}}delete R.statics;if(R.inheritableStatics){r.addInheritableStatics(R.inheritableStatics)}if(J.onClassExtended){Q.onExtended(J.onClassExtended,Q);delete J.onClassExtended}if(R.config){g(r,R)}s.onBeforeCreated(r,s.data,s);for(N=0,K=t&&t.length;N<K;++N){r.mixin.apply(r,t[N])}for(N=0,K=O.length;N<K;N++){I=O[N];o.setAlias(r,I)}if(R.singleton){Q=new r()}if(!(E instanceof Array)){E=[E]}for(N=0,D=E.length;N<D;N++){L=E[N];o.classes[L]=Q;G=o.getName(Q);u=o.maps.nameToAlternates;if(G&&G!==L){o.maps.alternateToName[L]=G;E=u[G]||(u[G]=[]);E.push(L)}}for(N=0,K=H.length;N<K;N+=2){U=H[N];if(!U){U=M}U[H[N+1]]=Q}o.classes[v]=Q;G=o.getName(Q);u=o.maps.nameToAlternates;if(G&&G!==v){o.maps.alternateToName[v]=G;E=u[G]||(u[G]=[]);E.push(v)}delete J.alternateClassName;if(s.onCreated){s.onCreated.call(Q,Q)}if(v){o.triggerCreated(v)}return Q};j.derive=a}(Ext.cmd={}));var Ext=Ext||{};Ext._startTime=new Date().getTime();(function(){var a=this,d=Object.prototype,b=d.toString,l=true,m={toString:1},g=function(){},k=function(){var n=k.caller.caller;return n.$owner.prototype[n.$name].apply(this,arguments)},e,j=/\S/,h,c=/\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/;Function.prototype.$extIsFunction=true;Ext.global=a;for(e in m){l=null}if(l){l=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]}Ext.enumerables=l;Ext.apply=function(q,p,s){if(s){Ext.apply(q,s)}if(q&&p&&typeof p==="object"){var r,o,n;for(r in p){q[r]=p[r]}if(l){for(o=l.length;o--;){n=l[o];if(p.hasOwnProperty(n)){q[n]=p[n]}}}}return q};Ext.buildSettings=Ext.apply({baseCSSPrefix:"x-"},Ext.buildSettings||{});Ext.apply(Ext,{name:Ext.sandboxName||"Ext",emptyFn:g,identityFn:function(n){return n},emptyString:new String(),baseCSSPrefix:Ext.buildSettings.baseCSSPrefix,applyIf:function(o,n){var p;if(o){for(p in n){if(o[p]===undefined){o[p]=n[p]}}}return o},iterate:function(n,p,o){if(Ext.isEmpty(n)){return}if(o===undefined){o=n}if(Ext.isIterable(n)){Ext.Array.each.call(Ext.Array,n,p,o)}else{Ext.Object.each.call(Ext.Object,n,p,o)}}});Ext.apply(Ext,{extend:(function(){var n=d.constructor,o=function(q){for(var p in q){if(!q.hasOwnProperty(p)){continue}this[p]=q[p]}};return function(p,u,s){if(Ext.isObject(u)){s=u;u=p;p=s.constructor!==n?s.constructor:function(){u.apply(this,arguments)}}var r=function(){},q,t=u.prototype;r.prototype=t;q=p.prototype=new r();q.constructor=p;p.superclass=t;if(t.constructor===n){t.constructor=u}p.override=function(v){Ext.override(p,v)};q.override=o;q.proto=q;p.override(s);p.extend=function(v){return Ext.extend(p,v)};return p}}()),override:function(q,r){if(q.$isClass){q.override(r)}else{if(typeof q=="function"){Ext.apply(q.prototype,r)}else{var n=q.self,o,p;if(n&&n.$isClass){for(o in r){if(r.hasOwnProperty(o)){p=r[o];if(typeof p=="function"){p.$name=o;p.$owner=n;p.$previous=q.hasOwnProperty(o)?q[o]:k}q[o]=p}}}else{Ext.apply(q,r)}}}return q}});Ext.apply(Ext,{valueFrom:function(p,n,o){return Ext.isEmpty(p,o)?n:p},typeOf:function(o){var n,p;if(o===null){return"null"}n=typeof o;if(n==="undefined"||n==="string"||n==="number"||n==="boolean"){return n}p=b.call(o);switch(p){case"[object Array]":return"array";case"[object Date]":return"date";case"[object Boolean]":return"boolean";case"[object Number]":return"number";case"[object RegExp]":return"regexp"}if(n==="function"){return"function"}if(n==="object"){if(o.nodeType!==undefined){if(o.nodeType===3){return(j).test(o.nodeValue)?"textnode":"whitespace"}else{return"element"}}return"object"}},coerce:function(r,q){var p=Ext.typeOf(r),o=Ext.typeOf(q),n=typeof r==="string";if(p!==o){switch(o){case"string":return String(r);case"number":return Number(r);case"boolean":return n&&(!r||r==="false")?false:Boolean(r);case"null":return n&&(!r||r==="null")?null:r;case"undefined":return n&&(!r||r==="undefined")?undefined:r;case"date":return n&&isNaN(r)?Ext.Date.parse(r,Ext.Date.defaultFormat):Date(Number(r))}}return r},isEmpty:function(n,o){return(n===null)||(n===undefined)||(!o?n==="":false)||(Ext.isArray(n)&&n.length===0)},isArray:("isArray" in Array)?Array.isArray:function(n){return b.call(n)==="[object Array]"},isDate:function(n){return b.call(n)==="[object Date]"},isObject:(b.call(null)==="[object Object]")?function(n){return n!==null&&n!==undefined&&b.call(n)==="[object Object]"&&n.ownerDocument===undefined}:function(n){return b.call(n)==="[object Object]"},isSimpleObject:function(n){return n instanceof Object&&n.constructor===Object},isPrimitive:function(o){var n=typeof o;return n==="string"||n==="number"||n==="boolean"},isFunction:function(n){return !!(n&&n.$extIsFunction)},isNumber:function(n){return typeof n==="number"&&isFinite(n)},isNumeric:function(n){return !isNaN(parseFloat(n))&&isFinite(n)},isString:function(n){return typeof n==="string"},isBoolean:function(n){return typeof n==="boolean"},isElement:function(n){return n?n.nodeType===1:false},isTextNode:function(n){return n?n.nodeName==="#text":false},isDefined:function(n){return typeof n!=="undefined"},isIterable:function(n){if(!n||typeof n.length!=="number"||typeof n==="string"||n.$extIsFunction){return false}if(!n.propertyIsEnumerable){return !!n.item}if(n.hasOwnProperty("length")&&!n.propertyIsEnumerable("length")){return true}return c.test(b.call(n))}});Ext.apply(Ext,{clone:function(s){var r,q,o,n,t,p;if(s===null||s===undefined){return s}if(s.nodeType&&s.cloneNode){return s.cloneNode(true)}r=b.call(s);if(r==="[object Date]"){return new Date(s.getTime())}if(r==="[object Array]"){q=s.length;t=[];while(q--){t[q]=Ext.clone(s[q])}}else{if(r==="[object Object]"&&s.constructor===Object){t={};for(p in s){t[p]=Ext.clone(s[p])}if(l){for(o=l.length;o--;){n=l[o];if(s.hasOwnProperty(n)){t[n]=s[n]}}}}}return t||s},getUniqueGlobalNamespace:function(){var o=this.uniqueGlobalNamespace,n;if(o===undefined){n=0;do{o="ExtBox"+(++n)}while(Ext.global[o]!==undefined);Ext.global[o]=Ext;this.uniqueGlobalNamespace=o}return o},functionFactoryCache:{},cacheableFunctionFactory:function(){var s=this,p=Array.prototype.slice.call(arguments),o=s.functionFactoryCache,n,q,r;if(Ext.isSandboxed){r=p.length;if(r>0){r--;p[r]="var Ext=window."+Ext.name+";"+p[r]}}n=p.join("");q=o[n];if(!q){q=Function.prototype.constructor.apply(Function.prototype,p);o[n]=q}return q},functionFactory:function(){var p=this,n=Array.prototype.slice.call(arguments),o;if(Ext.isSandboxed){o=n.length;if(o>0){o--;n[o]="var Ext=window."+Ext.name+";"+n[o]}}return Function.prototype.constructor.apply(Function.prototype,n)},Logger:{verbose:g,log:g,info:g,warn:g,error:function(n){throw new Error(n)},deprecate:g}});Ext.type=Ext.typeOf;h=Ext.app;if(!h){h=Ext.app={}}Ext.apply(h,{namespaces:{},collectNamespaces:function(p){var n=Ext.app.namespaces,o;for(o in p){if(p.hasOwnProperty(o)){n[o]=true}}},addNamespaces:function(p){var q=Ext.app.namespaces,o,n;if(!Ext.isArray(p)){p=[p]}for(o=0,n=p.length;o<n;o++){q[p[o]]=true}},clearNamespaces:function(){Ext.app.namespaces={}},getNamespace:function(o){var q=Ext.app.namespaces,n="",p;for(p in q){if(q.hasOwnProperty(p)&&p.length>n.length&&(p+"."===o.substring(0,p.length+1))){n=p}}return n===""?undefined:n}})}());Ext.globalEval=Ext.global.execScript?function(a){execScript(a)}:function($$code){(function(){var Ext=this.Ext;eval($$code)}())};(function(){var a="4.2.1.883",b;Ext.Version=b=Ext.extend(Object,{constructor:function(c){var e,d;if(c instanceof b){return c}this.version=this.shortVersion=String(c).toLowerCase().replace(/_/g,".").replace(/[\-+]/g,"");d=this.version.search(/([^\d\.])/);if(d!==-1){this.release=this.version.substr(d,c.length);this.shortVersion=this.version.substr(0,d)}this.shortVersion=this.shortVersion.replace(/[^\d]/g,"");e=this.version.split(".");this.major=parseInt(e.shift()||0,10);this.minor=parseInt(e.shift()||0,10);this.patch=parseInt(e.shift()||0,10);this.build=parseInt(e.shift()||0,10);return this},toString:function(){return this.version},valueOf:function(){return this.version},getMajor:function(){return this.major||0},getMinor:function(){return this.minor||0},getPatch:function(){return this.patch||0},getBuild:function(){return this.build||0},getRelease:function(){return this.release||""},isGreaterThan:function(c){return b.compare(this.version,c)===1},isGreaterThanOrEqual:function(c){return b.compare(this.version,c)>=0},isLessThan:function(c){return b.compare(this.version,c)===-1},isLessThanOrEqual:function(c){return b.compare(this.version,c)<=0},equals:function(c){return b.compare(this.version,c)===0},match:function(c){c=String(c);return this.version.substr(0,c.length)===c},toArray:function(){return[this.getMajor(),this.getMinor(),this.getPatch(),this.getBuild(),this.getRelease()]},getShortVersion:function(){return this.shortVersion},gt:function(){return this.isGreaterThan.apply(this,arguments)},lt:function(){return this.isLessThan.apply(this,arguments)},gtEq:function(){return this.isGreaterThanOrEqual.apply(this,arguments)},ltEq:function(){return this.isLessThanOrEqual.apply(this,arguments)}});Ext.apply(b,{releaseValueMap:{dev:-6,alpha:-5,a:-5,beta:-4,b:-4,rc:-3,"#":-2,p:-1,pl:-1},getComponentValue:function(c){return !c?0:(isNaN(c)?this.releaseValueMap[c]||c:parseInt(c,10))},compare:function(h,g){var d,e,c;h=new b(h).toArray();g=new b(g).toArray();for(c=0;c<Math.max(h.length,g.length);c++){d=this.getComponentValue(h[c]);e=this.getComponentValue(g[c]);if(d<e){return -1}else{if(d>e){return 1}}}return 0}});Ext.apply(Ext,{versions:{},lastRegisteredVersion:null,setVersion:function(d,c){Ext.versions[d]=new b(c);Ext.lastRegisteredVersion=Ext.versions[d];return this},getVersion:function(c){if(c===undefined){return Ext.lastRegisteredVersion}return Ext.versions[c]},deprecate:function(c,e,g,d){if(b.compare(Ext.getVersion(c),e)<1){g.call(d)}}});Ext.setVersion("core",a)}());Ext.String=(function(){var k=/^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,o=/('|\\)/g,j=/\{(\d+)\}/g,b=/([-.*+?\^${}()|\[\]\/\\])/g,p=/^\s+|\s+$/g,l=/\s+/,n=/(^[^a-z]*|[^\w])/gi,e,a,h,d,g=function(r,q){return e[q]},m=function(r,q){return(q in a)?a[q]:String.fromCharCode(parseInt(q.substr(2),10))},c=function(r,q){if(r===null||r===undefined||q===null||q===undefined){return false}return q.length<=r.length};return{insert:function(t,u,r){if(!t){return u}if(!u){return t}var q=t.length;if(!r&&r!==0){r=q}if(r<0){r*=-1;if(r>=q){r=0}else{r=q-r}}if(r===0){t=u+t}else{if(r>=t.length){t+=u}else{t=t.substr(0,r)+u+t.substr(r)}}return t},startsWith:function(t,u,r){var q=c(t,u);if(q){if(r){t=t.toLowerCase();u=u.toLowerCase()}q=t.lastIndexOf(u,0)===0}return q},endsWith:function(u,r,t){var q=c(u,r);if(q){if(t){u=u.toLowerCase();r=r.toLowerCase()}q=u.indexOf(r,u.length-r.length)!==-1}return q},createVarName:function(q){return q.replace(n,"")},htmlEncode:function(q){return(!q)?q:String(q).replace(h,g)},htmlDecode:function(q){return(!q)?q:String(q).replace(d,m)},addCharacterEntities:function(r){var q=[],u=[],s,t;for(s in r){t=r[s];a[s]=t;e[t]=s;q.push(t);u.push(s)}h=new RegExp("("+q.join("|")+")","g");d=new RegExp("("+u.join("|")+"|&#[0-9]{1,5};)","g")},resetCharacterEntities:function(){e={};a={};this.addCharacterEntities({"&amp;":"&","&gt;":">","&lt;":"<","&quot;":'"',"&#39;":"'"})},urlAppend:function(r,q){if(!Ext.isEmpty(q)){return r+(r.indexOf("?")===-1?"?":"&")+q}return r},trim:function(q){return q.replace(k,"")},capitalize:function(q){return q.charAt(0).toUpperCase()+q.substr(1)},uncapitalize:function(q){return q.charAt(0).toLowerCase()+q.substr(1)},ellipsis:function(s,q,t){if(s&&s.length>q){if(t){var u=s.substr(0,q-2),r=Math.max(u.lastIndexOf(" "),u.lastIndexOf("."),u.lastIndexOf("!"),u.lastIndexOf("?"));if(r!==-1&&r>=(q-15)){return u.substr(0,r)+"..."}}return s.substr(0,q-3)+"..."}return s},escapeRegex:function(q){return q.replace(b,"\\$1")},escape:function(q){return q.replace(o,"\\$1")},toggle:function(r,s,q){return r===s?q:s},leftPad:function(r,s,t){var q=String(r);t=t||" ";while(q.length<s){q=t+q}return q},format:function(r){var q=Ext.Array.toArray(arguments,1);return r.replace(j,function(s,t){return q[t]})},repeat:function(u,t,r){if(t<1){t=0}for(var q=[],s=t;s--;){q.push(u)}return q.join(r||"")},splitWords:function(q){if(q&&typeof q=="string"){return q.replace(p,"").split(l)}return q||[]}}}());Ext.String.resetCharacterEntities();Ext.htmlEncode=Ext.String.htmlEncode;Ext.htmlDecode=Ext.String.htmlDecode;Ext.urlAppend=Ext.String.urlAppend;Ext.Number=new function(){var b=this,c=(0.9).toFixed()!=="1",a=Math;Ext.apply(this,{constrain:function(h,g,e){var d=parseFloat(h);return(d<g)?g:((d>e)?e:d)},snap:function(h,e,g,j){var d;if(h===undefined||h<g){return g||0}if(e){d=h%e;if(d!==0){h-=d;if(d*2>=e){h+=e}else{if(d*2<-e){h-=e}}}}return b.constrain(h,g,j)},snapInRange:function(h,d,g,j){var e;g=(g||0);if(h===undefined||h<g){return g}if(d&&(e=((h-g)%d))){h-=e;e*=2;if(e>=d){h+=d}}if(j!==undefined){if(h>(j=b.snapInRange(j,d,g))){h=j}}return h},toFixed:c?function(g,d){d=d||0;var e=a.pow(10,d);return(a.round(g*e)/e).toFixed(d)}:function(e,d){return e.toFixed(d)},from:function(e,d){if(isFinite(e)){e=parseFloat(e)}return !isNaN(e)?e:d},randomInt:function(e,d){return a.floor(a.random()*(d-e+1)+e)},correctFloat:function(d){return parseFloat(d.toPrecision(14))}});Ext.num=function(){return b.from.apply(this,arguments)}}();(function(){var g=Array.prototype,p=g.slice,r=(function(){var B=[],e,A=20;if(!B.splice){return false}while(A--){B.push("A")}B.splice(15,0,"F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F");e=B.length;B.splice(13,0,"XXX");if(e+1!=B.length){return false}return true}()),k="forEach" in g,v="map" in g,q="indexOf" in g,z="every" in g,c="some" in g,d="filter" in g,o=(function(){var e=[1,2,3,4,5].sort(function(){return 0});return e[0]===1&&e[1]===2&&e[2]===3&&e[3]===4&&e[4]===5}()),l=true,a,x,u,w;try{if(typeof document!=="undefined"){p.call(document.getElementsByTagName("body"))}}catch(t){l=false}function n(A,e){return(e<0)?Math.max(0,A.length+e):Math.min(A.length,e)}function y(H,G,A,K){var L=K?K.length:0,C=H.length,I=n(H,G),F,J,B,e,D,E;if(I===C){if(L){H.push.apply(H,K)}}else{F=Math.min(A,C-I);J=I+F;B=J+L-F;e=C-J;D=C-F;if(B<J){for(E=0;E<e;++E){H[B+E]=H[J+E]}}else{if(B>J){for(E=e;E--;){H[B+E]=H[J+E]}}}if(L&&I===D){H.length=D;H.push.apply(H,K)}else{H.length=D+L;for(E=0;E<L;++E){H[I+E]=K[E]}}}return H}function j(C,e,B,A){if(A&&A.length){if(e===0&&!B){C.unshift.apply(C,A)}else{if(e<C.length){C.splice.apply(C,[e,B].concat(A))}else{C.push.apply(C,A)}}}else{C.splice(e,B)}return C}function b(B,e,A){return y(B,e,A)}function s(B,e,A){B.splice(e,A);return B}function m(D,e,B){var C=n(D,e),A=D.slice(e,n(D,C+B));if(arguments.length<4){y(D,C,B)}else{y(D,C,B,p.call(arguments,3))}return A}function h(e){return e.splice.apply(e,p.call(arguments,1))}x=r?s:b;u=r?j:y;w=r?h:m;a=Ext.Array={each:function(E,C,B,e){E=a.from(E);var A,D=E.length;if(e!==true){for(A=0;A<D;A++){if(C.call(B||E[A],E[A],A,E)===false){return A}}}else{for(A=D-1;A>-1;A--){if(C.call(B||E[A],E[A],A,E)===false){return A}}}return true},forEach:k?function(B,A,e){B.forEach(A,e)}:function(D,B,A){var e=0,C=D.length;for(;e<C;e++){B.call(A,D[e],e,D)}},indexOf:q?function(B,e,A){return g.indexOf.call(B,e,A)}:function(D,B,C){var e,A=D.length;for(e=(C<0)?Math.max(0,A+C):C||0;e<A;e++){if(D[e]===B){return e}}return -1},contains:q?function(A,e){return g.indexOf.call(A,e)!==-1}:function(C,B){var e,A;for(e=0,A=C.length;e<A;e++){if(C[e]===B){return true}}return false},toArray:function(B,D,e){if(!B||!B.length){return[]}if(typeof B==="string"){B=B.split("")}if(l){return p.call(B,D||0,e||B.length)}var C=[],A;D=D||0;e=e?((e<0)?B.length+e:e):B.length;for(A=D;A<e;A++){C.push(B[A])}return C},pluck:function(E,e){var A=[],B,D,C;for(B=0,D=E.length;B<D;B++){C=E[B];A.push(C[e])}return A},map:v?function(B,A,e){return B.map(A,e)}:function(E,D,C){var B=[],A=0,e=E.length;for(;A<e;A++){B[A]=D.call(C,E[A],A,E)}return B},every:z?function(B,A,e){return B.every(A,e)}:function(D,B,A){var e=0,C=D.length;for(;e<C;++e){if(!B.call(A,D[e],e,D)){return false}}return true},some:c?function(B,A,e){return B.some(A,e)}:function(D,B,A){var e=0,C=D.length;for(;e<C;++e){if(B.call(A,D[e],e,D)){return true}}return false},equals:function(D,C){var A=D.length,e=C.length,B;if(D===C){return true}if(A!==e){return false}for(B=0;B<A;++B){if(D[B]!==C[B]){return false}}return true},clean:function(D){var A=[],e=0,C=D.length,B;for(;e<C;e++){B=D[e];if(!Ext.isEmpty(B)){A.push(B)}}return A},unique:function(D){var C=[],e=0,B=D.length,A;for(;e<B;e++){A=D[e];if(a.indexOf(C,A)===-1){C.push(A)}}return C},filter:d?function(B,A,e){return B.filter(A,e)}:function(E,C,B){var A=[],e=0,D=E.length;for(;e<D;e++){if(C.call(B,E[e],e,E)){A.push(E[e])}}return A},findBy:function(D,C,B){var A=0,e=D.length;for(;A<e;A++){if(C.call(B||D,D[A],A)){return D[A]}}return null},from:function(B,A){if(B===undefined||B===null){return[]}if(Ext.isArray(B)){return(A)?p.call(B):B}var e=typeof B;if(B&&B.length!==undefined&&e!=="string"&&(e!=="function"||!B.apply)){return a.toArray(B)}return[B]},remove:function(B,A){var e=a.indexOf(B,A);if(e!==-1){x(B,e,1)}return B},include:function(A,e){if(!a.contains(A,e)){A.push(e)}},clone:function(e){return p.call(e)},merge:function(){var e=p.call(arguments),C=[],A,B;for(A=0,B=e.length;A<B;A++){C=C.concat(e[A])}return a.unique(C)},intersect:function(){var e=[],B=p.call(arguments),M,K,G,J,N,C,A,I,L,D,H,F,E;if(!B.length){return e}M=B.length;for(H=N=0;H<M;H++){C=B[H];if(!J||C.length<J.length){J=C;N=H}}J=a.unique(J);x(B,N,1);A=J.length;M=B.length;for(H=0;H<A;H++){I=J[H];D=0;for(F=0;F<M;F++){K=B[F];G=K.length;for(E=0;E<G;E++){L=K[E];if(I===L){D++;break}}}if(D===M){e.push(I)}}return e},difference:function(A,e){var F=p.call(A),D=F.length,C,B,E;for(C=0,E=e.length;C<E;C++){for(B=0;B<D;B++){if(F[B]===e[C]){x(F,B,1);B--;D--}}}return F},slice:([1,2].slice(1,undefined).length?function(B,A,e){return p.call(B,A,e)}:function(B,A,e){if(typeof A==="undefined"){return p.call(B)}if(typeof e==="undefined"){return p.call(B,A)}return p.call(B,A,e)}),sort:o?function(A,e){if(e){return A.sort(e)}else{return A.sort()}}:function(G,F){var D=G.length,C=0,E,e,B,A;for(;C<D;C++){B=C;for(e=C+1;e<D;e++){if(F){E=F(G[e],G[B]);if(E<0){B=e}}else{if(G[e]<G[B]){B=e}}}if(B!==C){A=G[C];G[C]=G[B];G[B]=A}}return G},flatten:function(B){var A=[];function e(C){var E,F,D;for(E=0,F=C.length;E<F;E++){D=C[E];if(Ext.isArray(D)){e(D)}else{A.push(D)}}return A}return e(B)},min:function(E,D){var A=E[0],e,C,B;for(e=0,C=E.length;e<C;e++){B=E[e];if(D){if(D(A,B)===1){A=B}}else{if(B<A){A=B}}}return A},max:function(E,D){var e=E[0],A,C,B;for(A=0,C=E.length;A<C;A++){B=E[A];if(D){if(D(e,B)===-1){e=B}}else{if(B>e){e=B}}}return e},mean:function(e){return e.length>0?a.sum(e)/e.length:undefined},sum:function(D){var A=0,e,C,B;for(e=0,C=D.length;e<C;e++){B=D[e];A+=B}return A},toMap:function(D,e,B){var C={},A=D.length;if(!e){while(A--){C[D[A]]=A+1}}else{if(typeof e=="string"){while(A--){C[D[A][e]]=A+1}}else{while(A--){C[e.call(B,D[A])]=A+1}}}return C},toValueMap:function(D,e,B){var C={},A=D.length;if(!e){while(A--){C[D[A]]=D[A]}}else{if(typeof e=="string"){while(A--){C[D[A][e]]=D[A]}}else{while(A--){C[e.call(B,D[A])]=D[A]}}}return C},erase:x,insert:function(B,A,e){return u(B,A,0,e)},replace:u,splice:w,push:function(C){var e=arguments.length,B=1,A;if(C===undefined){C=[]}else{if(!Ext.isArray(C)){C=[C]}}for(;B<e;B++){A=arguments[B];Array.prototype.push[Ext.isIterable(A)?"apply":"call"](C,A)}return C}};Ext.each=a.each;a.union=a.merge;Ext.min=a.min;Ext.max=a.max;Ext.sum=a.sum;Ext.mean=a.mean;Ext.flatten=a.flatten;Ext.clean=a.clean;Ext.unique=a.unique;Ext.pluck=a.pluck;Ext.toArray=function(){return a.toArray.apply(a,arguments)}}());Ext.Function={flexSetter:function(a){return function(d,c){var e,g;if(d===null){return this}if(typeof d!=="string"){for(e in d){if(d.hasOwnProperty(e)){a.call(this,e,d[e])}}if(Ext.enumerables){for(g=Ext.enumerables.length;g--;){e=Ext.enumerables[g];if(d.hasOwnProperty(e)){a.call(this,e,d[e])}}}}else{a.call(this,d,c)}return this}},bind:function(d,c,b,a){if(arguments.length===2){return function(){return d.apply(c,arguments)}}var g=d,e=Array.prototype.slice;return function(){var h=b||arguments;if(a===true){h=e.call(arguments,0);h=h.concat(b)}else{if(typeof a=="number"){h=e.call(arguments,0);Ext.Array.insert(h,a,b)}}return g.apply(c||Ext.global,h)}},pass:function(c,a,b){if(!Ext.isArray(a)){if(Ext.isIterable(a)){a=Ext.Array.clone(a)}else{a=a!==undefined?[a]:[]}}return function(){var d=[].concat(a);d.push.apply(d,arguments);return c.apply(b||this,d)}},alias:function(b,a){return function(){return b[a].apply(b,arguments)}},clone:function(a){return function(){return a.apply(this,arguments)}},createInterceptor:function(d,c,b,a){var e=d;if(!Ext.isFunction(c)){return d}else{a=Ext.isDefined(a)?a:null;return function(){var h=this,g=arguments;c.target=h;c.method=d;return(c.apply(b||h||Ext.global,g)!==false)?d.apply(h||Ext.global,g):a}}},createDelayed:function(e,c,d,b,a){if(d||b){e=Ext.Function.bind(e,d,b,a)}return function(){var h=this,g=Array.prototype.slice.call(arguments);setTimeout(function(){e.apply(h,g)},c)}},defer:function(e,c,d,b,a){e=Ext.Function.bind(e,d,b,a);if(c>0){return setTimeout(Ext.supports.TimeoutActualLateness?function(){e()}:e,c)}e();return 0},createSequence:function(b,c,a){if(!c){return b}else{return function(){var d=b.apply(this,arguments);c.apply(a||this,arguments);return d}}},createBuffered:function(e,b,d,c){var a;return function(){var h=c||Array.prototype.slice.call(arguments,0),g=d||this;if(a){clearTimeout(a)}a=setTimeout(function(){e.apply(g,h)},b)}},createThrottled:function(e,b,d){var g,a,c,j,h=function(){e.apply(d||this,c);g=Ext.Date.now()};return function(){a=Ext.Date.now()-g;c=arguments;clearTimeout(j);if(!g||(a>=b)){h()}else{j=setTimeout(h,b-a)}}},interceptBefore:function(b,a,d,c){var e=b[a]||Ext.emptyFn;return(b[a]=function(){var g=d.apply(c||this,arguments);e.apply(this,arguments);return g})},interceptAfter:function(b,a,d,c){var e=b[a]||Ext.emptyFn;return(b[a]=function(){e.apply(this,arguments);return d.apply(c||this,arguments)})}};Ext.defer=Ext.Function.alias(Ext.Function,"defer");Ext.pass=Ext.Function.alias(Ext.Function,"pass");Ext.bind=Ext.Function.alias(Ext.Function,"bind");(function(){var a=function(){},b=Ext.Object={chain:Object.create||function(d){a.prototype=d;var c=new a();a.prototype=null;return c},toQueryObjects:function(e,k,d){var c=b.toQueryObjects,j=[],g,h;if(Ext.isArray(k)){for(g=0,h=k.length;g<h;g++){if(d){j=j.concat(c(e+"["+g+"]",k[g],true))}else{j.push({name:e,value:k[g]})}}}else{if(Ext.isObject(k)){for(g in k){if(k.hasOwnProperty(g)){if(d){j=j.concat(c(e+"["+g+"]",k[g],true))}else{j.push({name:e,value:k[g]})}}}}else{j.push({name:e,value:k})}}return j},toQueryString:function(g,d){var h=[],e=[],l,k,m,c,n;for(l in g){if(g.hasOwnProperty(l)){h=h.concat(b.toQueryObjects(l,g[l],d))}}for(k=0,m=h.length;k<m;k++){c=h[k];n=c.value;if(Ext.isEmpty(n)){n=""}else{if(Ext.isDate(n)){n=Ext.Date.toString(n)}}e.push(encodeURIComponent(c.name)+"="+encodeURIComponent(String(n)))}return e.join("&")},fromQueryString:function(d,r){var m=d.replace(/^\?/,"").split("&"),u={},s,k,w,n,q,g,o,p,c,h,t,l,v,e;for(q=0,g=m.length;q<g;q++){o=m[q];if(o.length>0){k=o.split("=");w=decodeURIComponent(k[0]);n=(k[1]!==undefined)?decodeURIComponent(k[1]):"";if(!r){if(u.hasOwnProperty(w)){if(!Ext.isArray(u[w])){u[w]=[u[w]]}u[w].push(n)}else{u[w]=n}}else{h=w.match(/(\[):?([^\]]*)\]/g);t=w.match(/^([^\[]+)/);w=t[0];l=[];if(h===null){u[w]=n;continue}for(p=0,c=h.length;p<c;p++){v=h[p];v=(v.length===2)?"":v.substring(1,v.length-1);l.push(v)}l.unshift(w);s=u;for(p=0,c=l.length;p<c;p++){v=l[p];if(p===c-1){if(Ext.isArray(s)&&v===""){s.push(n)}else{s[v]=n}}else{if(s[v]===undefined||typeof s[v]==="string"){e=l[p+1];s[v]=(Ext.isNumeric(e)||e==="")?[]:{}}s=s[v]}}}}}return u},each:function(c,e,d){for(var g in c){if(c.hasOwnProperty(g)){if(e.call(d||c,g,c[g],c)===false){return}}}},merge:function(k){var h=1,j=arguments.length,c=b.merge,e=Ext.clone,g,m,l,d;for(;h<j;h++){g=arguments[h];for(m in g){l=g[m];if(l&&l.constructor===Object){d=k[m];if(d&&d.constructor===Object){c(d,l)}else{k[m]=e(l)}}else{k[m]=l}}}return k},mergeIf:function(c){var h=1,j=arguments.length,e=Ext.clone,d,g,k;for(;h<j;h++){d=arguments[h];for(g in d){if(!(g in c)){k=d[g];if(k&&k.constructor===Object){c[g]=e(k)}else{c[g]=k}}}}return c},getKey:function(c,e){for(var d in c){if(c.hasOwnProperty(d)&&c[d]===e){return d}}return null},getValues:function(d){var c=[],e;for(e in d){if(d.hasOwnProperty(e)){c.push(d[e])}}return c},getKeys:(typeof Object.keys=="function")?function(c){if(!c){return[]}return Object.keys(c)}:function(c){var d=[],e;for(e in c){if(c.hasOwnProperty(e)){d.push(e)}}return d},getSize:function(c){var d=0,e;for(e in c){if(c.hasOwnProperty(e)){d++}}return d},isEmpty:function(c){for(var d in c){if(c.hasOwnProperty(d)){return false}}return true},equals:(function(){var c=function(g,e){var d;for(d in g){if(g.hasOwnProperty(d)){if(g[d]!==e[d]){return false}}}return true};return function(e,d){if(e===d){return true}if(e&&d){return c(e,d)&&c(d,e)}else{if(!e&&!d){return e===d}else{return false}}}})(),classify:function(g){var e=g,j=[],d={},c=function(){var l=0,m=j.length,n;for(;l<m;l++){n=j[l];this[n]=new d[n]()}},h,k;for(h in g){if(g.hasOwnProperty(h)){k=g[h];if(k&&k.constructor===Object){j.push(h);d[h]=b.classify(k)}}}c.prototype=e;return c}};Ext.merge=Ext.Object.merge;Ext.mergeIf=Ext.Object.mergeIf;Ext.urlEncode=function(){var c=Ext.Array.from(arguments),d="";if((typeof c[1]==="string")){d=c[1]+"&";c[1]=false}return d+b.toQueryString.apply(b,c)};Ext.urlDecode=function(){return b.fromQueryString.apply(b,arguments)}}());Ext.Date=new function(){var d=this,k=/(\\.)/g,a=/([gGhHisucUOPZ]|MS)/,e=/([djzmnYycU]|MS)/,j=/\\/gi,c=/\{(\d+)\}/g,g=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/"),b=["var me = this, dt, y, m, d, h, i, s, ms, o, O, z, zz, u, v, W, year, jan4, week1monday, daysInMonth, dayMatched,","def = me.defaults,","from = Ext.Number.from,","results = String(input).match(me.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = me.clearTime(new Date);","y = from(y, from(def.y, dt.getFullYear()));","m = from(m, from(def.m - 1, dt.getMonth()));","dayMatched = d !== undefined;","d = from(d, from(def.d, dt.getDate()));","if (!dayMatched) {","dt.setDate(1);","dt.setMonth(m);","dt.setFullYear(y);","daysInMonth = me.getDaysInMonth(dt);","if (d > daysInMonth) {","d = daysInMonth;","}","}","h = from(h, from(def.h, dt.getHours()));","i = from(i, from(def.i, dt.getMinutes()));","s = from(s, from(def.s, dt.getSeconds()));","ms = from(ms, from(def.ms, dt.getMilliseconds()));","if(z >= 0 && y >= 0){","v = me.add(new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);","v = !strict? v : (strict === true && (z <= 364 || (me.isLeapYear(v) && z <= 365))? me.add(v, me.DAY, z) : null);","}else if(strict === true && !me.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","if (W) {","year = y || (new Date()).getFullYear(),","jan4 = new Date(year, 0, 4, 0, 0, 0),","week1monday = new Date(jan4.getTime() - ((jan4.getDay() - 1) * 86400000));","v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000)));","} else {","v = me.add(new Date(y < 100 ? 100 : y, m, d, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);","}","}","}","}","if(v){","if(zz != null){","v = me.add(v, me.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = me.add(v, me.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");function h(m){var l=Array.prototype.slice.call(arguments,1);return m.replace(c,function(n,o){return l[o]})}Ext.apply(d,{now:Date.now||function(){return +new Date()},toString:function(l){var m=Ext.String.leftPad;return l.getFullYear()+"-"+m(l.getMonth()+1,2,"0")+"-"+m(l.getDate(),2,"0")+"T"+m(l.getHours(),2,"0")+":"+m(l.getMinutes(),2,"0")+":"+m(l.getSeconds(),2,"0")},getElapsed:function(m,l){return Math.abs(m-(l||d.now()))},useStrict:false,formatCodeToRegex:function(m,l){var n=d.parseCodes[m];if(n){n=typeof n=="function"?n():n;d.parseCodes[m]=n}return n?Ext.applyIf({c:n.c?h(n.c,l||"{0}"):n.c},n):{g:0,c:null,s:Ext.String.escapeRegex(m)}},parseFunctions:{MS:function(m,l){var n=(m||"").match(g);return n?new Date(((n[1]||"")+n[2])*1):null},time:function(m,l){var n=parseInt(m,10);if(n||n===0){return new Date(n)}return null},timestamp:function(m,l){var n=parseInt(m,10);if(n||n===0){return new Date(n*1000)}return null}},parseRegexes:[],formatFunctions:{MS:function(){return"\\/Date("+this.getTime()+")\\/"},time:function(){return this.getTime().toString()},timestamp:function(){return d.format(this,"U")}},y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",defaults:{},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{January:0,Jan:0,February:1,Feb:1,March:2,Mar:2,April:3,Apr:3,May:4,June:5,Jun:5,July:6,Jul:6,August:7,Aug:7,September:8,Sep:8,October:9,Oct:9,November:10,Nov:10,December:11,Dec:11},defaultFormat:"m/d/Y",getShortMonthName:function(l){return Ext.Date.monthNames[l].substring(0,3)},getShortDayName:function(l){return Ext.Date.dayNames[l].substring(0,3)},getMonthNumber:function(l){return Ext.Date.monthNumbers[l.substring(0,1).toUpperCase()+l.substring(1,3).toLowerCase()]},formatContainsHourInfo:function(l){return a.test(l.replace(k,""))},formatContainsDateInfo:function(l){return e.test(l.replace(k,""))},unescapeFormat:function(l){return l.replace(j,"")},formatCodes:{d:"Ext.String.leftPad(this.getDate(), 2, '0')",D:"Ext.Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Ext.Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"Ext.Date.getSuffix(this)",w:"this.getDay()",z:"Ext.Date.getDayOfYear(this)",W:"Ext.String.leftPad(Ext.Date.getWeekOfYear(this), 2, '0')",F:"Ext.Date.monthNames[this.getMonth()]",m:"Ext.String.leftPad(this.getMonth() + 1, 2, '0')",M:"Ext.Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"Ext.Date.getDaysInMonth(this)",L:"(Ext.Date.isLeapYear(this) ? 1 : 0)",o:"(this.getFullYear() + (Ext.Date.getWeekOfYear(this) == 1 && this.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(this) >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"Ext.String.leftPad(this.getFullYear(), 4, '0')",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"Ext.String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"Ext.String.leftPad(this.getHours(), 2, '0')",i:"Ext.String.leftPad(this.getMinutes(), 2, '0')",s:"Ext.String.leftPad(this.getSeconds(), 2, '0')",u:"Ext.String.leftPad(this.getMilliseconds(), 3, '0')",O:"Ext.Date.getGMTOffset(this)",P:"Ext.Date.getGMTOffset(this, true)",T:"Ext.Date.getTimezone(this)",Z:"(this.getTimezoneOffset() * -60)",c:function(){var q,o,n,m,p;for(q="Y-m-dTH:i:sP",o=[],n=0,m=q.length;n<m;++n){p=q.charAt(n);o.push(p=="T"?"'T'":d.getFormatCode(p))}return o.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(u,l,t,q,o,p,n){q=q||0;o=o||0;p=p||0;n=n||0;var r=d.add(new Date(u<100?100:u,l-1,t,q,o,p,n),d.YEAR,u<100?u-100:0);return u==r.getFullYear()&&l==r.getMonth()+1&&t==r.getDate()&&q==r.getHours()&&o==r.getMinutes()&&p==r.getSeconds()&&n==r.getMilliseconds()},parse:function(m,o,l){var n=d.parseFunctions;if(n[o]==null){d.createParser(o)}return n[o].call(d,m,Ext.isDefined(l)?l:d.useStrict)},parseDate:function(m,n,l){return d.parse(m,n,l)},getFormatCode:function(m){var l=d.formatCodes[m];if(l){l=typeof l=="function"?l():l;d.formatCodes[m]=l}return l||("'"+Ext.String.escape(m)+"'")},createFormat:function(p){var o=[],l=false,n="",m;for(m=0;m<p.length;++m){n=p.charAt(m);if(!l&&n=="\\"){l=true}else{if(l){l=false;o.push("'"+Ext.String.escape(n)+"'")}else{o.push(d.getFormatCode(n))}}}d.formatFunctions[p]=Ext.functionFactory("return "+o.join("+"))},createParser:function(u){var m=d.parseRegexes.length,v=1,n=[],t=[],r=false,l="",p=0,q=u.length,s=[],o;for(;p<q;++p){l=u.charAt(p);if(!r&&l=="\\"){r=true}else{if(r){r=false;t.push(Ext.String.escape(l))}else{o=d.formatCodeToRegex(l,v);v+=o.g;t.push(o.s);if(o.g&&o.c){if(o.calcAtEnd){s.push(o.c)}else{n.push(o.c)}}}}}n=n.concat(s);d.parseRegexes[m]=new RegExp("^"+t.join("")+"$","i");d.parseFunctions[u]=Ext.functionFactory("input","strict",h(b,m,n.join("")))},parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(3[0-1]|[1-2][0-9]|0[1-9])"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(3[0-1]|[1-2][0-9]|[1-9])"},D:function(){for(var l=[],m=0;m<7;l.push(d.getShortDayName(m)),++m){}return{g:0,c:null,s:"(?:"+l.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+d.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:1,c:"W = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},F:function(){return{g:1,c:"m = parseInt(me.getMonthNumber(results[{0}]), 10);\n",s:"("+d.monthNames.join("|")+")"}},M:function(){for(var l=[],m=0;m<12;l.push(d.getShortMonthName(m)),++m){}return Ext.applyIf({s:"("+l.join("|")+")"},d.formatCodeToRegex("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(1[0-2]|0[1-9])"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(1[0-2]|[1-9])"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > me.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm|AM|PM)",calcAtEnd:true},A:{g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|am|pm)",calcAtEnd:true},g:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(1[0-2]|[0-9])"},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(2[0-3]|1[0-9]|[0-9])"},h:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(1[0-2]|0[1-9])"},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(2[0-3]|[0-1][0-9])"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"([0-5][0-9])"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"([0-5][0-9])"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,5}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var o=[],m=[d.formatCodeToRegex("Y",1),d.formatCodeToRegex("m",2),d.formatCodeToRegex("d",3),d.formatCodeToRegex("H",4),d.formatCodeToRegex("i",5),d.formatCodeToRegex("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",d.formatCodeToRegex("P",8).c,"}else{",d.formatCodeToRegex("O",8).c,"}","}"].join("\n")}],p,n;for(p=0,n=m.length;p<n;++p){o.push(m[p].c)}return{g:1,c:o.join(""),s:[m[0].s,"(?:","-",m[1].s,"(?:","-",m[2].s,"(?:","(?:T| )?",m[3].s,":",m[4].s,"(?::",m[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}},dateFormat:function(l,m){return d.format(l,m)},isEqual:function(m,l){if(m&&l){return(m.getTime()===l.getTime())}return !(m||l)},format:function(m,n){var l=d.formatFunctions;if(!Ext.isDate(m)){return""}if(l[n]==null){d.createFormat(n)}return l[n].call(m)+""},getTimezone:function(l){return l.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,5})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(l,m){var n=l.getTimezoneOffset();return(n>0?"-":"+")+Ext.String.leftPad(Math.floor(Math.abs(n)/60),2,"0")+(m?":":"")+Ext.String.leftPad(Math.abs(n%60),2,"0")},getDayOfYear:function(o){var n=0,q=Ext.Date.clone(o),l=o.getMonth(),p;for(p=0,q.setDate(1),q.setMonth(0);p<l;q.setMonth(++p)){n+=d.getDaysInMonth(q)}return n+o.getDate()-1},getWeekOfYear:(function(){var l=86400000,m=7*l;return function(o){var p=Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()+3)/l,n=Math.floor(p/7),q=new Date(n*m).getUTCFullYear();return n-Math.floor(Date.UTC(q,0,7)/m)+1}}()),isLeapYear:function(l){var m=l.getFullYear();return !!((m&3)==0&&(m%100||(m%400==0&&m)))},getFirstDayOfMonth:function(m){var l=(m.getDay()-(m.getDate()-1))%7;return(l<0)?(l+7):l},getLastDayOfMonth:function(l){return d.getLastDateOfMonth(l).getDay()},getFirstDateOfMonth:function(l){return new Date(l.getFullYear(),l.getMonth(),1)},getLastDateOfMonth:function(l){return new Date(l.getFullYear(),l.getMonth(),d.getDaysInMonth(l))},getDaysInMonth:(function(){var l=[31,28,31,30,31,30,31,31,30,31,30,31];return function(o){var n=o.getMonth();return n==1&&d.isLeapYear(o)?29:l[n]}}()),getSuffix:function(l){switch(l.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(l){return new Date(l.getTime())},isDST:function(l){return new Date(l.getFullYear(),0,1).getTimezoneOffset()!=l.getTimezoneOffset()},clearTime:function(l,p){if(p){return Ext.Date.clearTime(Ext.Date.clone(l))}var n=l.getDate(),m,o;l.setHours(0);l.setMinutes(0);l.setSeconds(0);l.setMilliseconds(0);if(l.getDate()!=n){for(m=1,o=d.add(l,Ext.Date.HOUR,m);o.getDate()!=n;m++,o=d.add(l,Ext.Date.HOUR,m)){}l.setDate(n);l.setHours(o.getHours())}return l},add:function(o,n,r){var s=Ext.Date.clone(o),l=Ext.Date,m,q,p=0;if(!n||r===0){return s}q=r-parseInt(r,10);r=parseInt(r,10);if(r){switch(n.toLowerCase()){case Ext.Date.MILLI:s.setTime(s.getTime()+r);break;case Ext.Date.SECOND:s.setTime(s.getTime()+r*1000);break;case Ext.Date.MINUTE:s.setTime(s.getTime()+r*60*1000);break;case Ext.Date.HOUR:s.setTime(s.getTime()+r*60*60*1000);break;case Ext.Date.DAY:s.setDate(s.getDate()+r);break;case Ext.Date.MONTH:m=o.getDate();if(m>28){m=Math.min(m,Ext.Date.getLastDateOfMonth(Ext.Date.add(Ext.Date.getFirstDateOfMonth(o),Ext.Date.MONTH,r)).getDate())}s.setDate(m);s.setMonth(o.getMonth()+r);break;case Ext.Date.YEAR:m=o.getDate();if(m>28){m=Math.min(m,Ext.Date.getLastDateOfMonth(Ext.Date.add(Ext.Date.getFirstDateOfMonth(o),Ext.Date.YEAR,r)).getDate())}s.setDate(m);s.setFullYear(o.getFullYear()+r);break}}if(q){switch(n.toLowerCase()){case Ext.Date.MILLI:p=1;break;case Ext.Date.SECOND:p=1000;break;case Ext.Date.MINUTE:p=1000*60;break;case Ext.Date.HOUR:p=1000*60*60;break;case Ext.Date.DAY:p=1000*60*60*24;break;case Ext.Date.MONTH:m=d.getDaysInMonth(s);p=1000*60*60*24*m;break;case Ext.Date.YEAR:m=(d.isLeapYear(s)?366:365);p=1000*60*60*24*m;break}if(p){s.setTime(s.getTime()+p*q)}}return s},subtract:function(m,l,n){return d.add(m,l,-n)},between:function(m,o,l){var n=m.getTime();return o.getTime()<=n&&n<=l.getTime()},compat:function(){var m=window.Date,l,t=["useStrict","formatCodeToRegex","parseFunctions","parseRegexes","formatFunctions","y2kYear","MILLI","SECOND","MINUTE","HOUR","DAY","MONTH","YEAR","defaults","dayNames","monthNames","monthNumbers","getShortMonthName","getShortDayName","getMonthNumber","formatCodes","isValid","parseDate","getFormatCode","createFormat","createParser","parseCodes"],q=["dateFormat","format","getTimezone","getGMTOffset","getDayOfYear","getWeekOfYear","isLeapYear","getFirstDayOfMonth","getLastDayOfMonth","getDaysInMonth","getSuffix","clone","isDST","clearTime","add","between"],r=t.length,n=q.length,o,u,v;for(v=0;v<r;v++){o=t[v];m[o]=d[o]}for(l=0;l<n;l++){u=q[l];m.prototype[u]=function(){var p=Array.prototype.slice.call(arguments);p.unshift(this);return d[u].apply(d,p)}}}})}();(function(a){var d=[],b=function(){},c=function(k,g,j,h){var e=function(){var l=this.callParent(arguments);k.apply(this,arguments);return l};e.$name=j;e.$owner=h;if(g){e.$previous=g.$previous;g.$previous=e}return e};Ext.apply(b,{$className:"Ext.Base",$isClass:true,create:function(){return Ext.create.apply(Ext,[this].concat(Array.prototype.slice.call(arguments,0)))},extend:function(k){var e=k.prototype,n,h,j,l,g,m;h=this.prototype=Ext.Object.chain(e);h.self=this;this.superclass=h.superclass=e;if(!k.$isClass){n=Ext.Base.prototype;for(j in n){if(j in h){h[j]=n[j]}}}m=e.$inheritableStatics;if(m){for(j=0,l=m.length;j<l;j++){g=m[j];if(!this.hasOwnProperty(g)){this[g]=k[g]}}}if(k.$onExtended){this.$onExtended=k.$onExtended.slice()}h.config=new h.configClass();h.initConfigList=h.initConfigList.slice();h.initConfigMap=Ext.clone(h.initConfigMap);h.configMap=Ext.Object.chain(h.configMap)},$onExtended:[],triggerExtended:function(){var h=this.$onExtended,g=h.length,e,j;if(g>0){for(e=0;e<g;e++){j=h[e];j.fn.apply(j.scope||this,arguments)}}},onExtended:function(g,e){this.$onExtended.push({fn:g,scope:e});return this},addConfig:function(j,n){var p=this.prototype,o=Ext.Class.configNameCache,k=p.configMap,l=p.initConfigList,h=p.initConfigMap,m=p.config,e,g,q;for(g in j){if(j.hasOwnProperty(g)){if(!k[g]){k[g]=true}q=j[g];e=o[g].initialized;if(!h[g]&&q!==null&&!p[e]){h[g]=true;l.push(g)}}}if(n){Ext.merge(m,j)}else{Ext.mergeIf(m,j)}p.configClass=Ext.Object.classify(m)},addStatics:function(e){var h,g;for(g in e){if(e.hasOwnProperty(g)){h=e[g];if(typeof h=="function"&&!h.$isClass&&h!==Ext.emptyFn&&h!==Ext.identityFn){h.$owner=this;h.$name=g}this[g]=h}}return this},addInheritableStatics:function(g){var k,e,j=this.prototype,h,l;k=j.$inheritableStatics;e=j.$hasInheritableStatics;if(!k){k=j.$inheritableStatics=[];e=j.$hasInheritableStatics={}}for(h in g){if(g.hasOwnProperty(h)){l=g[h];this[h]=l;if(!e[h]){e[h]=true;k.push(h)}}}return this},addMembers:function(g){var j=this.prototype,e=Ext.enumerables,m=[],k,l,h,n;for(h in g){m.push(h)}if(e){m.push.apply(m,e)}for(k=0,l=m.length;k<l;k++){h=m[k];if(g.hasOwnProperty(h)){n=g[h];if(typeof n=="function"&&!n.$isClass&&n!==Ext.emptyFn&&n!==Ext.identityFn){n.$owner=this;n.$name=h}j[h]=n}}return this},addMember:function(e,g){if(typeof g=="function"&&!g.$isClass&&g!==Ext.emptyFn&&g!==Ext.identityFn){g.$owner=this;g.$name=e}this.prototype[e]=g;return this},implement:function(){this.addMembers.apply(this,arguments)},borrow:function(k,h){var o=this.prototype,n=k.prototype,j,l,g,m,e;h=Ext.Array.from(h);for(j=0,l=h.length;j<l;j++){g=h[j];e=n[g];if(typeof e=="function"){m=Ext.Function.clone(e);m.$owner=this;m.$name=g;o[g]=m}else{o[g]=e}}return this},override:function(g){var o=this,q=Ext.enumerables,m=o.prototype,j=Ext.Function.clone,e,l,h,p,n,k;if(arguments.length===2){e=g;g={};g[e]=arguments[1];q=null}do{n=[];p=null;for(e in g){if(e=="statics"){p=g[e]}else{if(e=="inheritableStatics"){o.addInheritableStatics(g[e])}else{if(e=="config"){o.addConfig(g[e],true)}else{n.push(e)}}}}if(q){n.push.apply(n,q)}for(l=n.length;l--;){e=n[l];if(g.hasOwnProperty(e)){h=g[e];if(typeof h=="function"&&!h.$className&&h!==Ext.emptyFn&&h!==Ext.identityFn){if(typeof h.$owner!="undefined"){h=j(h)}h.$owner=o;h.$name=e;k=m[e];if(k){h.$previous=k}}m[e]=h}}m=o;g=p}while(g);return this},callParent:function(e){var g;return(g=this.callParent.caller)&&(g.$previous||((g=g.$owner?g:g.caller)&&g.$owner.superclass.self[g.$name])).apply(this,e||d)},callSuper:function(e){var g;return(g=this.callSuper.caller)&&((g=g.$owner?g:g.caller)&&g.$owner.superclass.self[g.$name]).apply(this,e||d)},mixin:function(g,h){var l=this,s=h.prototype,n=l.prototype,r,m,j,k,q,p,o,e;if(typeof s.onClassMixedIn!="undefined"){s.onClassMixedIn.call(h,l)}if(!n.hasOwnProperty("mixins")){if("mixins" in n){n.mixins=Ext.Object.chain(n.mixins)}else{n.mixins={}}}for(r in s){p=s[r];if(r==="mixins"){Ext.merge(n.mixins,p)}else{if(r==="xhooks"){for(o in p){e=p[o];e.$previous=Ext.emptyFn;if(n.hasOwnProperty(o)){c(e,n[o],o,l)}else{n[o]=c(e,null,o,l)}}}else{if(!(r==="mixinId"||r==="config")&&(n[r]===undefined)){n[r]=p}}}}m=s.$inheritableStatics;if(m){for(j=0,k=m.length;j<k;j++){q=m[j];if(!l.hasOwnProperty(q)){l[q]=h[q]}}}if("config" in s){l.addConfig(s.config,false)}n.mixins[g]=s;return l},getName:function(){return Ext.getClassName(this)},createAlias:a(function(g,e){this.override(g,function(){return this[e].apply(this,arguments)})}),addXtype:function(k){var g=this.prototype,j=g.xtypesMap,h=g.xtypes,e=g.xtypesChain;if(!g.hasOwnProperty("xtypesMap")){j=g.xtypesMap=Ext.merge({},g.xtypesMap||{});h=g.xtypes=g.xtypes?[].concat(g.xtypes):[];e=g.xtypesChain=g.xtypesChain?[].concat(g.xtypesChain):[];g.xtype=k}if(!j[k]){j[k]=true;h.push(k);e.push(k);Ext.ClassManager.setAlias(this,"widget."+k)}return this}});b.implement({isInstance:true,$className:"Ext.Base",configClass:Ext.emptyFn,initConfigList:[],configMap:{},initConfigMap:{},statics:function(){var g=this.statics.caller,e=this.self;if(!g){return e}return g.$owner},callParent:function(g){var h,e=(h=this.callParent.caller)&&(h.$previous||((h=h.$owner?h:h.caller)&&h.$owner.superclass[h.$name]));return e.apply(this,g||d)},callSuper:function(g){var h,e=(h=this.callSuper.caller)&&((h=h.$owner?h:h.caller)&&h.$owner.superclass[h.$name]);return e.apply(this,g||d)},self:b,constructor:function(){return this},initConfig:function(h){var n=h,m=Ext.Class.configNameCache,k=new this.configClass(),q=this.initConfigList,j=this.configMap,p,l,o,g,e;this.initConfig=Ext.emptyFn;this.initialConfig=n||{};this.config=h=(n)?Ext.merge(k,h):k;if(n){q=q.slice();for(g in n){if(j[g]){if(n[g]!==null){q.push(g);this[m[g].initialized]=false}}}}for(l=0,o=q.length;l<o;l++){g=q[l];p=m[g];e=p.initialized;if(!this[e]){this[e]=true;this[p.set].call(this,h[g])}}return this},hasConfig:function(e){return Boolean(this.configMap[e])},setConfig:function(j,n){if(!j){return this}var h=Ext.Class.configNameCache,e=this.config,m=this.configMap,l=this.initialConfig,g,k;n=Boolean(n);for(g in j){if(n&&l.hasOwnProperty(g)){continue}k=j[g];e[g]=k;if(m[g]){this[h[g].set](k)}}return this},getConfig:function(g){var e=Ext.Class.configNameCache;return this[e[g].get]()},getInitialConfig:function(g){var e=this.config;if(!g){return e}else{return e[g]}},onConfigUpdate:function(l,n,o){var p=this.self,h,k,e,j,m,g;l=Ext.Array.from(l);o=o||this;for(h=0,k=l.length;h<k;h++){e=l[h];j="update"+Ext.String.capitalize(e);m=this[j]||Ext.emptyFn;g=function(){m.apply(this,arguments);o[n].apply(o,arguments)};g.$name=j;g.$owner=p;this[j]=g}},destroy:function(){this.destroy=Ext.emptyFn}});b.prototype.callOverridden=b.prototype.callParent;Ext.Base=b}(Ext.Function.flexSetter));(function(){var c,b=Ext.Base,g=[],e,d;for(e in b){if(b.hasOwnProperty(e)){g.push(e)}}d=g.length;function a(j){function h(){return this.constructor.apply(this,arguments)||null}return h}Ext.Class=c=function(j,k,h){if(typeof j!="function"){h=k;k=j;j=null}if(!k){k={}}j=c.create(j,k);c.process(j,k,h);return j};Ext.apply(c,{onBeforeCreated:function(j,k,h){j.addMembers(k);h.onCreated.call(j,j)},create:function(h,l){var j,k;if(!h){h=a()}for(k=0;k<d;k++){j=g[k];h[j]=b[j]}return h},process:function(h,p,l){var k=p.preprocessors||c.defaultPreprocessors,s=this.preprocessors,v={onBeforeCreated:this.onBeforeCreated},u=[],w,o,n,t,m,r,q;delete p.preprocessors;for(n=0,t=k.length;n<t;n++){w=k[n];if(typeof w=="string"){w=s[w];o=w.properties;if(o===true){u.push(w.fn)}else{if(o){for(m=0,r=o.length;m<r;m++){q=o[m];if(p.hasOwnProperty(q)){u.push(w.fn);break}}}}}else{u.push(w)}}v.onCreated=l?l:Ext.emptyFn;v.preprocessors=u;this.doProcess(h,p,v)},doProcess:function(j,n,h){var m=this,o=h.preprocessors,k=o.shift(),l=m.doProcess;for(;k;k=o.shift()){if(k.call(m,j,n,h,l)===false){return}}h.onBeforeCreated.apply(m,arguments)},preprocessors:{},registerPreprocessor:function(j,m,k,h,l){if(!h){h="last"}if(!k){k=[j]}this.preprocessors[j]={name:j,properties:k||false,fn:m};this.setDefaultPreprocessorPosition(j,h,l);return this},getPreprocessor:function(h){return this.preprocessors[h]},getPreprocessors:function(){return this.preprocessors},defaultPreprocessors:[],getDefaultPreprocessors:function(){return this.defaultPreprocessors},setDefaultPreprocessors:function(h){this.defaultPreprocessors=Ext.Array.from(h);return this},setDefaultPreprocessorPosition:function(k,m,l){var h=this.defaultPreprocessors,j;if(typeof m=="string"){if(m==="first"){h.unshift(k);return this}else{if(m==="last"){h.push(k);return this}}m=(m==="after")?1:-1}j=Ext.Array.indexOf(h,l);if(j!==-1){Ext.Array.splice(h,Math.max(0,j+m),0,k)}return this},configNameCache:{},getConfigNameMap:function(k){var j=this.configNameCache,l=j[k],h;if(!l){h=k.charAt(0).toUpperCase()+k.substr(1);l=j[k]={internal:k,initialized:"_is"+h+"Initialized",apply:"apply"+h,update:"update"+h,set:"set"+h,get:"get"+h,doSet:"doSet"+h,changeEvent:k.toLowerCase()+"change"}}return l}});c.registerPreprocessor("extend",function(j,l,q){var m=Ext.Base,n=m.prototype,o=l.extend,h,p,k;delete l.extend;if(o&&o!==Object){h=o}else{h=m}p=h.prototype;if(!h.$isClass){for(k in n){if(!p[k]){p[k]=n[k]}}}j.extend(h);j.triggerExtended.apply(j,arguments);if(l.onClassExtended){j.onExtended(l.onClassExtended,j);delete l.onClassExtended}},true);c.registerPreprocessor("statics",function(h,j){h.addStatics(j.statics);delete j.statics});c.registerPreprocessor("inheritableStatics",function(h,j){h.addInheritableStatics(j.inheritableStatics);delete j.inheritableStatics});c.registerPreprocessor("config",function(h,l){var k=l.config,j=h.prototype;delete l.config;Ext.Object.each(k,function(o,x){var v=c.getConfigNameMap(o),r=v.internal,m=v.initialized,w=v.apply,p=v.update,u=v.set,n=v.get,z=(u in j)||l.hasOwnProperty(u),q=(w in j)||l.hasOwnProperty(w),s=(p in j)||l.hasOwnProperty(p),y,t;if(x===null||(!z&&!q&&!s)){j[r]=x;j[m]=true}else{j[m]=false}if(!z){l[u]=function(C){var B=this[r],A=this[w],D=this[p];if(!this[m]){this[m]=true}if(A){C=A.call(this,C,B)}if(typeof C!="undefined"){this[r]=C;if(D&&C!==B){D.call(this,C,B)}}return this}}if(!(n in j)||l.hasOwnProperty(n)){t=l[n]||false;if(t){y=function(){return t.apply(this,arguments)}}else{y=function(){return this[r]}}l[n]=function(){var A;if(!this[m]){this[m]=true;this[u](this.config[o])}A=this[n];if("$previous" in A){A.$previous=y}else{this[n]=y}return y.apply(this,arguments)}}});h.addConfig(k,true)});c.registerPreprocessor("mixins",function(l,p,h){var j=p.mixins,m,k,n,o;delete p.mixins;Ext.Function.interceptBefore(h,"onCreated",function(){if(j instanceof Array){for(n=0,o=j.length;n<o;n++){k=j[n];m=k.prototype.mixinId||k.$className;l.mixin(m,k)}}else{for(var q in j){if(j.hasOwnProperty(q)){l.mixin(q,j[q])}}}})});Ext.extend=function(k,l,j){if(arguments.length===2&&Ext.isObject(l)){j=l;l=k;k=null}var h;if(!l){throw new Error("[Ext.extend] Attempting to extend from a class which has not been loaded on the page.")}j.extend=l;j.preprocessors=["extend","statics","inheritableStatics","mixins","config"];if(k){h=new c(k,j);h.prototype.constructor=k}else{h=new c(j)}h.prototype.override=function(p){for(var n in p){if(p.hasOwnProperty(n)){this[n]=p[n]}}};return h}}());(function(c,e,h,d,g){function a(){function j(){return this.constructor.apply(this,arguments)||null}return j}var b=Ext.ClassManager={classes:{},existCache:{},namespaceRewrites:[{from:"Ext.",to:Ext}],maps:{alternateToName:{},aliasToName:{},nameToAliases:{},nameToAlternates:{}},enableNamespaceParseCache:true,namespaceParseCache:{},instantiators:[],isCreated:function(n){var m=this.existCache,l,o,k,j,p;if(this.classes[n]||m[n]){return true}j=g;p=this.parseNamespace(n);for(l=0,o=p.length;l<o;l++){k=p[l];if(typeof k!="string"){j=k}else{if(!j||!j[k]){return false}j=j[k]}}m[n]=true;this.triggerCreated(n);return true},createdListeners:[],nameCreatedListeners:{},triggerCreated:function(s){var u=this.createdListeners,m=this.nameCreatedListeners,n=this.maps.nameToAlternates[s],t=[s],p,r,o,q,l,k;for(p=0,r=u.length;p<r;p++){l=u[p];l.fn.call(l.scope,s)}if(n){t.push.apply(t,n)}for(p=0,r=t.length;p<r;p++){k=t[p];u=m[k];if(u){for(o=0,q=u.length;o<q;o++){l=u[o];l.fn.call(l.scope,k)}delete m[k]}}},onCreated:function(n,m,l){var k=this.createdListeners,j=this.nameCreatedListeners,o={fn:n,scope:m};if(l){if(this.isCreated(l)){n.call(m,l);return}if(!j[l]){j[l]=[]}j[l].push(o)}else{k.push(o)}},parseNamespace:function(l){var j=this.namespaceParseCache,m,o,q,k,t,s,r,n,p;if(this.enableNamespaceParseCache){if(j.hasOwnProperty(l)){return j[l]}}m=[];o=this.namespaceRewrites;q=g;k=l;for(n=0,p=o.length;n<p;n++){t=o[n];s=t.from;r=t.to;if(k===s||k.substring(0,s.length)===s){k=k.substring(s.length);if(typeof r!="string"){q=r}else{m=m.concat(r.split("."))}break}}m.push(q);m=m.concat(k.split("."));if(this.enableNamespaceParseCache){j[l]=m}return m},setNamespace:function(m,p){var k=g,q=this.parseNamespace(m),o=q.length-1,j=q[o],n,l;for(n=0;n<o;n++){l=q[n];if(typeof l!="string"){k=l}else{if(!k[l]){k[l]={}}k=k[l]}}k[j]=p;return k[j]},createNamespaces:function(){var k=g,p,m,n,l,o,q;for(n=0,o=arguments.length;n<o;n++){p=this.parseNamespace(arguments[n]);for(l=0,q=p.length;l<q;l++){m=p[l];if(typeof m!="string"){k=m}else{if(!k[m]){k[m]={}}k=k[m]}}}return k},set:function(j,n){var m=this,p=m.maps,o=p.nameToAlternates,l=m.getName(n),k;m.classes[j]=m.setNamespace(j,n);if(l&&l!==j){p.alternateToName[j]=l;k=o[l]||(o[l]=[]);k.push(j)}return this},get:function(l){var n=this.classes,j,p,k,m,o;if(n[l]){return n[l]}j=g;p=this.parseNamespace(l);for(m=0,o=p.length;m<o;m++){k=p[m];if(typeof k!="string"){j=k}else{if(!j||!j[k]){return null}j=j[k]}}return j},setAlias:function(j,k){var m=this.maps.aliasToName,n=this.maps.nameToAliases,l;if(typeof j=="string"){l=j}else{l=this.getName(j)}if(k&&m[k]!==l){m[k]=l}if(!n[l]){n[l]=[]}if(k){Ext.Array.include(n[l],k)}return this},addNameAliasMappings:function(j){var o=this.maps.aliasToName,p=this.maps.nameToAliases,m,n,l,k;for(m in j){n=p[m]||(p[m]=[]);for(k=0;k<j[m].length;k++){l=j[m][k];if(!o[l]){o[l]=m;n.push(l)}}}return this},addNameAlternateMappings:function(m){var j=this.maps.alternateToName,p=this.maps.nameToAlternates,l,n,o,k;for(l in m){n=p[l]||(p[l]=[]);for(k=0;k<m[l].length;k++){o=m[l][k];if(!j[o]){j[o]=l;n.push(o)}}}return this},getByAlias:function(j){return this.get(this.getNameByAlias(j))},getNameByAlias:function(j){return this.maps.aliasToName[j]||""},getNameByAlternate:function(j){return this.maps.alternateToName[j]||""},getAliasesByName:function(j){return this.maps.nameToAliases[j]||[]},getName:function(j){return j&&j.$className||""},getClass:function(j){return j&&j.self||null},create:function(k,m,j){var l=a();if(typeof m=="function"){m=m(l)}m.$className=k;return new c(l,m,function(){var n=m.postprocessors||b.defaultPostprocessors,u=b.postprocessors,v=[],t,p,s,o,r,q,w;delete m.postprocessors;for(p=0,s=n.length;p<s;p++){t=n[p];if(typeof t=="string"){t=u[t];q=t.properties;if(q===true){v.push(t.fn)}else{if(q){for(o=0,r=q.length;o<r;o++){w=q[o];if(m.hasOwnProperty(w)){v.push(t.fn);break}}}}}else{v.push(t)}}m.postprocessors=v;m.createdFn=j;b.processCreate(k,this,m)})},processCreate:function(m,k,o){var n=this,j=o.postprocessors.shift(),l=o.createdFn;if(!j){if(m){n.set(m,k)}if(l){l.call(k,k)}if(m){n.triggerCreated(m)}return}if(j.call(n,m,k,o,n.processCreate)!==false){n.processCreate(m,k,o)}},createOverride:function(m,q,k){var p=this,o=q.override,l=q.requires,j=q.uses,n=function(){var r,s;if(l){s=l;l=null;Ext.Loader.require(s,n)}else{r=p.get(o);delete q.override;delete q.requires;delete q.uses;Ext.override(r,q);p.triggerCreated(m);if(j){Ext.Loader.addUsedClasses(j)}if(k){k.call(r)}}};p.existCache[m]=true;p.onCreated(n,p,o);return p},instantiateByAlias:function(){var k=arguments[0],j=h.call(arguments),l=this.getNameByAlias(k);if(!l){l=this.maps.aliasToName[k];Ext.syncRequire(l)}j[0]=l;return this.instantiate.apply(this,j)},instantiate:function(){var l=arguments[0],n=typeof l,k=h.call(arguments,1),m=l,o,j;if(n!="function"){if(n!="string"&&k.length===0){k=[l];l=l.xclass}j=this.get(l)}else{j=l}if(!j){o=this.getNameByAlias(l);if(o){l=o;j=this.get(l)}}if(!j){o=this.getNameByAlternate(l);if(o){l=o;j=this.get(l)}}if(!j){Ext.syncRequire(l);j=this.get(l)}return this.getInstantiator(k.length)(j,k)},dynInstantiate:function(k,j){j=d(j,true);j.unshift(k);return this.instantiate.apply(this,j)},getInstantiator:function(m){var l=this.instantiators,n,k,j;n=l[m];if(!n){k=m;j=[];for(k=0;k<m;k++){j.push("a["+k+"]")}n=l[m]=new Function("c","a","return new c("+j.join(",")+")")}return n},postprocessors:{},defaultPostprocessors:[],registerPostprocessor:function(k,n,l,j,m){if(!j){j="last"}if(!l){l=[k]}this.postprocessors[k]={name:k,properties:l||false,fn:n};this.setDefaultPostprocessorPosition(k,j,m);return this},setDefaultPostprocessors:function(j){this.defaultPostprocessors=d(j);return this},setDefaultPostprocessorPosition:function(k,n,m){var l=this.defaultPostprocessors,j;if(typeof n=="string"){if(n==="first"){l.unshift(k);return this}else{if(n==="last"){l.push(k);return this}}n=(n==="after")?1:-1}j=Ext.Array.indexOf(l,m);if(j!==-1){Ext.Array.splice(l,Math.max(0,j+n),0,k)}return this},getNamesByExpression:function(q){var o=this.maps.nameToAliases,r=[],j,n,l,k,s,m,p;if(q.indexOf("*")!==-1){q=q.replace(/\*/g,"(.*?)");s=new RegExp("^"+q+"$");for(j in o){if(o.hasOwnProperty(j)){l=o[j];if(j.search(s)!==-1){r.push(j)}else{for(m=0,p=l.length;m<p;m++){n=l[m];if(n.search(s)!==-1){r.push(j);break}}}}}}else{k=this.getNameByAlias(q);if(k){r.push(k)}else{k=this.getNameByAlternate(q);if(k){r.push(k)}else{r.push(q)}}}return r}};b.registerPostprocessor("alias",function(l,k,o){var j=o.alias,m,n;for(m=0,n=j.length;m<n;m++){e=j[m];this.setAlias(k,e)}},["xtype","alias"]);b.registerPostprocessor("singleton",function(k,j,m,l){if(m.singleton){l.call(this,k,new j(),m)}else{return true}return false});b.registerPostprocessor("alternateClassName",function(k,j,o){var m=o.alternateClassName,l,n,p;if(!(m instanceof Array)){m=[m]}for(l=0,n=m.length;l<n;l++){p=m[l];this.set(p,j)}});Ext.apply(Ext,{create:e(b,"instantiate"),widget:function(l,k){var p=l,m,n,j,o;if(typeof p!="string"){k=l;p=k.xtype}else{k=k||{}}if(k.isComponent){return k}m="widget."+p;n=b.getNameByAlias(m);if(!n){o=true}j=b.get(n);if(o||!j){return b.instantiateByAlias(m,k)}return new j(k)},createByAlias:e(b,"instantiateByAlias"),define:function(k,l,j){if(l.override){return b.createOverride.apply(b,arguments)}return b.create.apply(b,arguments)},undefine:function(q){var l=b.classes,s=b.maps,t=s.aliasToName,u=s.nameToAliases,w=s.alternateToName,o=s.nameToAlternates,j=u[q],r=o[q],m,v,k,n;delete b.namespaceParseCache[q];delete u[q];delete o[q];delete l[q];if(j){for(n=j.length;n--;){delete t[j[n]]}}if(r){for(n=r.length;n--;){delete w[r[n]]}}m=b.parseNamespace(q);v=m.length-1;k=m[0];for(n=1;n<v;n++){k=k[m[n]];if(!k){return}}try{delete k[m[v]]}catch(p){k[m[v]]=undefined}},getClassName:e(b,"getName"),getDisplayName:function(j){if(j){if(j.displayName){return j.displayName}if(j.$name&&j.$class){return Ext.getClassName(j.$class)+"#"+j.$name}if(j.$className){return j.$className}}return"Anonymous"},getClass:e(b,"getClass"),namespace:e(b,"createNamespaces")});Ext.createWidget=Ext.widget;Ext.ns=Ext.namespace;c.registerPreprocessor("className",function(j,k){if(k.$className){j.$className=k.$className}},true,"first");c.registerPreprocessor("alias",function(u,o){var s=u.prototype,l=d(o.xtype),j=d(o.alias),v="widget.",t=v.length,p=Array.prototype.slice.call(s.xtypesChain||[]),m=Ext.merge({},s.xtypesMap||{}),n,r,q,k;for(n=0,r=j.length;n<r;n++){q=j[n];if(q.substring(0,t)===v){k=q.substring(t);Ext.Array.include(l,k)}}u.xtype=o.xtype=l[0];o.xtypes=l;for(n=0,r=l.length;n<r;n++){k=l[n];if(!m[k]){m[k]=true;p.push(k)}}o.xtypesChain=p;o.xtypesMap=m;Ext.Function.interceptAfter(o,"onClassCreated",function(){var w=s.mixins,y,x;for(y in w){if(w.hasOwnProperty(y)){x=w[y];l=x.xtypes;if(l){for(n=0,r=l.length;n<r;n++){k=l[n];if(!m[k]){m[k]=true;p.push(k)}}}}}});for(n=0,r=l.length;n<r;n++){k=l[n];Ext.Array.include(j,v+k)}o.alias=j},["xtype","alias"])}(Ext.Class,Ext.Function.alias,Array.prototype.slice,Ext.Array.from,Ext.global));if(Ext._alternatesMetadata){Ext.ClassManager.addNameAlternateMappings(Ext._alternatesMetadata);Ext._alternatesMetadata=null}if(Ext._aliasMetadata){Ext.ClassManager.addNameAliasMappings(Ext._aliasMetadata);Ext._aliasMetadata=null}Ext.Loader=new function(){var l=this,b=Ext.ClassManager,u=Ext.Class,e=Ext.Function.flexSetter,p=Ext.Function.alias,a=Ext.Function.pass,d=Ext.Function.defer,h=Ext.Array.erase,o=["extend","mixins","requires"],w={},n=[],c=/\/\.\//g,g=/\./g,k=0;Ext.apply(l,{isInHistory:w,history:n,config:{enabled:false,scriptChainDelay:false,disableCaching:true,disableCachingParam:"_dc",garbageCollect:false,paths:{Ext:"."},preserveScripts:true,scriptCharset:undefined},setConfig:function(z,A){if(Ext.isObject(z)&&arguments.length===1){Ext.merge(l.config,z);if("paths" in z){Ext.app.collectNamespaces(z.paths)}}else{l.config[z]=(Ext.isObject(A))?Ext.merge(l.config[z],A):A;if(z==="paths"){Ext.app.collectNamespaces(A)}}return l},getConfig:function(z){if(z){return l.config[z]}return l.config},setPath:e(function(z,A){l.config.paths[z]=A;Ext.app.namespaces[z]=true;k++;return l}),addClassPathMappings:function(A){var z;if(k==0){l.config.paths=A}else{for(z in A){l.config.paths[z]=A[z]}}k++;return l},getPath:function(z){var B="",C=l.config.paths,A=l.getPrefix(z);if(A.length>0){if(A===z){return C[A]}B=C[A];z=z.substring(A.length+1)}if(B.length>0){B+="/"}return B.replace(c,"/")+z.replace(g,"/")+".js"},getPrefix:function(A){var C=l.config.paths,B,z="";if(C.hasOwnProperty(A)){return A}for(B in C){if(C.hasOwnProperty(B)&&B+"."===A.substring(0,B.length+1)){if(B.length>z.length){z=B}}}return z},isAClassNameWithAKnownPrefix:function(z){var A=l.getPrefix(z);return A!==""&&A!==z},require:function(B,A,z,C){if(A){A.call(z)}},syncRequire:function(){},exclude:function(z){return{require:function(C,B,A){return l.require(C,B,A,z)},syncRequire:function(C,B,A){return l.syncRequire(C,B,A,z)}}},onReady:function(C,B,D,z){var A;if(D!==false&&Ext.onDocumentReady){A=C;C=function(){Ext.onDocumentReady(A,B,z)}}C.call(B)}});var r=[],s={},v={},t={},q={},x=[],y=[],j={},m=function(z,A){return A.priority-z.priority};Ext.apply(l,{documentHead:typeof document!="undefined"&&(document.head||document.getElementsByTagName("head")[0]),isLoading:false,queue:r,isClassFileLoaded:s,isFileLoaded:v,readyListeners:x,optionalRequires:y,requiresMap:j,numPendingFiles:0,numLoadedFiles:0,hasFileLoadError:false,classNameToFilePathMap:t,scriptsLoading:0,syncModeEnabled:false,scriptElements:q,refreshQueue:function(){var D=r.length,A,C,z,B;if(!D&&!l.scriptsLoading){return l.triggerReady()}for(A=0;A<D;A++){C=r[A];if(C){B=C.requires;if(B.length>l.numLoadedFiles){continue}for(z=0;z<B.length;){if(b.isCreated(B[z])){h(B,z,1)}else{z++}}if(C.requires.length===0){h(r,A,1);C.callback.call(C.scope);l.refreshQueue();break}}}return l},injectScriptElement:function(z,G,D,I,B){var H=document.createElement("script"),E=false,A=l.config,F=function(){if(!E){E=true;H.onload=H.onreadystatechange=H.onerror=null;if(typeof A.scriptChainDelay=="number"){d(G,A.scriptChainDelay,I)}else{G.call(I)}l.cleanupScriptElement(H,A.preserveScripts===false,A.garbageCollect)}},C=function(J){d(D,1,I);l.cleanupScriptElement(H,A.preserveScripts===false,A.garbageCollect)};H.type="text/javascript";H.onerror=C;B=B||A.scriptCharset;if(B){H.charset=B}if("addEventListener" in H){H.onload=F}else{if("readyState" in H){H.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){F()}}}else{H.onload=F}}H.src=z;(l.documentHead||document.getElementsByTagName("head")[0]).appendChild(H);return H},removeScriptElement:function(z){if(q[z]){l.cleanupScriptElement(q[z],true,!!l.getConfig("garbageCollect"));delete q[z]}return l},cleanupScriptElement:function(B,A,C){var D;B.onload=B.onreadystatechange=B.onerror=null;if(A){Ext.removeNode(B);if(C){for(D in B){try{if(D!="src"){B[D]=null}delete B[D]}catch(z){}}}}return l},loadScript:function(I){var C=l.getConfig(),B=typeof I=="string",A=B?I:I.url,E=!B&&I.onError,F=!B&&I.onLoad,H=!B&&I.scope,G=function(){l.numPendingFiles--;l.scriptsLoading--;if(E){E.call(H,"Failed loading '"+A+"', please verify that the file exists")}if(l.numPendingFiles+l.scriptsLoading===0){l.refreshQueue()}},D=function(){l.numPendingFiles--;l.scriptsLoading--;if(F){F.call(H)}if(l.numPendingFiles+l.scriptsLoading===0){l.refreshQueue()}},z;l.isLoading=true;l.numPendingFiles++;l.scriptsLoading++;z=C.disableCaching?(A+"?"+C.disableCachingParam+"="+Ext.Date.now()):A;q[A]=l.injectScriptElement(z,D,G)},loadScriptFile:function(A,H,F,K,z){if(v[A]){return l}var C=l.getConfig(),L=A+(C.disableCaching?("?"+C.disableCachingParam+"="+Ext.Date.now()):""),B=false,J,D,I,E="";K=K||l;l.isLoading=true;if(!z){I=function(){};q[A]=l.injectScriptElement(L,H,I,K)}else{if(typeof XMLHttpRequest!="undefined"){J=new XMLHttpRequest()}else{J=new ActiveXObject("Microsoft.XMLHTTP")}try{J.open("GET",L,false);J.send(null)}catch(G){B=true}D=(J.status===1223)?204:(J.status===0&&((self.location||{}).protocol=="file:"||(self.location||{}).protocol=="ionp:"))?200:J.status;B=B||(D===0);if(B){}else{if((D>=200&&D<300)||(D===304)){if(!Ext.isIE){E="\n//@ sourceURL="+A}Ext.globalEval(J.responseText+E);H.call(K)}else{}}J=null}},syncRequire:function(){var z=l.syncModeEnabled;if(!z){l.syncModeEnabled=true}l.require.apply(l,arguments);if(!z){l.syncModeEnabled=false}l.refreshQueue()},require:function(R,I,C,E){var K={},B={},H=[],T=[],Q=[],A=[],G,S,M,L,z,F,P,O,N,J,D;if(E){E=(typeof E==="string")?[E]:E;for(O=0,J=E.length;O<J;O++){z=E[O];if(typeof z=="string"&&z.length>0){H=b.getNamesByExpression(z);for(N=0,D=H.length;N<D;N++){K[H[N]]=true}}}}R=(typeof R==="string")?[R]:(R?R:[]);if(I){if(I.length>0){G=function(){var V=[],U,W;for(U=0,W=A.length;U<W;U++){V.push(b.get(A[U]))}return I.apply(this,V)}}else{G=I}}else{G=Ext.emptyFn}C=C||Ext.global;for(O=0,J=R.length;O<J;O++){L=R[O];if(typeof L=="string"&&L.length>0){T=b.getNamesByExpression(L);D=T.length;for(N=0;N<D;N++){P=T[N];if(K[P]!==true){A.push(P);if(!b.isCreated(P)&&!B[P]){B[P]=true;Q.push(P)}}}}}if(Q.length>0){if(!l.config.enabled){throw new Error("Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class"+((Q.length>1)?"es":"")+": "+Q.join(", "))}}else{G.call(C);return l}S=l.syncModeEnabled;if(!S){r.push({requires:Q.slice(),callback:G,scope:C})}J=Q.length;for(O=0;O<J;O++){F=Q[O];M=l.getPath(F);if(S&&s.hasOwnProperty(F)){if(!s[F]){l.numPendingFiles--;l.removeScriptElement(M);delete s[F]}}if(!s.hasOwnProperty(F)){s[F]=false;t[F]=M;l.numPendingFiles++;l.loadScriptFile(M,a(l.onFileLoaded,[F,M],l),a(l.onFileLoadError,[F,M],l),l,S)}}if(S){G.call(C);if(J===1){return b.get(F)}}return l},onFileLoaded:function(B,A){var z=s[B];l.numLoadedFiles++;s[B]=true;v[A]=true;if(!z){l.numPendingFiles--}if(l.numPendingFiles===0){l.refreshQueue()}},onFileLoadError:function(B,A,z,C){l.numPendingFiles--;l.hasFileLoadError=true},addUsedClasses:function(B){var z,A,C;if(B){B=(typeof B=="string")?[B]:B;for(A=0,C=B.length;A<C;A++){z=B[A];if(typeof z=="string"&&!Ext.Array.contains(y,z)){y.push(z)}}}return l},triggerReady:function(){var z,A=y;if(l.isLoading){l.isLoading=false;if(A.length!==0){A=A.slice();y.length=0;l.require(A,l.triggerReady,l);return l}}Ext.Array.sort(x,m);while(x.length&&!l.isLoading){z=x.shift();z.fn.call(z.scope)}return l},onReady:function(C,B,D,z){var A;if(D!==false&&Ext.onDocumentReady){A=C;C=function(){Ext.onDocumentReady(A,B,z)}}if(!l.isLoading){C.call(B)}else{x.push({fn:C,scope:B,priority:(z&&z.priority)||0})}},historyPush:function(z){if(z&&s.hasOwnProperty(z)&&!w[z]){w[z]=true;n.push(z)}return l}});Ext.disableCacheBuster=function(A,B){var z=new Date();z.setTime(z.getTime()+(A?10*365:-1)*24*60*60*1000);z=z.toGMTString();document.cookie="ext-cache=1; expires="+z+"; path="+(B||"/")};Ext.require=p(l,"require");Ext.syncRequire=p(l,"syncRequire");Ext.exclude=p(l,"exclude");Ext.onReady=function(B,A,z){l.onReady(B,A,true,z)};u.registerPreprocessor("loader",function(P,D,O,N){var K=this,I=[],z,J=b.getName(P),C,B,H,G,M,F,A,L,E;for(C=0,H=o.length;C<H;C++){F=o[C];if(D.hasOwnProperty(F)){A=D[F];if(typeof A=="string"){I.push(A)}else{if(A instanceof Array){for(B=0,G=A.length;B<G;B++){M=A[B];if(typeof M=="string"){I.push(M)}}}else{if(typeof A!="function"){for(B in A){if(A.hasOwnProperty(B)){M=A[B];if(typeof M=="string"){I.push(M)}}}}}}}}if(I.length===0){return}l.require(I,function(){for(C=0,H=o.length;C<H;C++){F=o[C];if(D.hasOwnProperty(F)){A=D[F];if(typeof A=="string"){D[F]=b.get(A)}else{if(A instanceof Array){for(B=0,G=A.length;B<G;B++){M=A[B];if(typeof M=="string"){D[F][B]=b.get(M)}}}else{if(typeof A!="function"){for(var Q in A){if(A.hasOwnProperty(Q)){M=A[Q];if(typeof M=="string"){D[F][Q]=b.get(M)}}}}}}}}N.call(K,P,D,O)});return false},true,"after","className");b.registerPostprocessor("uses",function(B,A,C){var z=C.uses;if(z){l.addUsedClasses(z)}});b.onCreated(l.historyPush)}();if(Ext._classPathMetadata){Ext.Loader.addClassPathMappings(Ext._classPathMetadata);Ext._classPathMetadata=null}(function(){var a=document.getElementsByTagName("script"),b=a[a.length-1],d=b.src,c=d.substring(0,d.lastIndexOf("/")+1),e=Ext.Loader;e.setConfig({enabled:true,disableCaching:true,paths:{Ext:c+"src"}})})();Ext._endTime=new Date().getTime();if(Ext._beforereadyhandler){Ext._beforereadyhandler()}Ext.Error=Ext.extend(Error,{statics:{ignore:false,raise:function(a){a=a||{};if(Ext.isString(a)){a={msg:a}}var c=this.raise.caller,b;if(c){if(c.$name){a.sourceMethod=c.$name}if(c.$owner){a.sourceClass=c.$owner.$className}}if(Ext.Error.handle(a)!==true){b=Ext.Error.prototype.toString.call(a);Ext.log({msg:b,level:"error",dump:a,stack:true});throw new Ext.Error(a)}},handle:function(){return Ext.Error.ignore}},name:"Ext.Error",constructor:function(a){if(Ext.isString(a)){a={msg:a}}var b=this;Ext.apply(b,a);b.message=b.message||b.msg},toString:function(){var c=this,b=c.sourceClass?c.sourceClass:"",a=c.sourceMethod?"."+c.sourceMethod+"(): ":"",d=c.msg||"(No description provided)";return b+a+d}});Ext.deprecated=function(a){return Ext.emptyFn};Ext.JSON=(new (function(){var me=this,encodingFunction,decodingFunction,useNative=null,useHasOwn=!!{}.hasOwnProperty,isNative=function(){if(useNative===null){useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"}return useNative},pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return eval("("+json+")")},doEncode=function(o,newline){if(o===null||o===undefined){return"null"}else{if(Ext.isDate(o)){return Ext.JSON.encodeDate(o)}else{if(Ext.isString(o)){return Ext.JSON.encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(Ext.isBoolean(o)){return String(o)}else{if(o.toJSON){return o.toJSON()}else{if(Ext.isArray(o)){return encodeArray(o,newline)}else{if(Ext.isObject(o)){return encodeObject(o,newline)}else{if(typeof o==="function"){return"null"}}}}}}}}}return"undefined"},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\","\v":"\\u000b"},charToReplace=/[\\\"\x00-\x1f\x7f-\uffff]/g,encodeString=function(s){return'"'+s.replace(charToReplace,function(a){var c=m[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"'},encodeArray=function(o,newline){var a=["[",""],len=o.length,i;for(i=0;i<len;i+=1){a.push(Ext.JSON.encodeValue(o[i]),",")}a[a.length-1]="]";return a.join("")},encodeObject=function(o,newline){var a=["{",""],i,val;for(i in o){val=o[i];if(!useHasOwn||o.hasOwnProperty(i)){if(typeof val==="function"||val===undefined){continue}a.push(Ext.JSON.encodeValue(i),":",Ext.JSON.encodeValue(val),",")}}a[a.length-1]="}";return a.join("")};me.encodeString=encodeString;me.encodeValue=doEncode;me.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};me.encode=function(o){if(!encodingFunction){encodingFunction=isNative()?JSON.stringify:me.encodeValue}return encodingFunction(o)};me.decode=function(json,safe){if(!decodingFunction){decodingFunction=isNative()?JSON.parse:doDecode}try{return decodingFunction(json)}catch(e){if(safe===true){return null}Ext.Error.raise({sourceClass:"Ext.JSON",sourceMethod:"decode",msg:"You're trying to decode an invalid JSON String: "+json})}}})());Ext.encode=Ext.JSON.encode;Ext.decode=Ext.JSON.decode;Ext.apply(Ext,{userAgent:navigator.userAgent.toLowerCase(),cache:{},idSeed:1000,windowId:"ext-window",documentId:"ext-document",isReady:false,enableGarbageCollector:true,enableListenerCollection:true,rootHierarchyState:{},addCacheEntry:function(g,c,e){e=e||c.dom;var a=Ext.cache,b=g||(c&&c.id)||e.id,d=a[b]||(a[b]={data:{},events:{},dom:e,skipGarbageCollection:!!(e.getElementById||e.navigator)});if(c){c.$cache=d;d.el=c}return d},updateCacheEntry:function(a,b){a.dom=b;if(a.el){a.el.dom=b}return a},id:function(a,c){var b=this,d="";a=Ext.getDom(a,true)||{};if(a===document){a.id=b.documentId}else{if(a===window){a.id=b.windowId}}if(!a.id){if(b.isSandboxed){d=Ext.sandboxName.toLowerCase()+"-"}a.id=d+(c||"ext-gen")+(++Ext.idSeed)}return a.id},escapeId:(function(){var c=/^[a-zA-Z_][a-zA-Z0-9_\-]*$/i,d=/([\W]{1})/g,b=/^(\d)/g,a=function(h,g){return"\\"+g},e=function(h,g){return"\\00"+g.charCodeAt(0).toString(16)+" "};return function(g){return c.test(g)?g:g.replace(d,a).replace(b,e)}}()),getBody:(function(){var a;return function(){return a||(a=Ext.get(document.body))}}()),getHead:(function(){var a;return function(){return a||(a=Ext.get(document.getElementsByTagName("head")[0]))}}()),getDoc:(function(){var a;return function(){return a||(a=Ext.get(document))}}()),getOrientation:function(){return window.innerHeight>window.innerWidth?"portrait":"landscape"},destroy:function(){var c=arguments.length,b,a;for(b=0;b<c;b++){a=arguments[b];if(a){if(Ext.isArray(a)){this.destroy.apply(this,a)}else{if(a.isStore){a.destroyStore()}else{if(Ext.isFunction(a.destroy)){a.destroy()}else{if(a.dom){a.remove()}}}}}}},callback:function(g,e,c,b){var d,a;if(Ext.isFunction(g)){d=g}else{if(e&&Ext.isString(g)){d=e[g]}}if(d){c=c||[];e=e||window;if(b){Ext.defer(d,b,e,c)}else{a=d.apply(e,c)}}return a},resolveMethod:function(b,a){if(Ext.isFunction(b)){return b}return a[b]},htmlEncode:function(a){return Ext.String.htmlEncode(a)},htmlDecode:function(a){return Ext.String.htmlDecode(a)},urlAppend:function(a,b){return Ext.String.urlAppend(a,b)}});Ext.ns=Ext.namespace;window.undefined=window.undefined;(function(){var q=function(e){return e.test(Ext.userAgent)},v=document.compatMode=="CSS1Compat",H=function(T,S){var e;return(T&&(e=S.exec(Ext.userAgent)))?parseFloat(e[1]):0},r=document.documentMode,a=q(/opera/),x=a&&q(/version\/10\.5/),M=q(/\bchrome\b/),B=q(/webkit/),c=!M&&q(/safari/),K=c&&q(/applewebkit\/4/),I=c&&q(/version\/3/),F=c&&q(/version\/4/),l=c&&q(/version\/5\.0/),E=c&&q(/version\/5/),k=!a&&q(/msie/),L=k&&((q(/msie 7/)&&r!=8&&r!=9&&r!=10)||r==7),J=k&&((q(/msie 8/)&&r!=7&&r!=9&&r!=10)||r==8),G=k&&((q(/msie 9/)&&r!=7&&r!=8&&r!=10)||r==9),h=k&&((q(/msie 10/)&&r!=7&&r!=8&&r!=9)||r==10),O=k&&q(/msie 6/),b=!B&&q(/gecko/),R=b&&q(/rv:1\.9/),Q=b&&q(/rv:2\.0/),P=b&&q(/rv:5\./),t=b&&q(/rv:10\./),A=R&&q(/rv:1\.9\.0/),y=R&&q(/rv:1\.9\.1/),w=R&&q(/rv:1\.9\.2/),g=q(/windows|win32/),D=q(/macintosh|mac os x/),z=q(/linux/),n=null,o=H(true,/\bchrome\/(\d+\.\d+)/),j=H(true,/\bfirefox\/(\d+\.\d+)/),p=H(k,/msie (\d+\.\d+)/),u=H(a,/version\/(\d+\.\d+)/),d=H(c,/version\/(\d+\.\d+)/),C=H(B,/webkit\/(\d+\.\d+)/),s=/^https/i.test(window.location.protocol),m;try{document.execCommand("BackgroundImageCache",false,true)}catch(N){}m=function(){};m.info=m.warn=m.error=Ext.emptyFn;Ext.setVersion("extjs","4.2.1.883");Ext.apply(Ext,{SSL_SECURE_URL:s&&k?"javascript:''":"about:blank",plainTableCls:Ext.buildSettings.baseCSSPrefix+"table-plain",plainListCls:Ext.buildSettings.baseCSSPrefix+"list-plain",enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,getDom:function(T,S){if(!T||!document){return null}if(T.dom){return T.dom}else{if(typeof T=="string"){var U=Ext.getElementById(T);if(U&&k&&S){if(T==U.getAttribute("id")){return U}else{return null}}return U}else{return T}}},removeNode:O||L||J?(function(){var e;return function(U){if(U&&U.tagName.toUpperCase()!="BODY"){(Ext.enableNestedListenerRemoval)?Ext.EventManager.purgeElement(U):Ext.EventManager.removeAll(U);var S=Ext.cache,T=U.id;if(S[T]){delete S[T].dom;delete S[T]}if(J&&U.parentNode){U.parentNode.removeChild(U)}e=e||document.createElement("div");e.appendChild(U);e.innerHTML=""}}}()):function(T){if(T&&T.parentNode&&T.tagName.toUpperCase()!="BODY"){(Ext.enableNestedListenerRemoval)?Ext.EventManager.purgeElement(T):Ext.EventManager.removeAll(T);var e=Ext.cache,S=T.id;if(e[S]){delete e[S].dom;delete e[S]}T.parentNode.removeChild(T)}},isStrict:v,isIEQuirks:k&&(!v&&(O||L||J||G)),isOpera:a,isOpera10_5:x,isWebKit:B,isChrome:M,isSafari:c,isSafari3:I,isSafari4:F,isSafari5:E,isSafari5_0:l,isSafari2:K,isIE:k,isIE6:O,isIE7:L,isIE7m:O||L,isIE7p:k&&!O,isIE8:J,isIE8m:O||L||J,isIE8p:k&&!(O||L),isIE9:G,isIE9m:O||L||J||G,isIE9p:k&&!(O||L||J),isIE10:h,isIE10m:O||L||J||G||h,isIE10p:k&&!(O||L||J||G),isGecko:b,isGecko3:R,isGecko4:Q,isGecko5:P,isGecko10:t,isFF3_0:A,isFF3_5:y,isFF3_6:w,isFF4:4<=j&&j<5,isFF5:5<=j&&j<6,isFF10:10<=j&&j<11,isLinux:z,isWindows:g,isMac:D,chromeVersion:o,firefoxVersion:j,ieVersion:p,operaVersion:u,safariVersion:d,webKitVersion:C,isSecure:s,BLANK_IMAGE_URL:(O||L)?"//www.sencha.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",value:function(T,e,S){return Ext.isEmpty(T,S)?e:T},escapeRe:function(e){return e.replace(/([-.*+?\^${}()|\[\]\/\\])/g,"\\$1")},addBehaviors:function(V){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(V)})}else{var S={},U,e,T;for(e in V){if((U=e.split("@"))[1]){T=U[0];if(!S[T]){S[T]=Ext.select(T)}S[T].on(U[1],V[e])}}S=null}},getScrollbarSize:function(S){if(!Ext.isReady){return{}}if(S||!n){var e=document.body,T=document.createElement("div");T.style.width=T.style.height="100px";T.style.overflow="scroll";T.style.position="absolute";e.appendChild(T);n={width:T.offsetWidth-T.clientWidth,height:T.offsetHeight-T.clientHeight};e.removeChild(T)}return n},getScrollBarWidth:function(S){var e=Ext.getScrollbarSize(S);return e.width+2},copyTo:function(S,U,W,V){if(typeof W=="string"){W=W.split(/[,;\s]/)}var X,T=W?W.length:0,e;for(X=0;X<T;X++){e=W[X];if(V||U.hasOwnProperty(e)){S[e]=U[e]}}return S},destroyMembers:function(U){for(var T=1,S=arguments,e=S.length;T<e;T++){Ext.destroy(U[S[T]]);delete U[S[T]]}},log:m,partition:function(e,V){var W=[[],[]],S,U,T=e.length;for(S=0;S<T;S++){U=e[S];W[(V&&V(U,S,e))||(!V&&U)?0:1].push(U)}return W},invoke:function(e,V){var X=[],W=Array.prototype.slice.call(arguments,2),S,U,T=e.length;for(S=0;S<T;S++){U=e[S];if(U&&typeof U[V]=="function"){X.push(U[V].apply(U,W))}else{X.push(undefined)}}return X},zip:function(){var Y=Ext.partition(arguments,function(Z){return typeof Z!="function"}),V=Y[0],X=Y[1][0],e=Ext.max(Ext.pluck(V,"length")),U=[],W,T,S;for(W=0;W<e;W++){U[W]=[];if(X){U[W]=X.apply(X,Ext.pluck(V,W))}else{for(T=0,S=V.length;T<S;T++){U[W].push(V[T][W])}}}return U},toSentence:function(S,e){var V=S.length,U,T;if(V<=1){return S[0]}else{U=S.slice(0,V-1);T=S[V-1];return Ext.util.Format.format("{0} {1} {2}",U.join(", "),e||"and",T)}},setGlyphFontFamily:function(e){Ext._glyphFontFamily=e},useShims:O})}());Ext.application=function(a){var c,d,b;if(typeof a==="string"){Ext.require(a,function(){c=Ext.ClassManager.get(a)})}else{Ext.Loader.setPath(a.name,a.appFolder||"app");if(d=a.paths){for(b in d){if(d.hasOwnProperty(b)){Ext.Loader.setPath(b,d[b])}}}a["paths processed"]=true;Ext.define(a.name+".$application",Ext.apply({extend:"Ext.app.Application"},a),function(){c=this})}Ext.onReady(function(){Ext.app.Application.instance=new c()})};(function(){Ext.ns("Ext.util");var g=Ext.util.Format={},c=/<\/?[^>]+>/gi,j=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,e=/\r?\n/g,b=/^#+$/,h=/[\d,\.#]+/,k=/[^\d\.#]/g,a,d={};Ext.apply(g,{thousandSeparator:",",decimalSeparator:".",currencyPrecision:2,currencySign:"$",currencyAtEnd:false,undef:function(l){return l!==undefined?l:""},defaultValue:function(m,l){return m!==undefined&&m!==""?m:l},substr:"ab".substr(-1)!="b"?function(m,o,l){var n=String(m);return(o<0)?n.substr(Math.max(n.length+o,0),l):n.substr(o,l)}:function(m,n,l){return String(m).substr(n,l)},lowercase:function(l){return String(l).toLowerCase()},uppercase:function(l){return String(l).toUpperCase()},usMoney:function(l){return g.currency(l,"$",2)},currency:function(n,p,m,l){var r="",q=",0",o=0;n=n-0;if(n<0){n=-n;r="-"}m=Ext.isDefined(m)?m:g.currencyPrecision;q+=(m>0?".":"");for(;o<m;o++){q+="0"}n=g.number(n,q);if((l||g.currencyAtEnd)===true){return Ext.String.format("{0}{1}{2}",r,n,p||g.currencySign)}else{return Ext.String.format("{0}{1}{2}",r,p||g.currencySign,n)}},date:function(l,m){if(!l){return""}if(!Ext.isDate(l)){l=new Date(Date.parse(l))}return Ext.Date.dateFormat(l,m||Ext.Date.defaultFormat)},dateRenderer:function(l){return function(m){return g.date(m,l)}},stripTags:function(l){return !l?l:String(l).replace(c,"")},stripScripts:function(l){return !l?l:String(l).replace(j,"")},fileSize:(function(){var l=1024,m=1048576,n=1073741824;return function(p){var o;if(p<l){if(p===1){o="1 byte"}else{o=p+" bytes"}}else{if(p<m){o=(Math.round(((p*10)/l))/10)+" KB"}else{if(p<n){o=(Math.round(((p*10)/m))/10)+" MB"}else{o=(Math.round(((p*10)/n))/10)+" GB"}}}return o}})(),math:(function(){var l={};return function(n,m){if(!l[m]){l[m]=Ext.functionFactory("v","return v "+m+";")}return l[m](n)}}()),round:function(n,m){var l=Number(n);if(typeof m=="number"){m=Math.pow(10,m);l=Math.round(n*m)/m}return l},number:function(t,o){if(!o){return t}var n=d[o];if(!n){var q=o,y=g.thousandSeparator,u=g.decimalSeparator,m,r,s,p=0,w,x,l;if(o.substr(o.length-2)=="/i"){if(!a){a=new RegExp("[^\\d\\"+g.decimalSeparator+"]","g")}o=o.substr(0,o.length-2);m=o.indexOf(y)!=-1;r=o.replace(a,"").split(u)}else{m=o.indexOf(",")!=-1;r=o.replace(k,"").split(".")}s=o.replace(h,"");if(r.length>2){}else{if(r.length===2){p=r[1].length;x=b.test(r[1])}}l=["var utilFormat=Ext.util.Format,extNumber=Ext.Number,neg,fnum,parts"+(m?",thousandSeparator,thousands=[],j,n,i":"")+(s?',formatString="'+o+'",formatPattern=/[\\d,\\.#]+/':"")+(x?",trailingZeroes=/\\.?0+$/;":";")+'return function(v){if(typeof v!=="number"&&isNaN(v=extNumber.from(v,NaN)))return"";neg=v<0;',"fnum=Ext.Number.toFixed(Math.abs(v), "+p+");"];if(m){if(p){l[l.length]='parts=fnum.split(".");';l[l.length]="fnum=parts[0];"}l[l.length]="if(v>=1000) {";l[l.length]="thousandSeparator=utilFormat.thousandSeparator;thousands.length=0;j=fnum.length;n=fnum.length%3||3;for(i=0;i<j;i+=n){if(i!==0){n=3;}thousands[thousands.length]=fnum.substr(i,n);}fnum=thousands.join(thousandSeparator);}";if(p){l[l.length]="fnum += utilFormat.decimalSeparator+parts[1];"}}else{if(p){l[l.length]='if(utilFormat.decimalSeparator!=="."){parts=fnum.split(".");fnum=parts[0]+utilFormat.decimalSeparator+parts[1];}'}}if(x){l[l.length]='fnum=fnum.replace(trailingZeroes,"");'}l[l.length]='if(neg&&fnum!=="'+(p?"0."+Ext.String.repeat("0",p):"0")+'")fnum="-"+fnum;';l[l.length]="return ";if(s){l[l.length]="formatString.replace(formatPattern, fnum);"}else{l[l.length]="fnum;"}l[l.length]="};";n=d[q]=Ext.functionFactory("Ext",l.join(""))(Ext)}return n(t)},numberRenderer:function(l){return function(m){return g.number(m,l)}},attributes:function(m){if(typeof m==="object"){var l=[],n;for(n in m){l.push(n,'="',n==="style"?Ext.DomHelper.generateStyles(m[n]):Ext.htmlEncode(m[n]),'"')}m=l.join("")}return m||""},plural:function(l,m,n){return l+" "+(l==1?m:(n?n:m+"s"))},nl2br:function(l){return Ext.isEmpty(l)?"":l.replace(e,"<br/>")},capitalize:Ext.String.capitalize,ellipsis:Ext.String.ellipsis,format:Ext.String.format,htmlDecode:Ext.String.htmlDecode,htmlEncode:Ext.String.htmlEncode,leftPad:Ext.String.leftPad,trim:Ext.String.trim,parseBox:function(m){m=m||0;if(typeof m==="number"){return{top:m,right:m,bottom:m,left:m}}var n=m.split(" "),l=n.length;if(l==1){n[1]=n[2]=n[3]=n[0]}else{if(l==2){n[2]=n[0];n[3]=n[1]}else{if(l==3){n[3]=n[1]}}}return{top:parseInt(n[0],10)||0,right:parseInt(n[1],10)||0,bottom:parseInt(n[2],10)||0,left:parseInt(n[3],10)||0}},escapeRegex:function(l){return l.replace(/([\-.*+?\^${}()|\[\]\/\\])/g,"\\$1")}})}());(Ext.cmd.derive("Ext.util.TaskRunner",Ext.Base,{interval:10,timerId:null,constructor:function(a){var b=this;if(typeof a=="number"){b.interval=a}else{if(a){Ext.apply(b,a)}}b.tasks=[];b.timerFn=Ext.Function.bind(b.onTick,b)},newTask:function(b){var a=new Ext.util.TaskRunner.Task(b);a.manager=this;return a},start:function(a){var c=this,b=Ext.Date.now();if(!a.pending){c.tasks.push(a);a.pending=true}a.stopped=false;a.taskStartTime=b;a.taskRunTime=a.fireOnStart!==false?0:a.taskStartTime;a.taskRunCount=0;if(!c.firing){if(a.fireOnStart!==false){c.startTimer(0,b)}else{c.startTimer(a.interval,b)}}return a},stop:function(a){if(!a.stopped){a.stopped=true;if(a.onStop){a.onStop.call(a.scope||a,a)}}return a},stopAll:function(){Ext.each(this.tasks,this.stop,this)},firing:false,nextExpires:1e+99,onTick:function(){var m=this,e=m.tasks,a=Ext.Date.now(),n=1e+99,k=e.length,c,o,h,b,d,g;m.timerId=null;m.firing=true;for(h=0;h<k||h<(k=e.length);++h){b=e[h];if(!(g=b.stopped)){c=b.taskRunTime+b.interval;if(c<=a){d=1;try{d=b.run.apply(b.scope||b,b.args||[++b.taskRunCount])}catch(j){try{if(b.onError){d=b.onError.call(b.scope||b,b,j)}}catch(l){}}b.taskRunTime=a;if(d===false||b.taskRunCount===b.repeat){m.stop(b);g=true}else{g=b.stopped;c=a+b.interval}}if(!g&&b.duration&&b.duration<=(a-b.taskStartTime)){m.stop(b);g=true}}if(g){b.pending=false;if(!o){o=e.slice(0,h)}}else{if(o){o.push(b)}if(n>c){n=c}}}if(o){m.tasks=o}m.firing=false;if(m.tasks.length){m.startTimer(n-a,Ext.Date.now())}if(m.fireIdleEvent!==false){Ext.EventManager.idleEvent.fire()}},startTimer:function(e,c){var d=this,b=c+e,a=d.timerId;if(a&&d.nextExpires-b>d.interval){clearTimeout(a);a=null}if(!a){if(e<d.interval){e=d.interval}d.timerId=setTimeout(d.timerFn,e);d.nextExpires=b}}},1,0,0,0,0,0,[Ext.util,"TaskRunner"],function(){var b=this,a=b.prototype;a.destroy=a.stopAll;Ext.util.TaskManager=Ext.TaskManager=new b();b.Task=new Ext.Class({isTask:true,stopped:true,fireOnStart:false,constructor:function(c){Ext.apply(this,c)},restart:function(c){if(c!==undefined){this.interval=c}this.manager.start(this)},start:function(c){if(this.stopped){this.restart(c)}},stop:function(){this.manager.stop(this)}});a=b.Task.prototype;a.destroy=a.stop}));(Ext.cmd.derive("Ext.util.TaskManager",Ext.util.TaskRunner,{alternateClassName:["Ext.TaskManager"],singleton:true},0,0,0,0,0,0,[Ext.util,"TaskManager",Ext,"TaskManager"],0));(Ext.cmd.derive("Ext.perf.Accumulator",Ext.Base,(function(){var c=null,h=Ext.global.chrome,d,b=function(){b=function(){return new Date().getTime()};var m,n;if(Ext.isChrome&&h&&h.Interval){m=new h.Interval();m.start();b=function(){return m.microseconds()/1000}}else{if(window.ActiveXObject){try{n=new ActiveXObject("SenchaToolbox.Toolbox");Ext.senchaToolbox=n;b=function(){return n.milliseconds}}catch(o){}}else{if(Date.now){b=Date.now}}}Ext.perf.getTimestamp=Ext.perf.Accumulator.getTimestamp=b;return b()};function j(n,m){n.sum+=m;n.min=Math.min(n.min,m);n.max=Math.max(n.max,m)}function e(p){var n=p?p:(b()-this.time),o=this,m=o.accum;++m.count;if(!--m.depth){j(m.total,n)}j(m.pure,n-o.childTime);c=o.parent;if(c){++c.accum.childCount;c.childTime+=n}}function a(){return{min:Number.MAX_VALUE,max:0,sum:0}}function k(n,m){return function(){var p=n.enter(),o=m.apply(this,arguments);p.leave();return o}}function l(m){return Math.round(m*100)/100}function g(o,n,m,q){var p={avg:0,min:q.min,max:q.max,sum:0};if(o){m=m||0;p.sum=q.sum-n*m;p.avg=p.sum/o}return p}return{constructor:function(m){var n=this;n.count=n.childCount=n.depth=n.maxDepth=0;n.pure=a();n.total=a();n.name=m},statics:{getTimestamp:b},format:function(m){if(!d){d=new Ext.XTemplate(["{name} - {count} call(s)",'<tpl if="count">','<tpl if="childCount">'," ({childCount} children)","</tpl>",'<tpl if="depth - 1">'," ({depth} deep)","</tpl>",'<tpl for="times">',", {type}: {[this.time(values.sum)]} msec (","avg={[this.time(values.sum / parent.count)]}",")","</tpl>","</tpl>"].join(""),{time:function(o){return Math.round(o*100)/100}})}var n=this.getData(m);n.name=this.name;n.pure.type="Pure";n.total.type="Total";n.times=[n.pure,n.total];return d.apply(n)},getData:function(m){var n=this;return{count:n.count,childCount:n.childCount,depth:n.maxDepth,pure:g(n.count,n.childCount,m,n.pure),total:g(n.count,n.childCount,m,n.total)}},enter:function(){var m=this,n={accum:m,leave:e,childTime:0,parent:c};++m.depth;if(m.maxDepth<m.depth){m.maxDepth=m.depth}c=n;n.time=b();return n},monitor:function(o,n,m){var p=this.enter();if(m){o.apply(n,m)}else{o.call(n)}p.leave()},report:function(){Ext.log(this.format())},tap:function(u,w){var v=this,p=typeof w=="string"?[w]:w,t,x,r,q,o,n,m,s;s=function(){if(typeof u=="string"){t=Ext.global;q=u.split(".");for(r=0,o=q.length;r<o;++r){t=t[q[r]]}}else{t=u}for(r=0,o=p.length;r<o;++r){n=p[r];x=n.charAt(0)=="!";if(x){n=n.substring(1)}else{x=!(n in t.prototype)}m=x?t:t.prototype;m[n]=k(v,m[n])}};Ext.ClassManager.onCreated(s,v,u);return v}}}()),1,0,0,0,0,0,[Ext.perf,"Accumulator"],function(){Ext.perf.getTimestamp=this.getTimestamp}));(Ext.cmd.derive("Ext.perf.Monitor",Ext.Base,{singleton:true,alternateClassName:"Ext.Perf",constructor:function(){this.accumulators=[];this.accumulatorsByName={}},calibrate:function(){var b=new Ext.perf.Accumulator("$"),g=b.total,c=Ext.perf.Accumulator.getTimestamp,e=0,h,a,d;d=c();do{h=b.enter();h.leave();++e}while(g.sum<100);a=c();return(a-d)/e},get:function(b){var c=this,a=c.accumulatorsByName[b];if(!a){c.accumulatorsByName[b]=a=new Ext.perf.Accumulator(b);c.accumulators.push(a)}return a},enter:function(a){return this.get(a).enter()},monitor:function(a,c,b){this.get(a).monitor(c,b)},report:function(){var c=this,b=c.accumulators,a=c.calibrate();b.sort(function(e,d){return(e.name<d.name)?-1:((d.name<e.name)?1:0)});c.updateGC();Ext.log("Calibration: "+Math.round(a*100)/100+" msec/sample");Ext.each(b,function(d){Ext.log(d.format(a))})},getData:function(c){var b={},a=this.accumulators;Ext.each(a,function(d){if(c||d.count){b[d.name]=d.getData()}});return b},reset:function(){Ext.each(this.accumulators,function(a){var b=a;b.count=b.childCount=b.depth=b.maxDepth=0;b.pure={min:Number.MAX_VALUE,max:0,sum:0};b.total={min:Number.MAX_VALUE,max:0,sum:0}})},updateGC:function(){var a=this.accumulatorsByName.GC,b=Ext.senchaToolbox,c;if(a){a.count=b.garbageCollectionCounter||0;if(a.count){c=a.pure;a.total.sum=c.sum=b.garbageCollectionMilliseconds;c.min=c.max=c.sum/a.count;c=a.total;c.min=c.max=c.sum/a.count}}},watchGC:function(){Ext.perf.getTimestamp();var a=Ext.senchaToolbox;if(a){this.get("GC");a.watchGarbageCollector(false)}},setup:function(c){if(!c){c={render:{"Ext.AbstractComponent":"render"},layout:{"Ext.layout.Context":"run"}}}this.currentConfig=c;var d,g,b,e,a;for(d in c){if(c.hasOwnProperty(d)){g=c[d];b=Ext.Perf.get(d);for(e in g){if(g.hasOwnProperty(e)){a=g[e];b.tap(e,a)}}}}this.watchGC()}},1,0,0,0,0,0,[Ext.perf,"Monitor",Ext,"Perf"],0));Ext.is={init:function(b){var c=this.platforms,e=c.length,d,a;b=b||window.navigator;for(d=0;d<e;d++){a=c[d];this[a.identity]=a.regex.test(b[a.property])}this.Desktop=this.Mac||this.Windows||(this.Linux&&!this.Android);this.Tablet=this.iPad;this.Phone=!this.Desktop&&!this.Tablet;this.iOS=this.iPhone||this.iPad||this.iPod;this.Standalone=!!window.navigator.standalone},platforms:[{property:"platform",regex:/iPhone/i,identity:"iPhone"},{property:"platform",regex:/iPod/i,identity:"iPod"},{property:"userAgent",regex:/iPad/i,identity:"iPad"},{property:"userAgent",regex:/Blackberry/i,identity:"Blackberry"},{property:"userAgent",regex:/Android/i,identity:"Android"},{property:"platform",regex:/Mac/i,identity:"Mac"},{property:"platform",regex:/Win/i,identity:"Windows"},{property:"platform",regex:/Linux/i,identity:"Linux"}]};Ext.is.init();(function(){var a=function(g,e){var d=g.ownerDocument.defaultView,h=(d?d.getComputedStyle(g,null):g.currentStyle)||g.style;return h[e]},c={"IE6-quirks":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0],"IE6-strict":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,1,0,0,1,0,1,0,0,0],"IE7-quirks":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0],"IE7-strict":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,1,0,0,1,0,1,0,0,0],"IE8-quirks":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0],"IE8-strict":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0,1,0,1,0,0,1],"IE9-quirks":[0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0],"IE9-strict":[0,1,0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,0,0,0,0,1],"IE10-quirks":[1,1,0,0,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,1],"IE10-strict":[1,1,0,0,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,1]};function b(){var d=Ext.isIE6?"IE6":Ext.isIE7?"IE7":Ext.isIE8?"IE8":Ext.isIE9?"IE9":Ext.isIE10?"IE10":"";return d?d+(Ext.isStrict?"-strict":"-quirks"):""}Ext.supports={init:function(){var l=this,p=document,j=l.toRun||l.tests,h=j.length,d=h&&Ext.isReady&&p.createElement("div"),e=[],m=b(),k,g,o;if(d){d.innerHTML=['<div style="height:30px;width:50px;">','<div style="height:20px;width:20px;"></div>',"</div>",'<div style="width: 200px; height: 200px; position: relative; padding: 5px;">','<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></div>',"</div>",'<div style="position: absolute; left: 10%; top: 10%;"></div>','<div style="float:left; background-color:transparent;"></div>'].join("");p.body.appendChild(d)}g=c[m];while(h--){k=j[h];o=g&&g[h];if(o!==undefined){l[k.identity]=o}else{if(d||k.early){l[k.identity]=k.fn.call(l,p,d)}else{e.push(k)}}}if(d){p.body.removeChild(d)}l.toRun=e},PointerEvents:"pointerEvents" in document.documentElement.style,LocalStorage:(function(){try{return"localStorage" in window&&window.localStorage!==null}catch(d){return false}})(),CSS3BoxShadow:"boxShadow" in document.documentElement.style||"WebkitBoxShadow" in document.documentElement.style||"MozBoxShadow" in document.documentElement.style,ClassList:!!document.documentElement.classList,OrientationChange:((typeof window.orientation!="undefined")&&("onorientationchange" in window)),DeviceMotion:("ondevicemotion" in window),Touch:("ontouchstart" in window)&&(!Ext.is.Desktop),TimeoutActualLateness:(function(){setTimeout(function(){Ext.supports.TimeoutActualLateness=arguments.length!==0},0)}()),tests:[{identity:"Transitions",fn:function(k,m){var j=["webkit","Moz","o","ms","khtml"],l="TransitionEnd",d=[j[0]+l,"transitionend",j[2]+l,j[3]+l,j[4]+l],h=j.length,g=0,e=false;for(;g<h;g++){if(a(m,j[g]+"TransitionProperty")){Ext.supports.CSS3Prefix=j[g];Ext.supports.CSS3TransitionEnd=d[g];e=true;break}}return e}},{identity:"RightMargin",fn:function(e,g){var d=e.defaultView;return !(d&&d.getComputedStyle(g.firstChild.firstChild,null).marginRight!="0px")}},{identity:"DisplayChangeInputSelectionBug",early:true,fn:function(){var d=Ext.webKitVersion;return 0<d&&d<533}},{identity:"DisplayChangeTextAreaSelectionBug",early:true,fn:function(){var d=Ext.webKitVersion;return 0<d&&d<534.24}},{identity:"TransparentColor",fn:function(e,g,d){d=e.defaultView;return !(d&&d.getComputedStyle(g.lastChild,null).backgroundColor!="transparent")}},{identity:"ComputedStyle",fn:function(e,g,d){d=e.defaultView;return d&&d.getComputedStyle}},{identity:"Svg",fn:function(d){return !!d.createElementNS&&!!d.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect}},{identity:"Canvas",fn:function(d){return !!d.createElement("canvas").getContext}},{identity:"Vml",fn:function(e){var g=e.createElement("div");g.innerHTML="<!--[if vml]><br/><br/><![endif]-->";return(g.childNodes.length==2)}},{identity:"Float",fn:function(d,e){return !!e.lastChild.style.cssFloat}},{identity:"AudioTag",fn:function(d){return !!d.createElement("audio").canPlayType}},{identity:"History",fn:function(){var d=window.history;return !!(d&&d.pushState)}},{identity:"CSS3DTransform",fn:function(){return(typeof WebKitCSSMatrix!="undefined"&&new WebKitCSSMatrix().hasOwnProperty("m41"))}},{identity:"CSS3LinearGradient",fn:function(k,d){var m="background-image:",l="-webkit-gradient(linear, left top, right bottom, from(black), to(white))",j="linear-gradient(left top, black, white)",h="-moz-"+j,e="-ms-"+j,g="-o-"+j,n=[m+l,m+j,m+h,m+e,m+g];d.style.cssText=n.join(";");return((""+d.style.backgroundImage).indexOf("gradient")!==-1)&&!Ext.isIE9}},{identity:"CSS3BorderRadius",fn:function(h,j){var e=["borderRadius","BorderRadius","MozBorderRadius","WebkitBorderRadius","OBorderRadius","KhtmlBorderRadius"],g=false,d;for(d=0;d<e.length;d++){if(document.body.style[e[d]]!==undefined){return true}}return g}},{identity:"GeoLocation",fn:function(){return(typeof navigator!="undefined"&&"geolocation" in navigator)||(typeof google!="undefined"&&typeof google.gears!="undefined")}},{identity:"MouseEnterLeave",fn:function(d,e){return("onmouseenter" in e&&"onmouseleave" in e)}},{identity:"MouseWheel",fn:function(d,e){return("onmousewheel" in e)}},{identity:"Opacity",fn:function(d,e){if(Ext.isIE6||Ext.isIE7||Ext.isIE8){return false}e.firstChild.style.cssText="opacity:0.73";return e.firstChild.style.opacity=="0.73"}},{identity:"Placeholder",fn:function(d){return"placeholder" in d.createElement("input")}},{identity:"Direct2DBug",fn:function(){return Ext.isString(document.body.style.msTransformOrigin)&&Ext.isIE10m}},{identity:"BoundingClientRect",fn:function(d,e){return Ext.isFunction(e.getBoundingClientRect)}},{identity:"RotatedBoundingClientRect",fn:function(){var d=document.body,e=false,h=document.createElement("div"),g=h.style;if(h.getBoundingClientRect){g.WebkitTransform=g.MozTransform=g.OTransform=g.transform="rotate(90deg)";g.width="100px";g.height="30px";d.appendChild(h);e=h.getBoundingClientRect().height!==100;d.removeChild(h)}return e}},{identity:"IncludePaddingInWidthCalculation",fn:function(d,e){return e.childNodes[1].firstChild.offsetWidth==210}},{identity:"IncludePaddingInHeightCalculation",fn:function(d,e){return e.childNodes[1].firstChild.offsetHeight==210}},{identity:"ArraySort",fn:function(){var d=[1,2,3,4,5].sort(function(){return 0});return d[0]===1&&d[1]===2&&d[2]===3&&d[3]===4&&d[4]===5}},{identity:"Range",fn:function(){return !!document.createRange}},{identity:"CreateContextualFragment",fn:function(){var d=Ext.supports.Range?document.createRange():false;return d&&!!d.createContextualFragment}},{identity:"WindowOnError",fn:function(){return Ext.isIE||Ext.isGecko||Ext.webKitVersion>=534.16}},{identity:"TextAreaMaxLength",fn:function(){var d=document.createElement("textarea");return("maxlength" in d)}},{identity:"GetPositionPercentage",fn:function(d,e){return a(e.childNodes[2],"left")=="10%"}},{identity:"PercentageHeightOverflowBug",fn:function(h){var d=false,g,e;if(Ext.getScrollbarSize().height){e=h.createElement("div");g=e.style;g.height="50px";g.width="50px";g.overflow="auto";g.position="absolute";e.innerHTML=['<div style="display:table;height:100%;">','<div style="width:51px;"></div>',"</div>"].join("");h.body.appendChild(e);if(e.firstChild.offsetHeight===50){d=true}h.body.removeChild(e)}return d}},{identity:"xOriginBug",fn:function(h,j){j.innerHTML='<div id="b1" style="height:100px;width:100px;direction:rtl;position:relative;overflow:scroll"><div id="b2" style="position:relative;width:100%;height:20px;"></div><div id="b3" style="position:absolute;width:20px;height:20px;top:0px;right:0px"></div></div>';var g=document.getElementById("b1").getBoundingClientRect(),e=document.getElementById("b2").getBoundingClientRect(),d=document.getElementById("b3").getBoundingClientRect();return(e.left!==g.left&&d.right!==g.right)}},{identity:"ScrollWidthInlinePaddingBug",fn:function(h){var d=false,g,e;e=h.createElement("div");g=e.style;g.height="50px";g.width="50px";g.padding="10px";g.overflow="hidden";g.position="absolute";e.innerHTML='<span style="display:inline-block;zoom:1;height:60px;width:60px;"></span>';h.body.appendChild(e);if(e.scrollWidth===70){d=true}h.body.removeChild(e);return d}}]}}());Ext.supports.init();Ext.util.DelayedTask=function(e,d,b,h){var g=this,a,c=function(){clearInterval(g.id);g.id=null;e.apply(d,b||[]);Ext.EventManager.idleEvent.fire()};h=typeof h==="boolean"?h:true;g.id=null;g.delay=function(k,m,l,j){if(h){g.cancel()}a=k||a,e=m||e;d=l||d;b=j||b;if(!g.id){g.id=setInterval(c,a)}};g.cancel=function(){if(g.id){clearInterval(g.id);g.id=null}}};(Ext.cmd.derive("Ext.util.Event",Ext.Base,function(){var d=Array.prototype.slice,a=Ext.Array.insert,b=Ext.Array.toArray,c=Ext.util.DelayedTask;return{isEvent:true,suspended:0,noOptions:{},constructor:function(g,e){this.name=e;this.observable=g;this.listeners=[]},addListener:function(p,r,t){var n=this,o,j,q,e,s,m,h,l,k,g;r=r||n.observable;if(!n.isListening(p,r)){j=n.createListener(p,r,t);if(n.firing){n.listeners=n.listeners.slice(0)}o=n.listeners;l=h=o.length;q=t&&t.priority;s=n._highestNegativePriorityIndex;m=(s!==undefined);if(q){e=(q<0);if(!e||m){for(k=(e?s:0);k<h;k++){g=o[k].o?o[k].o.priority||0:0;if(g<q){l=k;break}}}else{n._highestNegativePriorityIndex=l}}else{if(m){l=s}}if(!e&&l<=s){n._highestNegativePriorityIndex++}if(l===h){n.listeners[h]=j}else{a(n.listeners,l,[j])}}},createListener:function(h,g,l){g=g||this.observable;var j=this,k={fn:h,scope:g,ev:j},e=h;if(l){k.o=l;if(l.single){e=j.createSingle(e,k,l,g)}if(l.target){e=j.createTargeted(e,k,l,g)}if(l.delay){e=j.createDelayed(e,k,l,g)}if(l.buffer){e=j.createBuffered(e,k,l,g)}}k.fireFn=e;return k},findListener:function(k,j){var h=this.listeners,e=h.length,l,g;while(e--){l=h[e];if(l){g=l.scope;if(l.fn==k&&(g==(j||this.observable))){return e}}}return -1},isListening:function(g,e){return this.findListener(g,e)!==-1},removeListener:function(j,h){var l=this,g,n,m,e;g=l.findListener(j,h);if(g!=-1){n=l.listeners[g];m=l._highestNegativePriorityIndex;if(l.firing){l.listeners=l.listeners.slice(0)}if(n.task){n.task.cancel();delete n.task}e=n.tasks&&n.tasks.length;if(e){while(e--){n.tasks[e].cancel()}delete n.tasks}l.listeners.splice(g,1);if(m){if(g<m){l._highestNegativePriorityIndex--}else{if(g===m&&g===l.listeners.length){delete l._highestNegativePriorityIndex}}}return true}return false},clearListeners:function(){var g=this.listeners,e=g.length;while(e--){this.removeListener(g[e].fn,g[e].scope)}},suspend:function(){this.suspended+=1},resume:function(){if(this.suspended){this.suspended--}},fire:function(){var l=this,j=l.listeners,k=j.length,h,g,m,e;if(!l.suspended&&k>0){l.firing=true;g=arguments.length?d.call(arguments,0):[];e=g.length;for(h=0;h<k;h++){m=j[h];if(m.o){g[e]=m.o}if(m&&m.fireFn.apply(m.scope||l.observable,g)===false){return(l.firing=false)}}}l.firing=false;return true},createTargeted:function(g,h,j,e){return function(){if(j.target===arguments[0]){g.apply(e,arguments)}}},createBuffered:function(g,h,j,e){h.task=new c();return function(){h.task.delay(j.buffer,g,e,b(arguments))}},createDelayed:function(g,h,j,e){return function(){var k=new c();if(!h.tasks){h.tasks=[]}h.tasks.push(k);k.delay(j.delay||10,g,e,b(arguments))}},createSingle:function(g,h,j,e){return function(){var k=h.ev;if(k.removeListener(h.fn,e)&&k.observable){k.observable.hasListeners[k.name]--}return g.apply(e,arguments)}}}},1,0,0,0,0,0,[Ext.util,"Event"],0));Ext.EventManager=new function(){var b=this,h=document,g=window,e=/\\/g,c=Ext.baseCSSPrefix,a=!Ext.isIE9&&"addEventListener" in h,j,d=function(){var p=h.body||h.getElementsByTagName("body")[0],l=[c+"body"],k=[],m=Ext.supports.CSS3LinearGradient,o=Ext.supports.CSS3BorderRadius,n;if(!p){return false}n=p.parentNode;function q(r){l.push(c+r)}if(Ext.isIE&&Ext.isIE9m){q("ie");if(Ext.isIE6){q("ie6")}else{q("ie7p");if(Ext.isIE7){q("ie7")}else{q("ie8p");if(Ext.isIE8){q("ie8")}else{q("ie9p");if(Ext.isIE9){q("ie9")}}}}if(Ext.isIE7m){q("ie7m")}if(Ext.isIE8m){q("ie8m")}if(Ext.isIE9m){q("ie9m")}if(Ext.isIE7||Ext.isIE8){q("ie78")}}if(Ext.isIE10){q("ie10")}if(Ext.isGecko){q("gecko");if(Ext.isGecko3){q("gecko3")}if(Ext.isGecko4){q("gecko4")}if(Ext.isGecko5){q("gecko5")}}if(Ext.isOpera){q("opera")}if(Ext.isWebKit){q("webkit")}if(Ext.isSafari){q("safari");if(Ext.isSafari2){q("safari2")}if(Ext.isSafari3){q("safari3")}if(Ext.isSafari4){q("safari4")}if(Ext.isSafari5){q("safari5")}if(Ext.isSafari5_0){q("safari5_0")}}if(Ext.isChrome){q("chrome")}if(Ext.isMac){q("mac")}if(Ext.isLinux){q("linux")}if(!o){q("nbr")}if(!m){q("nlg")}if(n){if(Ext.isStrict&&(Ext.isIE6||Ext.isIE7)){Ext.isBorderBox=false}else{Ext.isBorderBox=true}if(!Ext.isBorderBox){k.push(c+"content-box")}if(Ext.isStrict){k.push(c+"strict")}else{k.push(c+"quirks")}Ext.fly(n,"_internal").addCls(k)}Ext.fly(p,"_internal").addCls(l);return true};Ext.apply(b,{hasBoundOnReady:false,hasFiredReady:false,deferReadyEvent:1,onReadyChain:[],readyEvent:(function(){j=new Ext.util.Event();j.fire=function(){Ext._beforeReadyTime=Ext._beforeReadyTime||new Date().getTime();j.self.prototype.fire.apply(j,arguments);Ext._afterReadytime=new Date().getTime()};return j}()),idleEvent:new Ext.util.Event(),isReadyPaused:function(){return(/[?&]ext-pauseReadyFire\b/i.test(location.search)&&!Ext._continueFireReady)},bindReadyEvent:function(){if(b.hasBoundOnReady){return}if(h.readyState=="complete"){b.onReadyEvent({type:h.readyState||"body"})}else{h.addEventListener("DOMContentLoaded",b.onReadyEvent,false);g.addEventListener("load",b.onReadyEvent,false);b.hasBoundOnReady=true}},onReadyEvent:function(k){if(k&&k.type){b.onReadyChain.push(k.type)}if(b.hasBoundOnReady){h.removeEventListener("DOMContentLoaded",b.onReadyEvent,false);g.removeEventListener("load",b.onReadyEvent,false)}if(!Ext.isReady){b.fireDocReady()}},fireDocReady:function(){if(!Ext.isReady){Ext._readyTime=new Date().getTime();Ext.isReady=true;Ext.supports.init();b.onWindowUnload();j.onReadyChain=b.onReadyChain;if(Ext.isNumber(b.deferReadyEvent)){Ext.Function.defer(b.fireReadyEvent,b.deferReadyEvent);b.hasDocReadyTimer=true}else{b.fireReadyEvent()}}},fireReadyEvent:function(){b.hasDocReadyTimer=false;b.isFiring=true;while(j.listeners.length&&!b.isReadyPaused()){j.fire()}b.isFiring=false;b.hasFiredReady=true;Ext.EventManager.idleEvent.fire()},onDocumentReady:function(m,l,k){k=k||{};k.single=true;j.addListener(m,l,k);if(!(b.isFiring||b.hasDocReadyTimer)){if(Ext.isReady){b.fireReadyEvent()}else{b.bindReadyEvent()}}},stoppedMouseDownEvent:new Ext.util.Event(),propRe:/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate|freezeEvent)$/,getId:function(k){var l;k=Ext.getDom(k);if(k===h||k===g){l=k===h?Ext.documentId:Ext.windowId}else{l=Ext.id(k)}if(!Ext.cache[l]){Ext.addCacheEntry(l,null,k)}return l},prepareListenerConfig:function(n,l,p){var q=b.propRe,m,o,k;for(m in l){if(l.hasOwnProperty(m)){if(!q.test(m)){o=l[m];if(typeof o=="function"){k=[n,m,o,l.scope,l]}else{k=[n,m,o.fn,o.scope,o]}if(p){b.removeListener.apply(b,k)}else{b.addListener.apply(b,k)}}}}},mouseEnterLeaveRe:/mouseenter|mouseleave/,normalizeEvent:function(k,l){if(b.mouseEnterLeaveRe.test(k)&&!Ext.supports.MouseEnterLeave){if(l){l=Ext.Function.createInterceptor(l,b.contains)}k=k=="mouseenter"?"mouseover":"mouseout"}else{if(k=="mousewheel"&&!Ext.supports.MouseWheel&&!Ext.isOpera){k="DOMMouseScroll"}}return{eventName:k,fn:l}},contains:function(l){l=l.browserEvent||l;var k=l.currentTarget,m=b.getRelatedTarget(l);if(k&&k.firstChild){while(m){if(m===k){return false}m=m.parentNode;if(m&&(m.nodeType!=1)){m=null}}}return true},addListener:function(o,q,t,v,w){if(typeof q!=="string"){b.prepareListenerConfig(o,q);return}var n=o.dom||Ext.getDom(o),r,s,m,k,l,p,u;if(typeof t==="string"){t=Ext.resolveMethod(t,v||o)}w=w||{};s=b.normalizeEvent(q,t);m=b.createListenerWrap(n,q,s.fn,v,w);k=b.getEventListenerCache(o.dom?o:n,q);q=s.eventName;r=a||(Ext.isIE9&&!n.attachEvent);if(!r){l=b.normalizeId(n);if(l){p=Ext.cache[l][q];if(p&&p.firing){k=b.cloneEventListenerCache(n,q)}}}u=!!w.capture;k.push({fn:t,wrap:m,scope:v,capture:u});if(!r){if(k.length===1){l=b.normalizeId(n,true);t=Ext.Function.bind(b.handleSingleEvent,b,[l,q],true);Ext.cache[l][q]={firing:false,fn:t};n.attachEvent("on"+q,t)}}else{n.addEventListener(q,m,u)}if(n==h&&q=="mousedown"){b.stoppedMouseDownEvent.addListener(m)}},normalizeId:function(l,k){var m;if(l===document){m=Ext.documentId}else{if(l===window){m=Ext.windowId}else{m=l.id}}if(!m&&k){m=b.getId(l)}return m},handleSingleEvent:function(p,q,m){var n=b.getEventListenerCache(q,m),l=Ext.cache[q][m],k,o;if(l.firing){return}l.firing=true;for(o=0,k=n.length;o<k;++o){n[o].wrap(p)}l.firing=false},removeListener:function(t,v,w,y){if(typeof v!=="string"){b.prepareListenerConfig(t,v,true);return}var r=Ext.getDom(t),m,n=t.dom?t:Ext.get(r),k=b.getEventListenerCache(n,v),x=b.normalizeEvent(v).eventName,s=k.length,q,u,p,o,l;if(!r){return}p=a||(Ext.isIE9&&!r.detachEvent);if(typeof w==="string"){w=Ext.resolveMethod(w,y||t)}while(s--){o=k[s];if(o&&(!w||o.fn==w)&&(!y||o.scope===y)){l=o.wrap;if(l.task){clearTimeout(l.task);delete l.task}q=l.tasks&&l.tasks.length;if(q){while(q--){clearTimeout(l.tasks[q])}delete l.tasks}if(!p){m=b.normalizeId(r,true);u=Ext.cache[m][x];if(u&&u.firing){k=b.cloneEventListenerCache(r,x)}if(k.length===1){w=u.fn;delete Ext.cache[m][x];r.detachEvent("on"+x,w)}}else{r.removeEventListener(x,l,o.capture)}if(l&&r==h&&v=="mousedown"){b.stoppedMouseDownEvent.removeListener(l)}Ext.Array.erase(k,s,1)}}},removeAll:function(n){var o=(typeof n==="string")?n:n.id,l,m,k;if(o&&(l=Ext.cache[o])){m=l.events;for(k in m){if(m.hasOwnProperty(k)){b.removeListener(n,k)}}l.events={}}},purgeElement:function(n,l){var p=Ext.getDom(n),m=0,k,o;if(l){b.removeListener(n,l)}else{b.removeAll(n)}if(p&&p.childNodes){o=p.childNodes;for(k=o.length;m<k;m++){b.purgeElement(o[m],l)}}},createListenerWrap:function(r,l,o,n,k){k=k||{};var p,q,m=function(t,s){if(!q){p=["if(!"+Ext.name+") {return;}"];if(k.buffer||k.delay||k.freezeEvent){if(k.freezeEvent){p.push("e = X.EventObject.setEvent(e);")}p.push("e = new X.EventObjectImpl(e, "+(k.freezeEvent?"true":"false")+");")}else{p.push("e = X.EventObject.setEvent(e);")}if(k.delegate){p.push('var result, t = e.getTarget("'+(k.delegate+"").replace(e,"\\\\")+'", this);');p.push("if(!t) {return;}")}else{p.push("var t = e.target, result;")}if(k.target){p.push("if(e.target !== options.target) {return;}")}if(k.stopEvent){p.push("e.stopEvent();")}else{if(k.preventDefault){p.push("e.preventDefault();")}if(k.stopPropagation){p.push("e.stopPropagation();")}}if(k.normalized===false){p.push("e = e.browserEvent;")}if(k.buffer){p.push("(wrap.task && clearTimeout(wrap.task));");p.push("wrap.task = setTimeout(function() {")}if(k.delay){p.push("wrap.tasks = wrap.tasks || [];");p.push("wrap.tasks.push(setTimeout(function() {")}p.push("result = fn.call(scope || dom, e, t, options);");if(k.single){p.push("evtMgr.removeListener(dom, ename, fn, scope);")}if(l!=="mousemove"&&l!=="unload"){p.push("if (evtMgr.idleEvent.listeners.length) {");p.push("evtMgr.idleEvent.fire();");p.push("}")}if(k.delay){p.push("}, "+k.delay+"));")}if(k.buffer){p.push("}, "+k.buffer+");")}p.push("return result;");q=Ext.cacheableFunctionFactory("e","options","fn","scope","ename","dom","wrap","args","X","evtMgr",p.join("\n"))}return q.call(r,t,k,o,n,l,r,m,s,Ext,b)};return m},getEventCache:function(m){var l,k,n;if(!m){return[]}if(m.$cache){l=m.$cache}else{if(typeof m==="string"){n=m}else{n=b.getId(m)}l=Ext.cache[n]}k=l.events||(l.events={});return k},getEventListenerCache:function(m,k){var l=b.getEventCache(m);return l[k]||(l[k]=[])},cloneEventListenerCache:function(n,k){var m=b.getEventCache(n),l;if(m[k]){l=m[k].slice(0)}else{l=[]}m[k]=l;return l},mouseLeaveRe:/(mouseout|mouseleave)/,mouseEnterRe:/(mouseover|mouseenter)/,stopEvent:function(k){b.stopPropagation(k);b.preventDefault(k)},stopPropagation:function(k){k=k.browserEvent||k;if(k.stopPropagation){k.stopPropagation()}else{k.cancelBubble=true}},preventDefault:function(k){k=k.browserEvent||k;if(k.preventDefault){k.preventDef