Textmaster_Textmaster - Version 1.1.0

Version Notes

Projects Grid Fixes.

if you have any trouble with our extension, be sure to let us know at contact@textmaster.com

------------

Textmaster extension uses Callbacks to update project informations, your environment need to be reachable by our server.
For more information: contact@textmaster.com

Download this release

Release Info

Developer Textmaster
Extension Textmaster_Textmaster
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.10 to 1.1.0

Files changed (286) hide show
  1. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Credit.php +0 -61
  2. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Document/Renderer/Status.php +0 -33
  3. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Document/Supportmessage.php +0 -46
  4. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Document/View.php +0 -70
  5. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project.php +0 -39
  6. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Grid.php +0 -326
  7. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Grid/Column/Renderer/Checkbox.php +0 -39
  8. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Grid/Column/Renderer/Massaction.php +0 -40
  9. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets.php +0 -55
  10. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Form.php +0 -41
  11. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step1.php +0 -256
  12. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step2.php +0 -431
  13. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step3.php +0 -228
  14. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step3/Author.php +0 -46
  15. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step3/Form/Author.php +0 -144
  16. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Summary.php +0 -73
  17. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Nbdocument.php +0 -34
  18. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Price.php +0 -34
  19. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Progression.php +0 -33
  20. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Status.php +0 -33
  21. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Store.php +0 -52
  22. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Wordcount.php +0 -34
  23. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View.php +0 -96
  24. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View/Documents.php +0 -223
  25. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View/Grid/Column/Renderer/Checkbox.php +0 -39
  26. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View/Grid/Column/Renderer/Massaction.php +0 -42
  27. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Renderer/Sourcelanguage.php +0 -39
  28. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Renderer/Targetlanguage.php +0 -40
  29. app/code/community/Textmaster/Textmaster/Block/Adminhtml/Renderer/UpdatedAt.php +0 -35
  30. app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Briefing.php +0 -56
  31. app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Creation.php +0 -76
  32. app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Islog.php +0 -50
  33. app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Login.php +0 -98
  34. app/code/community/Textmaster/Textmaster/Helper/Data.php +0 -210
  35. app/code/community/Textmaster/Textmaster/Model/Api.php +0 -1165
  36. app/code/community/Textmaster/Textmaster/Model/Document.php +0 -265
  37. app/code/community/Textmaster/Textmaster/Model/Mysql4/Document.php +0 -44
  38. app/code/community/Textmaster/Textmaster/Model/Mysql4/Document/Collection.php +0 -182
  39. app/code/community/Textmaster/Textmaster/Model/Mysql4/Project.php +0 -32
  40. app/code/community/Textmaster/Textmaster/Model/Mysql4/Project/Attribute.php +0 -32
  41. app/code/community/Textmaster/Textmaster/Model/Mysql4/Project/Attribute/Collection.php +0 -33
  42. app/code/community/Textmaster/Textmaster/Model/Mysql4/Project/Collection.php +0 -323
  43. app/code/community/Textmaster/Textmaster/Model/Observer.php +0 -46
  44. app/code/community/Textmaster/Textmaster/Model/Project.php +0 -809
  45. app/code/community/Textmaster/Textmaster/Model/Project/Attribute.php +0 -32
  46. app/code/community/Textmaster/Textmaster/Model/Source/Api/Audience.php +0 -37
  47. app/code/community/Textmaster/Textmaster/Model/Source/Api/Author.php +0 -43
  48. app/code/community/Textmaster/Textmaster/Model/Source/Api/Category.php +0 -41
  49. app/code/community/Textmaster/Textmaster/Model/Source/Api/Grammatical.php +0 -37
  50. app/code/community/Textmaster/Textmaster/Model/Source/Api/Lang.php +0 -44
  51. app/code/community/Textmaster/Textmaster/Model/Source/Api/Type.php +0 -42
  52. app/code/community/Textmaster/Textmaster/Model/Source/Api/Vocabulary.php +0 -37
  53. app/code/community/Textmaster/Textmaster/controllers/Adminhtml/Textmaster/AjaxController.php +0 -144
  54. app/code/community/Textmaster/Textmaster/controllers/Adminhtml/Textmaster/ApiController.php +0 -38
  55. app/code/community/Textmaster/Textmaster/controllers/Adminhtml/Textmaster/ProjectController.php +0 -656
  56. app/code/community/Textmaster/Textmaster/controllers/CallbackController.php +0 -117
  57. app/code/community/Textmaster/Textmaster/controllers/IndexController.php +0 -33
  58. app/code/community/Textmaster/Textmaster/etc/config.xml +0 -201
  59. app/code/community/Textmaster/Textmaster/etc/jstranslator.xml +0 -50
  60. app/code/community/Textmaster/Textmaster/etc/system.xml +0 -226
  61. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-install-0.0.1.php +0 -110
  62. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.1-0.0.2.php +0 -42
  63. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.2-0.0.3.php +0 -55
  64. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.3-0.0.4.php +0 -44
  65. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.4-0.0.5.php +0 -43
  66. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.5-0.0.6.php +0 -60
  67. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.6-0.0.7.php +0 -47
  68. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.7-0.0.8.php +0 -52
  69. app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-1.0.2-1.0.3.php +0 -25
  70. app/design/adminhtml/default/default/layout/textmaster.xml +0 -135
  71. app/design/adminhtml/default/default/template/textmaster/credit.phtml +0 -27
  72. app/design/adminhtml/default/default/template/textmaster/document/support_messages.phtml +0 -40
  73. app/design/adminhtml/default/default/template/textmaster/document/view.phtml +0 -102
  74. app/design/adminhtml/default/default/template/textmaster/form/container.phtml +0 -44
  75. app/design/adminhtml/default/default/template/textmaster/grid/container.phtml +0 -34
  76. app/design/adminhtml/default/default/template/textmaster/login.phtml +0 -28
  77. app/design/adminhtml/default/default/template/textmaster/onglet.phtml +0 -61
  78. app/design/adminhtml/default/default/template/textmaster/onglet/popinauthors.phtml +0 -32
  79. app/design/adminhtml/default/default/template/textmaster/page.phtml +0 -68
  80. app/design/adminhtml/default/default/template/textmaster/product/edit.phtml +0 -35
  81. app/design/adminhtml/default/default/template/textmaster/view.phtml +0 -148
  82. app/etc/modules/Textmaster_Textmaster.xml +0 -9
  83. app/locale/en_US/Textmaster_Textmaster.csv +0 -195
  84. app/locale/fr_FR/Textmaster_Textmaster.csv +0 -215
  85. package.xml +13 -6
  86. skin/adminhtml/default/default/css/textmaster/popin.css +0 -22
  87. skin/adminhtml/default/default/css/textmaster/styles.css +0 -176
  88. skin/adminhtml/default/default/images/textmaster/ad.png +0 -0
  89. skin/adminhtml/default/default/images/textmaster/ae.png +0 -0
  90. skin/adminhtml/default/default/images/textmaster/af.png +0 -0
  91. skin/adminhtml/default/default/images/textmaster/ag.png +0 -0
  92. skin/adminhtml/default/default/images/textmaster/al.png +0 -0
  93. skin/adminhtml/default/default/images/textmaster/am.png +0 -0
  94. skin/adminhtml/default/default/images/textmaster/ao.png +0 -0
  95. skin/adminhtml/default/default/images/textmaster/ar.png +0 -0
  96. skin/adminhtml/default/default/images/textmaster/at.png +0 -0
  97. skin/adminhtml/default/default/images/textmaster/au.png +0 -0
  98. skin/adminhtml/default/default/images/textmaster/az.png +0 -0
  99. skin/adminhtml/default/default/images/textmaster/ba.png +0 -0
  100. skin/adminhtml/default/default/images/textmaster/bb.png +0 -0
  101. skin/adminhtml/default/default/images/textmaster/bd.png +0 -0
  102. skin/adminhtml/default/default/images/textmaster/be.png +0 -0
  103. skin/adminhtml/default/default/images/textmaster/bf.png +0 -0
  104. skin/adminhtml/default/default/images/textmaster/bg.png +0 -0
  105. skin/adminhtml/default/default/images/textmaster/bh.png +0 -0
  106. skin/adminhtml/default/default/images/textmaster/bi.png +0 -0
  107. skin/adminhtml/default/default/images/textmaster/bj.png +0 -0
  108. skin/adminhtml/default/default/images/textmaster/bn.png +0 -0
  109. skin/adminhtml/default/default/images/textmaster/bo.png +0 -0
  110. skin/adminhtml/default/default/images/textmaster/br.png +0 -0
  111. skin/adminhtml/default/default/images/textmaster/bs.png +0 -0
  112. skin/adminhtml/default/default/images/textmaster/bt.png +0 -0
  113. skin/adminhtml/default/default/images/textmaster/bw.png +0 -0
  114. skin/adminhtml/default/default/images/textmaster/by.png +0 -0
  115. skin/adminhtml/default/default/images/textmaster/bz.png +0 -0
  116. skin/adminhtml/default/default/images/textmaster/ca.png +0 -0
  117. skin/adminhtml/default/default/images/textmaster/cd.png +0 -0
  118. skin/adminhtml/default/default/images/textmaster/cf.png +0 -0
  119. skin/adminhtml/default/default/images/textmaster/cg.png +0 -0
  120. skin/adminhtml/default/default/images/textmaster/ch.png +0 -0
  121. skin/adminhtml/default/default/images/textmaster/ci.png +0 -0
  122. skin/adminhtml/default/default/images/textmaster/cl.png +0 -0
  123. skin/adminhtml/default/default/images/textmaster/cm.png +0 -0
  124. skin/adminhtml/default/default/images/textmaster/cn.png +0 -0
  125. skin/adminhtml/default/default/images/textmaster/co.png +0 -0
  126. skin/adminhtml/default/default/images/textmaster/cr.png +0 -0
  127. skin/adminhtml/default/default/images/textmaster/cu.png +0 -0
  128. skin/adminhtml/default/default/images/textmaster/cv.png +0 -0
  129. skin/adminhtml/default/default/images/textmaster/cy.png +0 -0
  130. skin/adminhtml/default/default/images/textmaster/cz.png +0 -0
  131. skin/adminhtml/default/default/images/textmaster/de.png +0 -0
  132. skin/adminhtml/default/default/images/textmaster/dj.png +0 -0
  133. skin/adminhtml/default/default/images/textmaster/dk.png +0 -0
  134. skin/adminhtml/default/default/images/textmaster/dm.png +0 -0
  135. skin/adminhtml/default/default/images/textmaster/do.png +0 -0
  136. skin/adminhtml/default/default/images/textmaster/dz.png +0 -0
  137. skin/adminhtml/default/default/images/textmaster/ec.png +0 -0
  138. skin/adminhtml/default/default/images/textmaster/ee.png +0 -0
  139. skin/adminhtml/default/default/images/textmaster/eg.png +0 -0
  140. skin/adminhtml/default/default/images/textmaster/eh.png +0 -0
  141. skin/adminhtml/default/default/images/textmaster/en.png +0 -0
  142. skin/adminhtml/default/default/images/textmaster/er.png +0 -0
  143. skin/adminhtml/default/default/images/textmaster/es.png +0 -0
  144. skin/adminhtml/default/default/images/textmaster/et.png +0 -0
  145. skin/adminhtml/default/default/images/textmaster/fi.png +0 -0
  146. skin/adminhtml/default/default/images/textmaster/fj.png +0 -0
  147. skin/adminhtml/default/default/images/textmaster/flags-mini.zip +0 -0
  148. skin/adminhtml/default/default/images/textmaster/fm.png +0 -0
  149. skin/adminhtml/default/default/images/textmaster/fr.png +0 -0
  150. skin/adminhtml/default/default/images/textmaster/ga.png +0 -0
  151. skin/adminhtml/default/default/images/textmaster/gd.png +0 -0
  152. skin/adminhtml/default/default/images/textmaster/ge.png +0 -0
  153. skin/adminhtml/default/default/images/textmaster/gh.png +0 -0
  154. skin/adminhtml/default/default/images/textmaster/gm.png +0 -0
  155. skin/adminhtml/default/default/images/textmaster/gn.png +0 -0
  156. skin/adminhtml/default/default/images/textmaster/gq.png +0 -0
  157. skin/adminhtml/default/default/images/textmaster/gr.png +0 -0
  158. skin/adminhtml/default/default/images/textmaster/gt.png +0 -0
  159. skin/adminhtml/default/default/images/textmaster/gw.png +0 -0
  160. skin/adminhtml/default/default/images/textmaster/gy.png +0 -0
  161. skin/adminhtml/default/default/images/textmaster/hn.png +0 -0
  162. skin/adminhtml/default/default/images/textmaster/hr.png +0 -0
  163. skin/adminhtml/default/default/images/textmaster/ht.png +0 -0
  164. skin/adminhtml/default/default/images/textmaster/hu.png +0 -0
  165. skin/adminhtml/default/default/images/textmaster/id.png +0 -0
  166. skin/adminhtml/default/default/images/textmaster/ie.png +0 -0
  167. skin/adminhtml/default/default/images/textmaster/il.png +0 -0
  168. skin/adminhtml/default/default/images/textmaster/in.png +0 -0
  169. skin/adminhtml/default/default/images/textmaster/iq.png +0 -0
  170. skin/adminhtml/default/default/images/textmaster/ir.png +0 -0
  171. skin/adminhtml/default/default/images/textmaster/is.png +0 -0
  172. skin/adminhtml/default/default/images/textmaster/it.png +0 -0
  173. skin/adminhtml/default/default/images/textmaster/jm.png +0 -0
  174. skin/adminhtml/default/default/images/textmaster/jo.png +0 -0
  175. skin/adminhtml/default/default/images/textmaster/jp.png +0 -0
  176. skin/adminhtml/default/default/images/textmaster/ke.png +0 -0
  177. skin/adminhtml/default/default/images/textmaster/kg.png +0 -0
  178. skin/adminhtml/default/default/images/textmaster/kh.png +0 -0
  179. skin/adminhtml/default/default/images/textmaster/ki.png +0 -0
  180. skin/adminhtml/default/default/images/textmaster/km.png +0 -0
  181. skin/adminhtml/default/default/images/textmaster/kn.png +0 -0
  182. skin/adminhtml/default/default/images/textmaster/kp.png +0 -0
  183. skin/adminhtml/default/default/images/textmaster/kr.png +0 -0
  184. skin/adminhtml/default/default/images/textmaster/ks.png +0 -0
  185. skin/adminhtml/default/default/images/textmaster/kw.png +0 -0
  186. skin/adminhtml/default/default/images/textmaster/kz.png +0 -0
  187. skin/adminhtml/default/default/images/textmaster/la.png +0 -0
  188. skin/adminhtml/default/default/images/textmaster/lb.png +0 -0
  189. skin/adminhtml/default/default/images/textmaster/lc.png +0 -0
  190. skin/adminhtml/default/default/images/textmaster/li.png +0 -0
  191. skin/adminhtml/default/default/images/textmaster/lk.png +0 -0
  192. skin/adminhtml/default/default/images/textmaster/lr.png +0 -0
  193. skin/adminhtml/default/default/images/textmaster/ls.png +0 -0
  194. skin/adminhtml/default/default/images/textmaster/lt.png +0 -0
  195. skin/adminhtml/default/default/images/textmaster/lu.png +0 -0
  196. skin/adminhtml/default/default/images/textmaster/lv.png +0 -0
  197. skin/adminhtml/default/default/images/textmaster/ly.png +0 -0
  198. skin/adminhtml/default/default/images/textmaster/ma.png +0 -0
  199. skin/adminhtml/default/default/images/textmaster/mc.png +0 -0
  200. skin/adminhtml/default/default/images/textmaster/md.png +0 -0
  201. skin/adminhtml/default/default/images/textmaster/me.png +0 -0
  202. skin/adminhtml/default/default/images/textmaster/mg.png +0 -0
  203. skin/adminhtml/default/default/images/textmaster/mh.png +0 -0
  204. skin/adminhtml/default/default/images/textmaster/mk.png +0 -0
  205. skin/adminhtml/default/default/images/textmaster/ml.png +0 -0
  206. skin/adminhtml/default/default/images/textmaster/mm.png +0 -0
  207. skin/adminhtml/default/default/images/textmaster/mn.png +0 -0
  208. skin/adminhtml/default/default/images/textmaster/mr.png +0 -0
  209. skin/adminhtml/default/default/images/textmaster/mt.png +0 -0
  210. skin/adminhtml/default/default/images/textmaster/mu.png +0 -0
  211. skin/adminhtml/default/default/images/textmaster/mv.png +0 -0
  212. skin/adminhtml/default/default/images/textmaster/mw.png +0 -0
  213. skin/adminhtml/default/default/images/textmaster/mx.png +0 -0
  214. skin/adminhtml/default/default/images/textmaster/my.png +0 -0
  215. skin/adminhtml/default/default/images/textmaster/mz.png +0 -0
  216. skin/adminhtml/default/default/images/textmaster/na.png +0 -0
  217. skin/adminhtml/default/default/images/textmaster/ne.png +0 -0
  218. skin/adminhtml/default/default/images/textmaster/ng.png +0 -0
  219. skin/adminhtml/default/default/images/textmaster/ni.png +0 -0
  220. skin/adminhtml/default/default/images/textmaster/nl.png +0 -0
  221. skin/adminhtml/default/default/images/textmaster/no.png +0 -0
  222. skin/adminhtml/default/default/images/textmaster/np.png +0 -0
  223. skin/adminhtml/default/default/images/textmaster/nr.png +0 -0
  224. skin/adminhtml/default/default/images/textmaster/nz.png +0 -0
  225. skin/adminhtml/default/default/images/textmaster/om.png +0 -0
  226. skin/adminhtml/default/default/images/textmaster/pa.png +0 -0
  227. skin/adminhtml/default/default/images/textmaster/pe.png +0 -0
  228. skin/adminhtml/default/default/images/textmaster/pg.png +0 -0
  229. skin/adminhtml/default/default/images/textmaster/ph.png +0 -0
  230. skin/adminhtml/default/default/images/textmaster/pk.png +0 -0
  231. skin/adminhtml/default/default/images/textmaster/pl.png +0 -0
  232. skin/adminhtml/default/default/images/textmaster/pt.png +0 -0
  233. skin/adminhtml/default/default/images/textmaster/pw.png +0 -0
  234. skin/adminhtml/default/default/images/textmaster/py.png +0 -0
  235. skin/adminhtml/default/default/images/textmaster/qa.png +0 -0
  236. skin/adminhtml/default/default/images/textmaster/ro.png +0 -0
  237. skin/adminhtml/default/default/images/textmaster/rs.png +0 -0
  238. skin/adminhtml/default/default/images/textmaster/ru.png +0 -0
  239. skin/adminhtml/default/default/images/textmaster/rw.png +0 -0
  240. skin/adminhtml/default/default/images/textmaster/sa.png +0 -0
  241. skin/adminhtml/default/default/images/textmaster/sb.png +0 -0
  242. skin/adminhtml/default/default/images/textmaster/sc.png +0 -0
  243. skin/adminhtml/default/default/images/textmaster/sd.png +0 -0
  244. skin/adminhtml/default/default/images/textmaster/se.png +0 -0
  245. skin/adminhtml/default/default/images/textmaster/sg.png +0 -0
  246. skin/adminhtml/default/default/images/textmaster/si.png +0 -0
  247. skin/adminhtml/default/default/images/textmaster/sk.png +0 -0
  248. skin/adminhtml/default/default/images/textmaster/sl.png +0 -0
  249. skin/adminhtml/default/default/images/textmaster/sm.png +0 -0
  250. skin/adminhtml/default/default/images/textmaster/sn.png +0 -0
  251. skin/adminhtml/default/default/images/textmaster/so.png +0 -0
  252. skin/adminhtml/default/default/images/textmaster/sr.png +0 -0
  253. skin/adminhtml/default/default/images/textmaster/st.png +0 -0
  254. skin/adminhtml/default/default/images/textmaster/sv.png +0 -0
  255. skin/adminhtml/default/default/images/textmaster/sy.png +0 -0
  256. skin/adminhtml/default/default/images/textmaster/sz.png +0 -0
  257. skin/adminhtml/default/default/images/textmaster/td.png +0 -0
  258. skin/adminhtml/default/default/images/textmaster/tg.png +0 -0
  259. skin/adminhtml/default/default/images/textmaster/th.png +0 -0
  260. skin/adminhtml/default/default/images/textmaster/tj.png +0 -0
  261. skin/adminhtml/default/default/images/textmaster/tl.png +0 -0
  262. skin/adminhtml/default/default/images/textmaster/tm.png +0 -0
  263. skin/adminhtml/default/default/images/textmaster/tn.png +0 -0
  264. skin/adminhtml/default/default/images/textmaster/to.png +0 -0
  265. skin/adminhtml/default/default/images/textmaster/tr.png +0 -0
  266. skin/adminhtml/default/default/images/textmaster/tt.png +0 -0
  267. skin/adminhtml/default/default/images/textmaster/tv.png +0 -0
  268. skin/adminhtml/default/default/images/textmaster/tw.png +0 -0
  269. skin/adminhtml/default/default/images/textmaster/tz.png +0 -0
  270. skin/adminhtml/default/default/images/textmaster/ua.png +0 -0
  271. skin/adminhtml/default/default/images/textmaster/ug.png +0 -0
  272. skin/adminhtml/default/default/images/textmaster/us.png +0 -0
  273. skin/adminhtml/default/default/images/textmaster/uy.png +0 -0
  274. skin/adminhtml/default/default/images/textmaster/uz.png +0 -0
  275. skin/adminhtml/default/default/images/textmaster/va.png +0 -0
  276. skin/adminhtml/default/default/images/textmaster/vc.png +0 -0
  277. skin/adminhtml/default/default/images/textmaster/ve.png +0 -0
  278. skin/adminhtml/default/default/images/textmaster/vn.png +0 -0
  279. skin/adminhtml/default/default/images/textmaster/vu.png +0 -0
  280. skin/adminhtml/default/default/images/textmaster/ws.png +0 -0
  281. skin/adminhtml/default/default/images/textmaster/ye.png +0 -0
  282. skin/adminhtml/default/default/images/textmaster/za.png +0 -0
  283. skin/adminhtml/default/default/images/textmaster/zm.png +0 -0
  284. skin/adminhtml/default/default/images/textmaster/zw.png +0 -0
  285. skin/adminhtml/default/default/js/textmaster/script-tmp.js +0 -535
  286. skin/adminhtml/default/default/js/textmaster/script.js +0 -541
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Credit.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Credit extends Mage_Adminhtml_Block_Template
27
- {
28
- private $_noapi = false;
29
- public function __construct()
30
- {
31
-
32
- $this->_controller = 'adminhtml_project';
33
- $this->_blockGroup = 'textmaster';
34
- $api_key = Mage::getStoreConfig('textmaster/textmaster/api_key');;
35
- $api_secret = Mage::getStoreConfig('textmaster/textmaster/api_secret');
36
- if($api_key=='' || $api_secret=='') $this->_noapi = true;
37
- if($this->_noapi){
38
-
39
- }
40
- parent::__construct();
41
- }
42
- public function getCredit(){
43
- $_api = Mage::helper('textmaster')->getApi();
44
- $user_info = $_api->getUserInfo();
45
-
46
- if(isset($user_info['wallet'])){
47
- $currency = Mage::getModel('directory/currency')->load($user_info['wallet']['currency_code']);
48
- return $currency->format($user_info['wallet']['current_money']);
49
- }
50
- return '';
51
- }
52
- public function getEmail(){
53
- $_api = Mage::helper('textmaster')->getApi();
54
- $user_info = $_api->getUserInfo();
55
- if(isset($user_info['email']))
56
- return $user_info['email'];
57
- return '';
58
- }
59
-
60
-
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Document/Renderer/Status.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Document_Renderer_Status extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getStatusTexte();
31
- return ''.str_replace(' ','&nbsp;',$value).'';
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Document/Supportmessage.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Document_Supportmessage extends Mage_Adminhtml_Block_Template {
27
-
28
- private $_document;
29
-
30
- public function __construct()
31
- {
32
- parent::__construct();
33
- $this->_objectId = 'textmaster_document_supportmessage';
34
- $this->_controller = 'adminhtml_project';
35
- $this->_blockGroup = 'textmaster';
36
-
37
- }
38
-
39
- public function setDocument($document){
40
- $this->_document = $document;
41
- }
42
-
43
- public function getDocument(){
44
- return $this->_document;
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Document/View.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Document_View extends Mage_Adminhtml_Block_Widget_Container {
27
-
28
- private $_document;
29
-
30
- public function __construct()
31
- {
32
- parent::__construct();
33
- $this->_objectId = 'textmaster_document_view';
34
- $this->_controller = 'adminhtml_project';
35
- $this->_blockGroup = 'textmaster';
36
-
37
- }
38
-
39
- public function setDocument($document){
40
- $this->_document = $document;
41
- $this->removeButton('back');
42
- $this->addButton('back',array(
43
- 'label' => Mage::helper('adminhtml')->__('Back'),
44
- 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/view',array('id'=>$this->getDocument()->getProject()->getId())) . '\'',
45
- 'class' => 'back',
46
- ));
47
- if($this->_document->canComplete()){
48
- $this->addButton('complete',array(
49
- 'label' => Mage::helper('adminhtml')->__('Update file'),
50
- 'onclick' => 'completeDocument(\'' . $this->getUrl('*/*/doccomplete',array('id'=>$this->getDocument()->getId())) . '\','.$this->getDocument()->getId().')',
51
- 'class' => 'save',
52
- ));
53
- $btn = $this->addButton('revision',array(
54
- 'label' => Mage::helper('adminhtml')->__('Put in revision'),
55
- 'onclick' => "showCompare('" . $this->getUrl('*/*/view',array('id'=>$this->getDocument()->getProject()->getId()))."');",
56
- 'class' => 'save',
57
- ));
58
-
59
- }
60
-
61
- return $this;
62
- }
63
-
64
- public function getDocument(){
65
-
66
- return $this->_document;
67
- }
68
-
69
-
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project extends Mage_Adminhtml_Block_Widget_Grid_Container
27
- {
28
- public function __construct()
29
- {
30
-
31
- $this->_controller = 'adminhtml_project';
32
- $this->_blockGroup = 'textmaster';
33
- $this->_headerText = Mage::helper('textmaster')->__('My Projects');
34
- $this->_addButtonLabel = Mage::helper('textmaster')->__('New Project');
35
- parent::__construct();
36
- }
37
-
38
-
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Grid.php DELETED
@@ -1,326 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Grid extends Mage_Adminhtml_Block_Widget_Grid {
27
-
28
- private $_is_regex_op = array(
29
- 'name',
30
- 'ref'
31
- );
32
-
33
- public function __construct() {
34
- parent::__construct ();
35
- $this->setId ( 'projetGrid' );
36
- $this->setDefaultSort ( 'textmaster_project_id' );
37
- $this->setDefaultDir ( 'DESC' );
38
- //$this->setDefaultLimit(3);
39
- $this->setSaveParametersInSession ( true );
40
- }
41
-
42
- protected function _prepareCollection() {
43
- $collection = Mage::getModel ( 'textmaster/project' )->getCollection()->setAllProject(true);
44
- $this->setCollection ( $collection );
45
-
46
- return parent::_prepareCollection ();
47
-
48
- }
49
-
50
-
51
- protected function _prepareColumns() {
52
- $this->addColumn ( 'name', array (
53
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Name' ),
54
- 'align' => 'left',
55
- 'width' => '150px',
56
- 'index' => 'name',
57
- 'filter_condition_callback' => array($this, '_apiFilter'),
58
- ));
59
-
60
- $this->addColumn ( 'reference', array (
61
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Reference' ),
62
- 'align' => 'right',
63
- 'width' => '50px',
64
- 'index' => 'reference',
65
- 'filter_condition_callback' => array($this, '_apiFilter'),
66
- ));
67
-
68
- $this->addColumn ( 'store_id_origin', array (
69
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Source language' ),
70
- 'align' => 'right',
71
- 'width' => '150px',
72
- 'index' => 'store_id_origin',
73
- 'type' => 'options',
74
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Renderer_Sourcelanguage',
75
- 'filter_condition_callback' => array($this, '_apiFilter'),
76
- 'options' => Mage::getModel('core/store')->getCollection()->toOptionHash()
77
- ));
78
-
79
- $this->addColumn ( 'store_id_translation', array (
80
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Target language' ),
81
- 'align' => 'right',
82
- 'width' => '100px',
83
- 'index' => 'store_id_translation',
84
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Renderer_Targetlanguage',
85
- 'type' => 'options',
86
- 'options' => Mage::getModel('core/store')->getCollection()->toOptionHash(),
87
- 'filter_condition_callback' => array($this, '_apiFilter')
88
- //'options' => Mage::getModel('textmaster/source_api_lang')->toOptions()
89
- ));
90
-
91
- $this->addColumn ( 'level', array (
92
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Level' ),
93
- 'align' => 'right',
94
- 'width' => '50px',
95
- 'index' => 'level' ,
96
- 'type' => 'options',
97
- 'options'=> array (
98
- Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_REGULAR => ucfirst(Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_REGULAR),
99
- Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_PREMIUM => 'Standard',
100
- Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_ENTERPRISE => ucfirst(Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_ENTERPRISE),
101
- ),
102
- 'filter_condition_callback' => array($this, '_apiFilter'),
103
- ));
104
-
105
- $this->addColumn ( 'nb_document', array (
106
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Number of documents' ),
107
- 'align' => 'right',
108
- 'width' => '20px',
109
- 'type' => 'number',
110
- 'index' => 'nb_document',
111
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Nbdocument' ,
112
- 'filter_condition_callback' => array($this, '_apiFilter'),
113
- ));
114
-
115
- $this->addColumn ( 'total_word_count', array (
116
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Total word count' ),
117
- 'align' => 'right',
118
- 'width' => '40px',
119
- 'index' => 'total_word_count' ,
120
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Wordcount',
121
- 'type' => 'number',
122
- 'filter_condition_callback' => array($this, '_apiFilter'),
123
- ));
124
-
125
- $this->addColumn ( 'price', array (
126
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Price' ),
127
- 'align' => 'right',
128
- 'width' => '50px',
129
- 'type' => 'currency',
130
- 'index' => 'price',
131
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Price' ,
132
- 'filter_condition_callback' => array($this, '_apiFilter'),
133
- ));
134
-
135
- $this->addColumn ( 'progression', array (
136
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Progression' ),
137
- 'align' => 'right',
138
- 'width' => '50px',
139
- 'type' => 'number',
140
- 'index' => 'progression',
141
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Progression' ,
142
- 'filter_condition_callback' => array($this, '_apiFilter'),
143
- ));
144
-
145
- $this->addColumn ( 'status', array (
146
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Status' ),
147
- 'align' => 'right',
148
- 'width' => '50px',
149
- 'index' => 'status',
150
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Status' ,
151
- 'type' => 'options',
152
- 'options' => Mage::getSingleton('textmaster/project')->getStatuses(),
153
- 'filter_condition_callback' => array($this, '_apiFilter'),
154
- ));
155
-
156
- $this->addColumn ( 'updated_at', array (
157
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Last change' ),
158
- 'align' => 'right',
159
- 'width' => '50px',
160
- 'index' => 'updated_at',
161
- 'type' => 'datetime',
162
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Renderer_UpdatedAt' ,
163
- 'filter_condition_callback' => array($this, '_apiFilter'),
164
- ));
165
-
166
- $this->addColumn ( 'actions', array (
167
- 'header' => Mage::helper ( 'textmaster' )->__ ( 'Actions' ),
168
- 'align' => 'right',
169
- 'width' => '50',
170
- 'type' => 'action',
171
- 'getter' => 'getId',
172
- 'filter' => false,
173
- 'sortable' => false,
174
- 'actions' => array(
175
- array(
176
- 'caption' => Mage::helper('textmaster')->__('View'),
177
- 'url' => array('base'=> '*/*/view'),
178
- 'field' => 'id'
179
- )
180
- ),
181
- 'index' => 'actions'
182
- ));
183
-
184
- return parent::_prepareColumns ();
185
- }
186
- protected function _prepareMassaction() {
187
- $this->setMassactionIdField ( 'textmaster_project_id' );
188
- $this->getMassactionBlock ()->setFormFieldName ( 'project_id' );
189
-
190
- $this->getMassactionBlock ()->addItem ( 'launch', array (
191
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Launch' ),
192
- 'url' => $this->getUrl ( '*/*/massLaunch' )
193
- ));
194
- $this->getMassactionBlock ()->addItem ( 'pause', array (
195
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Pause' ),
196
- 'url' => $this->getUrl ( '*/*/massPause' )
197
- ));
198
- $this->getMassactionBlock ()->addItem ( 'resume', array (
199
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Resume' ),
200
- 'url' => $this->getUrl ( '*/*/massResume' )
201
- ));
202
- $this->getMassactionBlock ()->addItem ( 'cancel', array (
203
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Cancel' ),
204
- 'url' => $this->getUrl ( '*/*/massCancel' )
205
- ));
206
- $this->getMassactionBlock ()->addItem ( 'complete', array (
207
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Complete' ),
208
- 'url' => $this->getUrl ( '*/*/massComplete' )
209
- ));
210
- $this->getMassactionBlock ()->addItem ( 'duplicate', array (
211
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Duplicate' ),
212
- 'url' => $this->getUrl ( '*/*/massDuplicate' )
213
- ));
214
-
215
- return $this;
216
- }
217
- protected function _prepareMassactionColumn()
218
- {
219
- $columnId = 'massaction';
220
- $massactionColumn = $this->getLayout()->createBlock('adminhtml/widget_grid_column')
221
- ->setData(array(
222
- 'index' => $this->getMassactionIdField(),
223
- 'filter_index' => $this->getMassactionIdFilter(),
224
- 'type' => 'massaction',
225
- 'name' => $this->getMassactionBlock()->getFormFieldName(),
226
- 'align' => 'center',
227
- 'is_system' => true,
228
- 'filter' => false,
229
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Grid_Column_Renderer_Massaction'
230
- ));
231
-
232
- if ($this->getNoFilterMassactionColumn()) {
233
- $massactionColumn->setData('filter', false);
234
- }
235
-
236
- $massactionColumn->setSelected($this->getMassactionBlock()->getSelected())
237
- ->setGrid($this)
238
- ->setId($columnId);
239
-
240
- $oldColumns = $this->_columns;
241
- $this->_columns = array();
242
- $this->_columns[$columnId] = $massactionColumn;
243
- $this->_columns = array_merge($this->_columns, $oldColumns);
244
- return $this;
245
- }
246
- public function getRowUrl($row) {
247
- if($row->getId ())
248
- return $this->getUrl ( '*/*/view', array (
249
- 'id' => $row->getId ()
250
- ) );
251
- }
252
- public function _apiFilter($collection, $column) {
253
- if (!$value = $column->getFilter()->getValue()) {
254
- return $this;
255
- }
256
-
257
- $index = $column->getIndex();
258
- $subsitute = $this->getCollection()->getSubstitute();
259
- if(isset($subsitute[$index])) $index = $subsitute[$index];
260
- else return $this;
261
-
262
- $filters = array();
263
- if($index=='progress'){
264
- if(isset($value['from']))
265
- $filters[$index]['$gte'] = $value['from']/100;
266
- if(isset($value['to']))
267
- $filters[$index]['$lte'] = $value['to']/100;
268
- } elseif($column->getType()=='number'){
269
- if(isset($value['from']))
270
- $filters[$index]['$gte'] = (int)$value['from'];
271
- if(isset($value['to']))
272
- $filters[$index]['$lte'] = (int)$value['to'];
273
- } elseif($column->getType()=='currency'){
274
- if(isset($value['from']))
275
- $filters[$index]['$gte'] = (int)$value['from'];
276
- if(isset($value['to']))
277
- $filters[$index]['$lte'] = (int)$value['to'];
278
- } elseif($column->getType()=='datetime' ){
279
- //
280
- if(isset($value['from']))
281
- $filters[$index]['$gte'] = date('Y-m-d',$value['from']->getTimestamp()).'T00:00:00Z';
282
- if(isset($value['to']))
283
- $filters[$index]['$lte'] = date('Y-m-d',$value['to']->getTimestamp()).'T23:59:59Z';
284
- } elseif(in_array($index,$this->_is_regex_op)) {
285
- $filters[$index]['$regex'] = '/'.$value.'/i';
286
- } else {
287
- if($index == 'language_from_code' || $index == 'language_to_code') {
288
- $localecode = Mage::getStoreConfig('general/locale/code', $value);
289
- $data = explode('_', $localecode);
290
- $value = $data[0];
291
- }
292
- $filters[$index] = $value;
293
- }
294
- $this->getCollection()->addFiltersApi($filters);
295
- return $this;
296
- }
297
- public function _standardFilter($collection, $column) {
298
- if (!$value = $column->getFilter()->getValue()) {
299
- return $this;
300
- }
301
- $filters[$column->getIndex()] = $value;
302
- $this->getCollection()->addFiltersStandard($filters);
303
- }
304
- protected function _addColumnFilterToCollection($column)
305
- {
306
- if ($this->getCollection()) {
307
- $field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
308
- if ($column->getFilterConditionCallback()) {
309
- call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
310
- } else {
311
- $cond = $column->getFilter()->getCondition();
312
- if ($field && isset($cond)) {
313
- $this->getCollection()->addFieldToFilter('main_table.'.$field , $cond);
314
- }
315
- }
316
- }
317
- return $this;
318
- }
319
- public function getRowClass($row) {
320
- if(!$row->getId ()) return 'text-disable';
321
- return '';
322
- }
323
-
324
-
325
-
326
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Grid/Column/Renderer/Checkbox.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Grid_Column_Renderer_Checkbox extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox {
27
-
28
- protected function _getCheckboxHtml($value, $checked)
29
- {
30
-
31
- $html = '<input type="checkbox" ';
32
- $html .= 'name="' . $this->getColumn()->getFieldName() . '" ';
33
- $html .= 'value="' . $this->escapeHtml($value) . '" ';
34
- $html .= 'class="'. ($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox') .'"';
35
- $html .= $checked . $this->getDisabled() . '/>';
36
-
37
- return $html;
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Grid/Column/Renderer/Massaction.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Grid_Column_Renderer_Massaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox {
27
-
28
- protected function _getCheckboxHtml($value, $checked)
29
- {
30
- $collection = $this->getColumn()->getGrid()->getCollection();
31
- foreach($collection as $project){
32
- if(empty($value)){
33
- return '';
34
- }
35
- }
36
- $html = '<input type="checkbox" name="' . $this->getColumn()->getName() . '" ';
37
- $html .= 'value="' . $this->escapeHtml($value) . '" class="massaction-checkbox"' . $checked . '/>';
38
- return $html;
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets extends Mage_Adminhtml_Block_Widget_Form_Container {
27
- public function __construct() {
28
- parent::__construct ();
29
- $this->_objectId = 'textmaster_project_id';
30
- $this->_controller = 'adminhtml_project';
31
- $this->_blockGroup = 'textmaster';
32
-
33
- $this->_removeButton ( 'save' );
34
- $this->_removeButton ( 'delete' );
35
- $this->_removeButton ( 'back' );
36
- $this->_removeButton ( 'saveandcontinue' );
37
- $this->_removeButton ( 'reset' );
38
- $step = $this->getRequest ()->getParam ( "step" );
39
- if ($step == 2) {
40
- $this->_addButton ( 'save', array (
41
- 'label' => Mage::helper ( 'adminhtml' )->__ ( 'Continue' ),
42
- 'onclick' => 'valideStep2();',
43
- 'class' => 'save'
44
- ), - 100 );
45
- }
46
- if ($step == 3) {
47
-
48
- }
49
- }
50
- public function getHeaderText() {
51
- /*
52
- * if( Mage::registry('project_data') && Mage::registry('project_data')->getId()) { return Mage::helper('textmaster')->__("Edit Project '%s'", $this->htmlEscape(Mage::registry('project_data')->getId())); } else { return Mage::helper('textmaster')->__('Add Project'); }
53
- */
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Form.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Form extends Mage_Adminhtml_Block_Widget_Form
27
- {
28
- protected function _prepareForm()
29
- {
30
- $form = new Varien_Data_Form(
31
- array(
32
- 'id' => 'edit_form',
33
- 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
34
- 'method' => 'post',
35
- )
36
- );
37
- $form->setUseContainer(true);
38
- $this->setForm($form);
39
- return parent::_prepareForm();
40
- }
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step1.php DELETED
@@ -1,256 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Step1 extends Mage_Adminhtml_Block_Widget_Grid
27
- {
28
- public function __construct()
29
- {
30
- parent::__construct();
31
- $this->setId('step1');
32
- $this->setDefaultSort('textmaster_project_id');
33
- $this->setDefaultDir('DESC');
34
- //$this->setDefaultLimit(10);
35
- //$this->setSaveParametersInSession(true);
36
- //$this->setUseAjax(true);
37
-
38
- }
39
-
40
- protected function _getStore()
41
- {
42
- $storeId = (int) $this->getRequest()->getParam('store', 0);
43
- return Mage::app()->getStore($storeId);
44
- }
45
-
46
- protected function _prepareCollection()
47
- {
48
- //Table name
49
- $table_project = Mage::getResourceModel('textmaster/project')->getMainTable();
50
- $table_document = Mage::getResourceModel('textmaster/document')->getMainTable();
51
-
52
- $store = $this->_getStore();
53
- $subcollection = Mage::getModel('core/store')->getCollection();
54
- $subcollection->getSelect()->reset(Zend_Db_Select::COLUMNS)->columns(new Zend_Db_Expr('GROUP_CONCAT(main_table.store_id SEPARATOR ";") as store_name_to,GROUP_CONCAT(main_table.store_id SEPARATOR ";") as store_id_to, tdocument.product_id'))
55
- ->joinInner(array('tproject'=>$table_project),'main_table.store_id = tproject.store_id_translation', array())
56
- ->joinInner(array('tdocument'=>$table_document),'tproject.textmaster_project_id = tdocument.textmaster_project_id', array())
57
- ->where('tproject.store_id_translation!=tproject.store_id_origin')
58
- ->order('tproject.textmaster_project_id')->group('product_id');
59
-
60
- $subcollection2 = Mage::getModel('core/store')->getCollection();
61
- $subcollection2->getSelect()->reset(Zend_Db_Select::COLUMNS)->columns(new Zend_Db_Expr('GROUP_CONCAT(main_table.store_id SEPARATOR ";") as store_name_from, tdocument2.product_id'))
62
- ->joinInner(array('tproject2'=>$table_project),'main_table.store_id = tproject2.store_id_origin', array())
63
- ->joinInner(array('tdocument2'=>$table_document),'tproject2.textmaster_project_id = tdocument2.textmaster_project_id', array())
64
- ->where('tproject2.store_id_translation!=tproject2.store_id_origin')
65
- ->order('tproject2.textmaster_project_id')->group('tdocument2.product_id');
66
-
67
-
68
- $collection = Mage::getModel('catalog/product')->getCollection()
69
- ->addAttributeToSelect('sku')
70
- ->addAttributeToSelect('name')
71
- ->addAttributeToSelect('type_id');
72
-
73
- if ($store->getId()) {
74
- $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
75
- $collection->addStoreFilter($store);
76
- $collection->joinAttribute(
77
- 'name',
78
- 'catalog_product/name',
79
- 'entity_id',
80
- null,
81
- 'inner',
82
- $adminStore
83
- );
84
- $collection->joinAttribute(
85
- 'custom_name',
86
- 'catalog_product/name',
87
- 'entity_id',
88
- null,
89
- 'inner',
90
- $store->getId()
91
- );
92
- $collection->joinAttribute(
93
- 'status',
94
- 'catalog_product/status',
95
- 'entity_id',
96
- null,
97
- 'inner',
98
- $store->getId()
99
- );
100
- $collection->joinAttribute(
101
- 'visibility',
102
- 'catalog_product/visibility',
103
- 'entity_id',
104
- null,
105
- 'inner',
106
- $store->getId()
107
- );
108
- $collection->joinAttribute(
109
- 'price',
110
- 'catalog_product/price',
111
- 'entity_id',
112
- null,
113
- 'left',
114
- $store->getId()
115
- );
116
- }
117
- else {
118
- $collection->addAttributeToSelect('price');
119
- $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
120
- $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
121
- }
122
-
123
- $collection->getSelect()->joinLeft(array('ttranslation' => new Zend_Db_Expr('('.$subcollection->getSelect()->__toString().')')),'ttranslation.product_id = e.entity_id');
124
- $collection->getSelect()->joinLeft(array('ttranslation2'=> new Zend_Db_Expr('('.$subcollection2->getSelect()->__toString().')')),'ttranslation2.product_id = e.entity_id');
125
-
126
- $this->setCollection($collection);
127
- return parent::_prepareCollection();
128
- }
129
-
130
- protected function _prepareColumns()
131
- {
132
- $this->addColumn('entity_id',
133
- array(
134
- 'header'=> Mage::helper('catalog')->__('ID'),
135
- 'width' => '50px',
136
- 'type' => 'number',
137
- 'index' => 'entity_id',
138
- ));
139
-
140
- $this->addColumn('name',
141
- array(
142
- 'header'=> Mage::helper('catalog')->__('Name'),
143
- 'index' => 'name',
144
- ));
145
-
146
- $this->addColumn('type',
147
- array(
148
- 'header'=> Mage::helper('catalog')->__('Type'),
149
- 'width' => '60px',
150
- 'index' => 'type_id',
151
- 'type' => 'options',
152
- 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
153
- ));
154
-
155
-
156
- $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
157
- ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
158
- ->load()
159
- ->toOptionHash();
160
-
161
- $this->addColumn('set_name',
162
- array(
163
- 'header'=> Mage::helper('catalog')->__('Attrib. Set Name'),
164
- 'width' => '100px',
165
- 'index' => 'attribute_set_id',
166
- 'type' => 'options',
167
- 'options' => $sets,
168
- ));
169
-
170
- $this->addColumn('status',
171
- array(
172
- 'header'=> Mage::helper('catalog')->__('Status'),
173
- 'width' => '70px',
174
- 'index' => 'status',
175
- 'type' => 'options',
176
- 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
177
- ));
178
-
179
- $this->addColumn('visibility',
180
- array(
181
- 'header'=> Mage::helper('catalog')->__('Visibility'),
182
- 'width' => '70px',
183
- 'index' => 'visibility',
184
- 'type' => 'options',
185
- 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
186
- ));
187
-
188
- $this->addColumn('sku',
189
- array(
190
- 'header'=> Mage::helper('catalog')->__('SKU'),
191
- 'width' => '80px',
192
- 'index' => 'sku',
193
- ));
194
-
195
- $store = $this->_getStore();
196
- $this->addColumn('price',
197
- array(
198
- 'header' => Mage::helper('catalog')->__('Price'),
199
- 'type' => 'price',
200
- 'currency_code' => $store->getBaseCurrency()->getCode(),
201
- 'index' => 'price',
202
- ));
203
-
204
- $aOptions = Mage::getModel('core/store')->getCollection()->toOptionHash();
205
- foreach ($aOptions as $k=> $aOption){
206
- $aOptions[$k] = Mage::helper('catalog')->__('Missing translation: ').$aOption;
207
- }
208
- $this->addColumn('translation',
209
- array(
210
- 'header' => Mage::helper('catalog')->__('Traduction existante'),
211
- 'width' => '80px',
212
- 'index' => 'store_name',
213
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Store',
214
- 'type' => 'options',
215
- 'options' => $aOptions,
216
- 'filter_condition_callback' => array($this, 'translationFilter'),
217
- ));
218
-
219
-
220
- return parent::_prepareColumns();
221
- }
222
- public function translationFilter($collection, $column){
223
-
224
- if (!$value = $column->getFilter()->getValue()) {
225
- return $this;
226
- }
227
- $store_name = Mage::getModel('core/store')->load($value)->getName();
228
-
229
- $collection->getSelect()->where(new Zend_Db_Expr("(ttranslation.store_name_to NOT LIKE '%;$value%' AND ttranslation.store_name_to NOT LIKE '%$value;%' AND ttranslation.store_name_to <> '$value') OR ttranslation.store_name_to IS NULL"));
230
- $sql = $collection->getSelect()->__toString();
231
-
232
- return $this;
233
- }
234
-
235
- protected function _prepareMassaction()
236
- {
237
- $this->setMassactionIdField('entity_id');
238
- $this->getMassactionBlock()->setFormFieldName('products_id');
239
-
240
- $this->getMassactionBlock()->addItem('ajouter', array(
241
- 'label'=> Mage::helper('textmaster')->__('Add'),
242
- 'url'=> $this->getUrl('*/*/massAdd')
243
- ));
244
- Mage::dispatchEvent('adminhtml_catalog_product_grid_prepare_massaction', array('block' => $this));
245
-
246
- return $this;
247
- }
248
-
249
- public function getRowUrl($row)
250
- {
251
- // return $this->getUrl('aoadmin/catalog_product/edit', array('id' => $row->getId()));
252
- return false;
253
- }
254
-
255
-
256
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step2.php DELETED
@@ -1,431 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Step2 extends Mage_Adminhtml_Block_Widget_Form {
27
-
28
- private $_exclude_attribute = array(
29
- 'ean',
30
- 'sku',
31
- 'custom_layout_update',
32
- 'recurring_profile',
33
- 'small_image',
34
- 'image',
35
- 'thumbnail',
36
- 'media_gallery',
37
- 'gallery',
38
- 'url_path',
39
- 'custom_design',
40
- 'page_layout',
41
- 'options_container',
42
- 'country_of_manufacture',
43
- 'msrp_enabled',
44
- 'msrp_display_actual_price_type',
45
- );
46
-
47
- protected function _prepareForm() {
48
- $_api = Mage::helper('textmaster')->getApi();
49
- Mage::helper('textmaster')->getApi();
50
- $form = new Varien_Data_Form (array(
51
- 'id' => 'edit_form',
52
- 'action' => $this->getUrl('*/*/addproject', array('step' => 2)),
53
- 'method' => 'post',
54
- 'enctype' => 'multipart/form-data'
55
- ));
56
- $form->setUseContainer(true);
57
- $this->setForm ( $form );
58
- $fieldset = $form->addFieldset ( 'project_type', array (
59
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Project' )
60
- ));
61
-
62
-
63
- $ctype = $fieldset->addField ( 'ctype', 'select', array (
64
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Type' ),
65
- 'class' => 'required-entry',
66
- 'required' => true,
67
- 'name' => 'ctype',
68
- 'values' => array (
69
- /*'-1' => Mage::helper ( 'textmaster' )->__ ( 'Select type' ),*/
70
- //Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_COPYWRITING => ucfirst ( Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_COPYWRITING ),
71
- Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_TRANSLATION => Mage::helper ( 'textmaster' )->__ (ucfirst ( Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_TRANSLATION )),
72
- Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_PROOFREADING => Mage::helper ( 'textmaster' )->__ (ucfirst ( Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_PROOFREADING ))
73
- ),
74
- 'disabled' => false,
75
- 'readonly' => false
76
- ));
77
-
78
- $products_id = Mage::getSingleton('core/session')->getSelectedProducts();
79
- $text = '';
80
- $products = array();
81
- foreach($products_id as $id){
82
- $products[] = Mage::getModel('catalog/product')->load($id);
83
- }
84
-
85
- $fieldset = $form->addFieldset ( 'project_attribute', array (
86
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Fields to translate' )
87
- ) );
88
- $aAttributes = Mage::getModel ( 'catalog/product' )->getAttributes ();
89
- $aResult = array();
90
- $aAfterJs = array();
91
- $first = true;
92
- $this->_name_attribute_id = false;
93
- $this->_description_attribute_id = false;
94
- $this->_short_description_attribute_id = false;
95
- foreach(Mage::app()->getStores() as $k => $store){
96
-
97
- $productCollection = Mage::getModel('catalog/product')->getCollection();
98
- $productCollection->addStoreFilter($store->getId());
99
- foreach ($aAttributes as $attr){
100
- if($attr->getAttributecode()=='name') $this->_name_attribute_id = $attr->getAttributeId();
101
- if($attr->getAttributecode()=='description') $this->_description_attribute_id = $attr->getAttributeId();
102
- if($attr->getAttributecode()=='short_description') $this->_short_description_attribute_id = $attr->getAttributeId();
103
-
104
- if(in_array($attr->getAttributecode(),$this->_exclude_attribute)) continue;
105
-
106
- if ($attr->getBackendType () == 'varchar' || $attr->getBackendType () == 'text') {
107
- $productCollection->addAttributeToSelect($attr->getAttributecode());
108
- }
109
- }
110
- $productCollection->getSelect()->where('product_id IN ('.implode(',',$products_id).')');
111
-
112
-
113
-
114
- foreach ( $aAttributes as $attr ) {
115
-
116
- if(in_array($attr->getAttributecode(),$this->_exclude_attribute)) continue;
117
- if ($attr->getBackendType () == 'varchar' || $attr->getBackendType () == 'text') {
118
- $word_count = 0;
119
- foreach($productCollection as $product){
120
- $word_count += Mage::helper ( 'textmaster' )->countWord($product->getData($attr->getAttributecode()));
121
- }
122
- if($first){
123
- $aResult [] = array (
124
- 'value' => $attr->getAttributeId(),
125
- 'label' => Mage::helper('catalog')->__($attr->getFrontendLabel ()) . ' - <span class="tprice">'.$word_count.'</span> '.Mage::helper('textmaster')->__('word(s)')
126
- );
127
- }
128
- $aAfterJs[$store->getId()][$attr->getAttributeId()] = $word_count;
129
- }
130
- }
131
- $first = false;
132
- }
133
- $tarifs = $_api->getPricings();
134
- $currency = Mage::getModel('directory/currency')->load($tarifs['code']);
135
- $curr = Mage::app()->getLocale()->currency($currency->getCode());
136
-
137
- if($this->getProject() && $this->getProject()->hasDocumentsNotCount()) {
138
- $docs = $this->getProject()->getDocuments();
139
- $docsc = $this->getProject()->getDocumentsNotCount();
140
- $ndoc = count($docs);
141
- $ndocc = count($docsc);
142
- $nd = $ndoc-$ndocc;
143
- $nd = $nd / $ndoc;
144
- $r = round($nd,2)*100;
145
- } else {
146
- $r = 100;
147
- }
148
- $attributes = $fieldset->addField ( 'attribute', 'checkboxes', array (
149
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Product informations' ),
150
- 'name' => 'attribute[]',
151
- 'values' => $aResult
152
- ) )->setAfterElementHtml('
153
- <button id="all-attributes">'.Mage::helper ( 'textmaster' )->__ ( 'Select all' ).'</button>
154
- <button id="notall-attributes">'.Mage::helper ( 'textmaster' )->__ ( 'Deselect all' ).'</button>
155
- <script>
156
- var attribute_word_count = '.Mage::helper('core')->jsonEncode($aAfterJs).';
157
- var nouveau_message_loader = "'.Mage::helper ( 'textmaster' )->__ ( 'Nouveau message variable' ).'";
158
- var message_loader_tm = "'.Mage::helper ( 'textmaster' )->__ ( 'message_loader_tm' ).'";
159
- var must_display_loader = '.($this->getProject() && ($this->getProject()->hasDocumentsNotCount() || ($this->getProject()->getTranslationMemory() && ($this->getProject()->getTranslationMemoryStatus() == Textmaster_Textmaster_Model_Project::PROJECT_TM_STATUS_IN_PROGRESS || $this->getProject()->getTranslationMemoryStatus() == Textmaster_Textmaster_Model_Project::PROJECT_TM_STATUS_COMPLETED))) ?"true":'false').';
160
- var pourcent_avance = '.$r.';
161
- var textmasterurl_count = "'.($this->getProject()?Mage::getSingleton('adminhtml/url')->getUrl('*/*/createprojectready',array('id'=>$this->getProject()->getId())):'').'";
162
- var currency_symbol = "'.$curr->getSymbol().'";
163
- </script>');
164
-
165
-
166
-
167
- $fieldset = $form->addFieldset ( 'project_languages', array (
168
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Languages' )
169
- ) );
170
-
171
- $languages = $_api->getLanguages ();
172
- $used_language = array();
173
- foreach ($languages as $language){
174
- $used_language[] = $language['code'];
175
- }
176
-
177
- $stores = Mage::getModel('core/store')->getCollection();
178
-
179
- $languagesSelect = array ();
180
- $correspondances = array ();
181
- $languagesSelect [''] = Mage::helper ( 'textmaster' )->__ ( 'Select a language' );
182
- foreach($stores as $store) {
183
- // $code = Mage::getStoreConfig('general/locale/code',$store->getId());
184
- // $local = explode('_',$code);
185
- $local = Mage::helper('textmaster')->getFormatedLangCode($store->getId());
186
- if(in_array($local,$used_language))
187
- $languagesSelect [$store->getId()] = $store->getWebsite()->getName().' - '.$store->getName();
188
- $correspondances[$store->getId()] = $local;
189
- }
190
-
191
-
192
-
193
- $fieldset->addField ( 'store_id_origin', 'select', array (
194
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Source language' ),
195
- 'class' => 'required-entry',
196
- 'required' => true,
197
- 'name' => 'store_id_origin',
198
- 'values' => $languagesSelect,
199
- 'disabled' => false,
200
- 'readonly' => false
201
- ) );
202
-
203
- $language_to = $fieldset->addField ( 'store_id_translation', 'select', array (
204
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Target language' ),
205
- 'class' => 'required-entry',
206
- 'required' => true,
207
- 'name' => 'store_id_translation',
208
- 'values' => $languagesSelect,
209
- 'disabled' => false,
210
- 'readonly' => false
211
- ) );
212
-
213
- $this->setChild ( 'form_after', $this->getLayout ()->createBlock ( 'adminhtml/widget_form_element_dependence' )->addFieldMap ( $ctype->getHtmlId (), $ctype->getName () )->addFieldMap ( $language_to->getHtmlId (), $language_to->getName () )->addFieldDependence ( $language_to->getName (), $ctype->getName (), Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_TRANSLATION ) );
214
-
215
-
216
-
217
-
218
- $fieldset = $form->addFieldset ( 'project_options', array (
219
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Pricing options' )
220
- ));
221
-
222
-
223
-
224
- $fieldset->addField('language_level', 'select', array(
225
- 'label' => Mage::helper('textmaster')->__('Service level'),
226
- 'name' => 'language_level',
227
- 'required' => true,
228
- 'values' => array(
229
- // Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_REGULAR => ucfirst(Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_REGULAR),
230
- Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_PREMIUM => 'Standard',
231
- Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_ENTERPRISE => ucfirst(Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_ENTERPRISE),
232
- ),
233
- // Mage::helper('textmaster')->__('Regular (%s/word): native-speaking translator for word-for-word translations of short texts.',$currency->format($tarifs['types']['translation']['regular'])).'<br/>'.
234
- 'after_element_html' => '<br/><small>'.
235
- Mage::helper('textmaster')->__('Standard (%s/word): Qualified native-speaking translators - best for short and simple projects.',$currency->format($tarifs['types']['translation']['premium'])) .'<br/>'.
236
- Mage::helper('textmaster')->__('Enterprise (%s/word): Professional translators - best for complex projects or high volume catalogs.',$currency->format($tarifs['types']['translation']['enterprise'])) .'<br/>'.
237
- '</small>',
238
- ));
239
-
240
-
241
- $fieldset->addField ( 'quality', 'select', array (
242
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Quality Control (+%s/word)', $currency->format($tarifs['types']['translation']['quality'],array(),false)),
243
- 'name' => 'quality',
244
- 'required' => true,
245
- 'values' => array(
246
- Mage::helper ( 'textmaster' )->__ ( 'No' ),
247
- Mage::helper ( 'textmaster' )->__ ( 'Yes' )
248
- ),
249
- 'after_element_html' => '<br/><small>'.Mage::helper('textmaster')->__('The translator\'s work will be proofread and corrected by TextMaster').'</small>',
250
- ) );
251
- $fieldset->addField ( 'priority', 'select', array (
252
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Priority Order (+%s/word)', $currency->format($tarifs['types']['translation']['priority'],array(),false) ),
253
- 'name' => 'priority',
254
- 'required' => true,
255
- 'values' => array(
256
- Mage::helper ( 'textmaster' )->__ ( 'No' ),
257
- Mage::helper ( 'textmaster' )->__ ( 'Yes' )
258
- ),
259
- 'after_element_html' => '<br/><small>'.Mage::helper('textmaster')->__('Your project will be assigned a higher priority status.').'</small>',
260
- ) );
261
- // $fieldset->addField ( 'expertise', 'select', array (
262
- // 'label' => Mage::helper ( 'textmaster' )->__ ( 'Expertise (+%s/word)', $currency->format($tarifs['types']['translation']['expertise'],array(),false) ),
263
- // 'name' => 'expertise',
264
- // 'required' => true,
265
- // 'values' => array(
266
- // Mage::helper ( 'textmaster' )->__ ( 'No' ),
267
- // Mage::helper ( 'textmaster' )->__ ( 'Yes' )
268
- // ),
269
- // 'after_element_html' => '<br/><small>'.Mage::helper('textmaster')->__('We provide you with an expert in the selected category.').'</small>',
270
-
271
- // ) );
272
- $fieldset->addField('translation_memory', 'select', array (
273
- 'label' => Mage::helper('textmaster')->__('Translation memory (+%s/word)', $currency->format($tarifs['types']['translation']['translation_memory'], array(), false)),
274
- 'name' => 'translation_memory',
275
- 'disabled' => 'disabled',
276
- 'required' => true,
277
- 'values' => array(
278
- Mage::helper ( 'textmaster' )->__ ( 'No' ),
279
- Mage::helper ( 'textmaster' )->__ ( 'Yes' )
280
- ),
281
- 'after_element_html' => '<br/><small>'.Mage::helper('textmaster')->__('We will analyze your project to find repetitions.').'</small>',
282
-
283
- ) );
284
-
285
- if (Mage::helper('textmaster')->getNegotiatedContracts()) {
286
- $fieldset->addField('negotiated_contract', 'select', array (
287
- 'label' => Mage::helper('textmaster')->__('Negotiated contracts'),
288
- 'name' => 'negotiated_contract',
289
- 'required' => false,
290
- 'values' => Mage::helper('textmaster')->getNegotiatedContractsFormated(),
291
- ));
292
- }
293
-
294
- $fieldset = $form->addFieldset ( 'project_name', array (
295
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Instructions du projet' )
296
- ));
297
-
298
- $fieldset->addField ( 'name', 'text', array (
299
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Name' ),
300
- 'class' => 'required-entry',
301
- 'required' => true,
302
- 'name' => 'name'
303
- ));
304
-
305
- $html_briefing = '<script>
306
- var briefing_translation = new Array();
307
- var briefing_proofreading = new Array();'."\n";
308
- foreach ($languages as $langue) {
309
- $html_briefing .= 'briefing_translation[\''.$langue['code'].'\'] = \''.addslashes(Mage::getStoreConfig('textmaster/defaultvalue/briefing_message_translation_'.$langue['code'])).'\';'."\n";
310
- $html_briefing .= 'briefing_proofreading[\''.$langue['code'].'\'] = \''.addslashes(Mage::getStoreConfig('textmaster/defaultvalue/briefing_message_proofreading_'.$langue['code'])).'\';'."\n";
311
- }
312
- $html_briefing .= 'store_langue_correspondance = '.json_encode($correspondances).';'."\n";
313
-
314
- $html_briefing .= '</script>';
315
-
316
- $fieldset->addField ( 'project_briefing', 'textarea', array (
317
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Briefing' ),
318
- 'class' => 'required-entry',
319
- 'required' => true,
320
- 'name' => 'project_briefing'
321
- ))->setAfterElementHtml($html_briefing);
322
-
323
- $categories = $_api->getCategories();
324
- $categoriesSelect = array ();
325
- $categoriesSelect [-1] = Mage::helper ( 'textmaster' )->__ ( 'Select a category' );
326
- foreach ( $categories as $categorie ) {
327
-
328
- $categoriesSelect [$categorie ["code"]] = $categorie ["value"];
329
- }
330
-
331
- $fieldset->addField ( 'category', 'select', array (
332
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Category (optional)' ),
333
- 'name' => 'category',
334
- 'values' => $categoriesSelect,
335
- 'disabled' => false,
336
- 'readonly' => false
337
- ) );
338
-
339
- $fieldset->addField ( 'same_author_must_do_entire_project', 'select', array (
340
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Single Author (Assign the entire project to a single TextMaster)' ),
341
- 'name' => 'same_author_must_do_entire_project',
342
- 'required' => true,
343
- 'values' => array(
344
- Mage::helper ( 'textmaster' )->__ ( 'No' ),
345
- Mage::helper ( 'textmaster' )->__ ( 'Yes' )
346
- ),
347
- 'after_element_html' => '<br/><small>'.Mage::helper('textmaster')->__('Ensures better continuity, but longer turnaround time').'</small>',
348
-
349
- ) );
350
-
351
- $this->setChild ( 'form_after',
352
- $this->getLayout ()->createBlock('adminhtml/widget_form_element_dependence')
353
- ->addFieldMap($ctype->getHtmlId(),$ctype->getName())
354
- ->addFieldMap($language_to->getHtmlId(), $language_to->getName())
355
- ->addFieldDependence($language_to->getName(), $ctype->getName(), Textmaster_Textmaster_Model_Project::PROJECT_CTYPE_TRANSLATION )
356
- );
357
-
358
- $this->setFormValues();
359
-
360
-
361
- return parent::_prepareForm ();
362
- }
363
-
364
- public function setFormValues(){
365
-
366
- if($this->getProject()){
367
- $post = $this->getProject()->getData();
368
- $authors = $this->getProject()->getTextmasters();
369
- if(count($authors)) {
370
- $post['ismytextmaster'] = 1;
371
- }
372
- $post['attribute'] = array();
373
- foreach($this->getProject()->getAttributes() as $attribute){
374
- $post['attribute'][] = $attribute->getTextmasterAttributeId();
375
- }
376
- } else {
377
- $post = Mage::getSingleton('core/session')->getProjectInfo();
378
- if(!$post || count($post)==0){
379
- $post['quality'] = 1;
380
- $post['language_level'] = Textmaster_Textmaster_Model_Project::PROJECT_LANGUAGE_LEVEL_PREMIUM;
381
- $post['attribute'] = array();
382
- if($this->_name_attribute_id){
383
- $post['attribute'][] = $this->_name_attribute_id;
384
- }
385
- if($this->_description_attribute_id){
386
- $post['attribute'][] = $this->_description_attribute_id;
387
- }
388
- if($this->_short_description_attribute_id){
389
- $post['attribute'][] = $this->_short_description_attribute_id;
390
- }
391
- $post['ctype'] = Mage::getStoreConfig('textmaster/defaultvalue/default_type');
392
-
393
-
394
- $used_language = Mage::getStoreConfig('textmaster/defaultvalue/default_language');
395
- $stores = Mage::getModel('core/store')->getCollection();
396
- $current_locale = '';
397
- foreach ( $stores as $store ) {
398
- $code = Mage::getStoreConfig('general/locale/code',$store->getId());
399
- $local = explode('_',$code);
400
- if($local[0]==$used_language) {
401
- $post['store_id_origin'] = $store->getId();
402
- $current_locale = $local[0];
403
- }
404
- }
405
- if($post['ctype']!='translation' && $post['ctype']!='proofreading')
406
- $post['ctype']='translation';
407
- $post['project_briefing'] = Mage::getStoreConfig('textmaster/defaultvalue/briefing_message_'.$post['ctype'].'_'.$current_locale);
408
- $post['same_author_must_do_entire_project'] = Mage::getStoreConfig('textmaster/defaultvalue/single_author');
409
- $post['expertise'] = Mage::getStoreConfig('textmaster/defaultvalue/expertise');
410
- //Commerce (C019) par default
411
- $post['category'] = Mage::getStoreConfig('textmaster/defaultvalue/category')?Mage::getStoreConfig('textmaster/defaultvalue/category'):'C019';
412
-
413
- }
414
- }
415
-
416
- //$post['word_count'] = $word_count;
417
- if ($post) {
418
- $this->getForm()->setValues ( $post );
419
- }
420
- }
421
-
422
- public function setProject($project){
423
- $this->_project = $project;
424
- return $this;
425
- }
426
-
427
- public function getProject(){
428
- return $this->_project;
429
- }
430
-
431
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step3.php DELETED
@@ -1,228 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Step3 extends Mage_Adminhtml_Block_Widget_Form
27
- {
28
- private $_project = false;
29
-
30
- protected function _prepareForm() {
31
- $_api = Mage::helper('textmaster')->getApi();
32
-
33
- $form = new Varien_Data_Form (array(
34
- 'id' => 'summary_form',
35
- 'action' => $this->getUrl('*/*/edit', array('step' => 3)),
36
- 'method' => 'post',
37
- 'enctype' => 'multipart/form-data'
38
- ));
39
- if($this->getProject()){
40
- $post = $this->getProject()->getData();
41
- $post['attribute'] = array();
42
- foreach($this->getProject()->getAttributes() as $attribute){
43
- $post['attribute'][] = $attribute->getTextmasterAttributeId();
44
- }
45
- } else {
46
- $post = Mage::getSingleton('core/session')->getProjectInfo();
47
- }
48
-
49
-
50
- $form->setUseContainer(true);
51
- $this->setForm ( $form );
52
-
53
- $word_count = Mage::getSingleton('core/session')->getWordCount();
54
-
55
- $fieldset = $form->addFieldset ( 'project_information', array (
56
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Project Summary' )
57
- ) );
58
-
59
- $fieldset->addField ( 'ctype', 'label', array (
60
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Type of project' ),
61
- //'value'=>'N mot'
62
- ));
63
-
64
- $fieldset->addField ( 'total_word_count', 'label', array (
65
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Total word count' ),
66
- ));
67
-
68
- if (Mage::helper('textmaster')->showProjectDiffWordCount($this->getProject())){
69
- $fieldset->addField ('total_word_count_saved', 'label', array (
70
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Total word count saved' ),
71
- 'value' => $this->getProject()->getDiffWordCount()
72
- ));
73
- }
74
-
75
- $optionsField = $fieldset->addField ( 'options', 'label', array(
76
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Level and options' ),
77
- ));
78
- //$pricing = Mage::getSingleton('core/session')->getPricing();
79
- $fieldset->addField ( 'price', 'label', array (
80
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Total cost' ),
81
- 'value' => '-'
82
- ));
83
- /*$fieldset->addField ( 'modifier', 'button', array (
84
- 'label' => '' ,
85
- 'value'=>Mage::helper ( 'textmaster' )->__ ('Modifier les propiété du projet');
86
- ) );*/
87
- $fieldset->addField ( 'name', 'label', array (
88
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Project\'s name' ),
89
- //'value'=>'N mot'
90
- ));
91
-
92
- /*$fieldset->addField ( 'category', 'label', array (
93
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Category' ),
94
- //'value'=>'N mot'
95
- ));*/
96
- $fieldset->addField ( 'store_id_origin', 'label', array (
97
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Source language' ),
98
- //'value'=>'N mot'
99
- ));
100
- if($post['ctype']=='translation'){
101
- $fieldset->addField ( 'store_id_translation', 'label', array (
102
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Target language' ),
103
-
104
- ));
105
- }
106
-
107
-
108
- $myauthors = $this->getProject()->getMyAuthors();
109
- if($myauthors['count']) {
110
- $mytextmaster = $fieldset->addField ( 'mytextmaster', 'label', array (
111
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Favorite authors' ),
112
- 'value'=>''
113
- ));
114
- }
115
-
116
- $this->setFormValues();
117
-
118
- return parent::_prepareForm ();
119
- }
120
-
121
- public function setFormValues(){
122
- $_api = Mage::helper('textmaster')->getApi();
123
-
124
- $post = $this->getProject()->getData();
125
-
126
- $store_from = Mage::getModel('core/store')->load($post['store_id_origin']);
127
- $store_to = Mage::getModel('core/store')->load($post['store_id_translation']);
128
- $post['ctype'] = ucfirst($post['ctype']);
129
- $post['store_id_origin'] = $store_from->getWebsite()->getName().' - '.$store_from->getName();
130
- $post['store_id_translation'] = $store_to->getWebsite()->getName().' - '.$store_to->getName();
131
- $tarifs = $_api->getPricings();
132
- $currency = Mage::getModel('directory/currency')->load($tarifs['code']);
133
-
134
- $userinfo = $_api->getUserInfo();
135
-
136
- if(isset($userinfo['wallet']['current_money']))
137
- $credit = (float) $userinfo['wallet']['current_money'];
138
- else $credit = 0;
139
-
140
- $project_price = (float) $post['price'];
141
- if($post['total_word_count'])
142
- $price_per_word = $project_price/$post['total_word_count'];
143
- else
144
- $price_per_word = 0;
145
- $post['price'] = $currency->format($post['price'],array(),false);
146
- $html = $post['price'];
147
- $html .='<br/><span>'.Mage::helper('textmaster')->__('Available credits:').' '.$currency->format($credit).'</span>';
148
- if($project_price>$credit) {
149
- $html .='<br/><span style="color:red">'.Mage::helper('textmaster')->__('Crédit manquant :'). $currency->format(($project_price-$credit), array(), false).'</span>';
150
- $html .='<br/><a href="'.$_api->getInterfaceUri().'clients/payment_requests/new?project_id='.$this->getProject()->getProjectApiid().'" target="_blank">'.Mage::helper('textmaster')->__('Add credits to my TextMaster account').'</a>';
151
- }
152
-
153
- $this->getForm()->getElement('price')->setAfterElementHtml($html);
154
-
155
- $post['price'] = '';
156
-
157
- if (Mage::helper('textmaster')->showProjectDiffWordCount($this->getProject())){
158
- $post['total_word_count_saved'] = $this->getProject()->getDiffWordCount();
159
- }
160
-
161
- $html = $this->getProject()->getLanguageLevelTexte($post['language_level']).'<br/>';
162
- if($post['quality']) {
163
- $html .= Mage::helper( 'textmaster' )->__( 'Quality control (+%s/word)' ,$currency->format($tarifs['types']['translation']['quality'],array(),false)).'<br/>';
164
- }
165
- if($post['priority']) {
166
- $html .= Mage::helper( 'textmaster' )->__( 'Priority Order (+%s/word)',$currency->format($tarifs['types']['translation']['priority'],array(),false) ).'<br/>';
167
- }
168
- if($post['expertise']) {
169
- $html .= Mage::helper( 'textmaster' )->__( 'Expertise (+%s/word)',$currency->format($tarifs['types']['translation']['expertise'],array(),false) ).'<br/>';
170
- }
171
- if($post['translation_memory']) {
172
- $html .= Mage::helper( 'textmaster' )->__( 'Translation memory (+%s/word)', $currency->format($tarifs['types']['translation']['translation_memory'],array(),false) ).'<br/>';
173
- }
174
- if(isset($post['negotiated_contract'])) {
175
- $negotiatedContractsPricing = Mage::helper('textmaster')->getNegotiatedContractsPricing();
176
- $negotiatedContractPrice = $negotiatedContractsPricing[$post['negotiated_contract']];
177
- $html .= Mage::helper('textmaster')->__('Negotiated contract (%s/word)', $currency->format($negotiatedContractPrice), array(), false).'<br/>';
178
- // $html .= Mage::helper('textmaster')->__('Negotiated contract').'<br/>';
179
- }
180
- $html .= Mage::helper( 'textmaster' )->__('%s/word',$currency->format($price_per_word,array(),false));
181
-
182
- $this->getForm()->getElement('options')->setAfterElementHtml($html);
183
-
184
-
185
- $post['language_level'] = $this->getProject()->getLanguageLevelTexte($post['language_level']);
186
- $post['vocabulary_type'] = $this->getProject()->getVocabularyTypeTexte($post['vocabulary_type']);
187
- $post['target_reader_groups'] = $_api->getAudience($post['target_reader_groups']);
188
- $post['grammatical_person'] = $_api->getGrammaticalPerson($post['grammatical_person']);
189
-
190
- $post['specific_attachment'] = $post['specific_attachment']?Mage::helper( 'textmaster' )->__( 'Oui' ):Mage::helper( 'textmaster' )->__( 'Non' );
191
- $post['priority'] = $post['priority']?Mage::helper( 'textmaster' )->__( 'Oui' ):Mage::helper( 'textmaster' )->__( 'Non' );
192
- $post['quality'] = $post['quality']?Mage::helper( 'textmaster' )->__( 'Oui' ):Mage::helper( 'textmaster' )->__( 'Non' );
193
- $post['expertise'] = $post['expertise']?Mage::helper( 'textmaster' )->__( 'Oui' ):Mage::helper( 'textmaster' )->__( 'Non' );
194
-
195
-
196
- $html = ''.Mage::helper( 'textmaster' )->__( 'Textmaster(s) chosen:' ).' ';
197
- $textmasters = $this->getProject()->getTextmasters();
198
- $authors = $_api->getAuthors();
199
- if(is_array($textmasters) && count($textmasters)>0)
200
- foreach($textmasters as $t){
201
-
202
- foreach ($authors['my_authors'] as $author){
203
- if($author['author_id']==$t)
204
- $html .= '<br/>'.$author['description']. ' ( ' . $author['author_ref'] . ' )';
205
- }
206
-
207
- }
208
- else
209
- $html .= Mage::helper( 'textmaster' )->__( 'none' );
210
-
211
- $html .= '<br/><a style="cursor:pointer" id="mytextmasterchoice" onclick="showAuthors(\''.$this->getUrl('*/*/getmyauthors',array('id'=>$this->getProject()->getId())).'\',\''.Mage::helper( 'textmaster' )->__( 'My Textmasters' ).'\')">'.Mage::helper( 'textmaster' )->__( 'Choose your TextMasters' ).'</a>';
212
- if($this->getForm()->getElement('mytextmaster'))
213
- $this->getForm()->getElement('mytextmaster')->setAfterElementHtml($html);
214
-
215
- if ($post) {
216
- $this->getForm()->setValues ( $post );
217
- }
218
- }
219
-
220
- public function setProject($project){
221
- $this->_project = $project;
222
- return $this;
223
- }
224
-
225
- public function getProject(){
226
- return $this->_project;
227
- }
228
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step3/Author.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Step3_Author extends Mage_Adminhtml_Block_Widget_Form_Container{
27
-
28
- public function __construct() {
29
- parent::__construct ();
30
- $this->_objectId = 'textmaster_project_id';
31
- $this->_controller = 'adminhtml_project';
32
- $this->_blockGroup = 'textmaster';
33
-
34
- //$this->_removeButton ( 'save' );
35
- $this->_removeButton ( 'delete' );
36
- $this->_removeButton ( 'back' );
37
- //$this->_removeButton ( 'saveandcontinue' );
38
- $this->_removeButton ( 'reset' );
39
- //$this->updateButton('save','onclick', 'valideAuthor();')
40
-
41
- }
42
- public function getHeaderHtml(){
43
- return '<h3>'.Mage::helper('textmaster')->__('Choose your textmaster for the project').'</h3>';
44
- }
45
-
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Step3/Form/Author.php DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Step3_Form_Author extends Mage_Adminhtml_Block_Widget_Form{
27
-
28
- /*protected function _prepareLayout()
29
- {
30
-
31
- return parent::_prepareLayout();
32
- }*/
33
- private $_project = false;
34
-
35
- protected function _prepareForm() {
36
- $_api = Mage::helper('textmaster')->getApi();
37
-
38
- $form = new Varien_Data_Form (array(
39
- 'id' => 'edit_form',
40
- 'action' => $this->getUrl('*/*/getmyauthors', array('id' => $this->getProject()->getId())),
41
- 'method' => 'post',
42
- 'enctype' => 'multipart/form-data'
43
- ));
44
-
45
- $form->setUseContainer(true);
46
- $this->setForm ( $form );
47
-
48
- $fieldset = $form->addFieldset ( 'project_information', array (
49
- 'legend' => ''
50
- ) );
51
- $myauthors = $this->getProject()->getMyAuthors();
52
- $used_myauthors = explode(',',Mage::getStoreConfig('textmaster/defaultvalue/default_language'));
53
-
54
-
55
- $myauthorsSelect = array ();
56
- if($this->getProject()->getSameAuthorMustDoEntireProject()) {
57
- $myauthorsSelect[]= array(
58
- 'value' => 'aucun',
59
- 'label' => 'Aucun'
60
- );
61
- }
62
- if(isset($myauthors['my_authors'])) {
63
- foreach ($myauthors['my_authors'] as $myauthor) {
64
- $myauthorsSelect [] = array(
65
- 'value' => $myauthor ["author_id"],
66
- 'label' => $myauthor ["description"] . ' ( ' . $myauthor ["author_ref"] . ' )'
67
- );
68
- }
69
- }
70
- if(count($myauthorsSelect)) {
71
- if(!$this->getProject()->getSameAuthorMustDoEntireProject()) {
72
- $input = $fieldset->addField ( 'textmasters', 'checkboxes', array (
73
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'My Textmasters' ),
74
- 'name' => 'textmasters[]',
75
- 'values' => $myauthorsSelect
76
- ) );
77
- } else {
78
-
79
- $input = $fieldset->addField ( 'textmasters', 'radios', array (
80
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'My Textmasters' ),
81
- 'name' => 'textmasters',
82
- 'values' => $myauthorsSelect,
83
- ) );
84
- $input->setSeparator('<br/>');
85
-
86
- }
87
- } else {
88
- $fieldset->addField ( 'textmasters', 'label', array (
89
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'You do not have any authors in your Favorites list' ),
90
- ));
91
- }
92
-
93
- $this->setFormValues();
94
- $post = $this->getRequest()->getPost();
95
- if(count($post)){
96
- $input->setAfterElementHtml('
97
- <script>
98
- window.top.location.href = window.top.location.href;
99
- </script>');
100
- }
101
-
102
-
103
- return parent::_prepareForm();
104
- }
105
- public function setFormValues(){
106
- $post = $this->getRequest()->getPost();
107
- if(count($post)){
108
- $this->getForm()->setValues ( $post );
109
- return;
110
- }
111
- $_api = Mage::helper('textmaster')->getApi();
112
- $post['textmasters'] = $this->getProject()->getTextmasters();
113
- if($this->getProject()->getSameAuthorMustDoEntireProject()) {
114
- if(!(empty($post['textmasters']) || count($post['textmasters'])==0)) {
115
- $textmasters=$post['textmasters'][0];
116
- $post['textmasters']=$textmasters;
117
- }
118
- }
119
-
120
- if(empty($post['textmasters']) || count($post['textmasters'])==0){
121
- $used_myauthors = explode(',',Mage::getStoreConfig('textmaster/defaultvalue/author'));
122
- $myauthors = $this->getProject()->getMyAuthors();
123
- $post['textmasters'] = array();
124
- foreach($used_myauthors as $author) {
125
- foreach($myauthors['my_authors'] as $author_av) {
126
- if($author==$author_av['author_id']) $post['textmasters'][]=$author_av['author_id'];
127
- }
128
- }
129
- }
130
- if ($post) {
131
- $this->getForm()->setValues ( $post );
132
- }
133
- }
134
-
135
-
136
- public function setProject($project){
137
- $this->_project = $project;
138
- return $this;
139
- }
140
-
141
- public function getProject(){
142
- return $this->_project;
143
- }
144
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Onglets/Summary.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Onglets_Summary extends Mage_Adminhtml_Block_Widget_Form
27
- {
28
- protected function _prepareForm()
29
- {
30
- $_api = Mage::helper('textmaster')->getApi();
31
- $form = new Varien_Data_Form(
32
- array(
33
- 'id' => 'edit_form',
34
- 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
35
- 'method' => 'post',
36
- )
37
- );
38
- $fieldset = $form->addFieldset ( 'project_pricing', array (
39
- 'legend' => Mage::helper ( 'textmaster' )->__ ( 'Order Summary' )
40
- ) );
41
- $projetField = $fieldset->addField ( 'projet', 'label', array(
42
- 'label' => Mage::helper ( 'textmaster' )->__ ('Project'),
43
- ));
44
- $nbmotField = $fieldset->addField ( 'nbmot', 'label', array(
45
- 'label' => Mage::helper ( 'textmaster' )->__ ('Word count'),
46
- ));
47
- $optionsField = $fieldset->addField ( 'options', 'label', array(
48
- 'label' => Mage::helper ( 'textmaster' )->__ ('Level and options'),
49
- ));
50
-
51
- $pricingField = $fieldset->addField ( 'pricing', 'label', array(
52
- 'label' => Mage::helper ( 'textmaster' )->__ ('Price'),
53
- ));
54
-
55
- $pricing = $_api->getPricings();
56
- $negotiatedContractPricing = Mage::helper('textmaster')->getNegotiatedContractsPricing();
57
- $pricing = Mage::helper('core')->jsonEncode($pricing);
58
- $negotiatedContractPrices = Mage::helper('core')->jsonEncode($negotiatedContractPricing);
59
- $projetField->setAfterElementHtml('<span id="textmaster_projet"></span>');
60
- $optionsField->setAfterElementHtml('<span id="textmaster_options"></span>');
61
- $nbmotField->setAfterElementHtml('<span id="textmaster_nbmot"></span>');
62
- $pricingField->setAfterElementHtml('
63
- <span id="textmaster_total_price"></span>
64
- <script>
65
- var textmaster_pricing = '.$pricing.';
66
- var textmaster_negotiated_contract_prices = '.$negotiatedContractPrices.';
67
- var textmaster_edit_form_url = \''.$this->getUrl('*/*/edit', array('step' => 2)).'\';
68
- </script>');
69
- $form->setUseContainer(true);
70
- $this->setForm($form);
71
- return parent::_prepareForm();
72
- }
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Nbdocument.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Nbdocument extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getNbDocument();
31
- if($row->getStatus()==Textmaster_Textmaster_Model_Project::PROJECT_STATUS_IN_CREATION) return 'N/A';
32
- return ''.$value.'';
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Price.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Price extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getPrice();
31
- if($row->getStatus()==Textmaster_Textmaster_Model_Project::PROJECT_STATUS_IN_CREATION) return 'N/A';
32
- return ''.$value.'';
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Progression.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Progression extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getProgression();
31
- return ''.$value.'';
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Status.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Status extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getStatusTexte();
31
- return ''.Mage::helper('textmaster')->__($value).'';
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Store.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Store extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $stores_to = explode(';',$row->getData('store_name_to'));
31
-
32
- $value = '';
33
- $storeToIds = array();
34
- if(is_array($stores_to)){
35
- foreach ($stores_to as $k =>$storeToId){
36
- if($storeToId!='' && !in_array($storeToId,$storeToIds)){
37
- $icoTo = substr(Mage::getStoreConfig('general/locale/code',$storeToId),0,2);
38
- $tmphtml2 = '<img height="10" src="'.$this->getSkinUrl('images/textmaster/'.$icoTo.'.png').'" alt="'.$icoTo.'"/>';
39
- $value .= $tmphtml2.' - ';
40
- $storeToIds[]=$storeToId;
41
- }
42
- }
43
- }
44
- if(strlen($value)>3){
45
- $value = substr($value,0,-3);
46
- }
47
-
48
-
49
- return ''.$value.'';
50
- return $result;
51
- }
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/Renderer/Wordcount.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_Renderer_Wordcount extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getTotalWordCount();
31
- if($row->getStatus()==Textmaster_Textmaster_Model_Project::PROJECT_STATUS_IN_CREATION) return 'N/A';
32
- return ''.$value.'';
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View.php DELETED
@@ -1,96 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_View extends Mage_Adminhtml_Block_Widget_Container {
27
-
28
- private $_project;
29
-
30
- public function __construct()
31
- {
32
- parent::__construct();
33
- $this->_objectId = 'textmaster_project_view';
34
- $this->_controller = 'adminhtml_project';
35
- $this->_blockGroup = 'textmaster';
36
-
37
-
38
- }
39
- public function prepareButton()
40
- {
41
- $this->removeButton('edit');
42
- if($this->getProject()->canLaunch()){
43
- $this->_addButton ( 'launch', array (
44
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Launch' ),
45
- 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/view/',array('id'=>$this->getProject()->getId(),'a'=>'launch')).'\'' ,
46
- 'class' => 'save'
47
- ), - 100 );
48
- }
49
- if($this->getProject()->canPause()){
50
- $this->_addButton ( 'pause', array (
51
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Pause' ),
52
- 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/view/',array('id'=>$this->getProject()->getId(),'a'=>'pause')).'\'' ,
53
- 'class' => ''
54
- ), - 100 );
55
- }
56
- if($this->getProject()->canResume()){
57
- $this->_addButton ( 'resume', array (
58
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Resume' ),
59
- 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/view/',array('id'=>$this->getProject()->getId(),'a'=>'resume')).'\'' ,
60
- 'class' => ''
61
- ), - 100 );
62
- }
63
- if($this->getProject()->canComplete()){
64
- $this->_addButton ( 'complete', array (
65
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Complete' ),
66
- 'onclick' => 'completeDocuments(\'' . $this->getUrl('*/*/view/',array('id'=>$this->getProject()->getId(),'a'=>'complete')).'\',0)' ,
67
- 'class' => ''
68
- ), - 100 );
69
- }
70
- if($this->getProject()->canCancel()){
71
- $this->_addButton ( 'cancel', array (
72
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Cancel' ),
73
- 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/view/',array('id'=>$this->getProject()->getId(),'a'=>'cancel')).'\'' ,
74
- 'class' => 'delete'
75
- ), - 100 );
76
- }
77
- if($this->getProject()->canTransfert()){
78
- $this->_addButton ( 'translate', array (
79
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Update product' ),
80
- 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/view/',array('id'=>$this->getProject()->getId(),'a'=>'translate')).'\'' ,
81
- 'class' => 'delete'
82
- ), - 100 );
83
- }
84
-
85
-
86
- return $this;
87
- }
88
-
89
- public function setProject($project){
90
- $this->_project = $project;
91
- }
92
-
93
- public function getProject(){
94
- return $this->_project;
95
- }
96
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View/Documents.php DELETED
@@ -1,223 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_View_Documents extends Mage_Adminhtml_Block_Widget_Grid
27
- {
28
- private $_is_regex_op = array(
29
- 'title',
30
- 'ref'
31
- );
32
- public function __construct()
33
- {
34
- parent::__construct();
35
- $this->setDefaultSort('textmaster_document_id');
36
- $this->setDefaultDir('DESC');
37
- $this->setDefaultLimit(20);
38
- $this->setSaveParametersInSession(true);
39
-
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 _prepareCollection()
49
- {
50
- $collection = Mage::getModel('textmaster/document')->getCollection()
51
- ->setLoadApi(true)
52
- ->setProjectApiId($this->getProject()->getProjectApiid())
53
- ->addFieldToFilter('textmaster_project_id',$this->getProject()->getId());
54
- $this->setCollection($collection);
55
- return parent::_prepareCollection();
56
- }
57
-
58
- protected function _prepareColumns()
59
- {
60
- $this->addColumn('textmaster_document_id',
61
- array(
62
- 'header'=> Mage::helper('textmaster')->__('Reference'),
63
- 'width' => '200px',
64
- //'type' => 'number',
65
- 'index' => 'reference',
66
- 'filter_condition_callback' => array($this, '_apiFilter'),
67
- ));
68
-
69
-
70
- $this->addColumn('name',
71
- array(
72
- 'header'=> Mage::helper('textmaster')->__('Name'),
73
- 'index' => 'name',
74
- 'filter_condition_callback' => array($this, '_apiFilter'),
75
- ));
76
-
77
- /*$this->addColumn('type',
78
- array(
79
- 'header'=> Mage::helper('textmaster')->__('Type'),
80
- 'width' => '60px',
81
- 'index' => 'type',
82
- //'type' => 'options',
83
- //'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
84
- ));*/
85
-
86
- $this->addColumn('status',
87
- array(
88
- 'header'=> Mage::helper('textmaster')->__('Status'),
89
- 'width' => '70px',
90
- 'index' => 'status',
91
- //'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Document_Renderer_Status',
92
- 'type' => 'options',
93
- 'options' => Mage::getSingleton('textmaster/project')->getStatuses(),
94
- 'filter_condition_callback' => array($this, '_apiFilter'),
95
- //'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
96
- ));
97
- $this->addColumn('action',
98
- array(
99
- 'header' => Mage::helper('textmaster')->__('Action'),
100
- 'width' => '50',
101
- 'type' => 'action',
102
- 'getter' => 'getId',
103
- 'actions' => array(
104
- array(
105
- 'caption' => Mage::helper('textmaster')->__('View'),
106
- 'url' => array('base'=> '*/*/document'),
107
- 'field' => 'id'
108
- )
109
- ),
110
- 'filter' => false,
111
- 'sortable' => false,
112
- 'index' => 'stores',
113
- 'is_system' => true,
114
- 'align' => 'right',
115
- ));
116
- return parent::_prepareColumns();
117
- }
118
-
119
- protected function _prepareMassaction()
120
- {
121
- $this->setMassactionIdField('textmaster_document_id');
122
- $this->getMassactionBlock()->setFormFieldName('document_id');
123
-
124
-
125
- //if($this->getProject()->getStatus()== Textmaster_Textmaster_Model_Project::PROJECT_STATUS_IN_REVIEW) {
126
- $this->getMassactionBlock()->addItem('complete', array(
127
- 'label'=> Mage::helper('textmaster')->__('Complete file'),
128
- 'url'=> $this->getUrl('*/*/masscompletedoc',array('id'=>$this->getProject()->getId())),
129
- 'complete'=>'
130
- completeDocuments
131
- '
132
- ));
133
- $this->getMassactionBlock()->setUseSelectAll(false);
134
- //}
135
-
136
- return $this;
137
- }
138
-
139
- public function getRowUrl($row)
140
- {
141
- return $this->getUrl('*/*/document', array('id' => $row->getId()));
142
- return false;
143
- }
144
- public function getProject()
145
- {
146
- // return $this->getUrl('aoadmin/catalog_product/edit', array('id' => $row->getId()));
147
- return $this->_project;
148
- }
149
- public function setProject($project)
150
- {
151
- // return $this->getUrl('aoadmin/catalog_product/edit', array('id' => $row->getId()));
152
- $this->_project = $project;
153
- return $this;
154
- }
155
- public function setProjectApiId($id)
156
- {
157
- // return $this->getUrl('aoadmin/catalog_product/edit', array('id' => $row->getId()));
158
- $this->_project_api_id = $id;
159
- return $this;
160
- }
161
-
162
-
163
-
164
- public function _apiFilter($collection, $column) {
165
- if (!$value = $column->getFilter()->getValue()) {
166
- return $this;
167
- }
168
- $index = $column->getIndex();
169
-
170
- $subsitute = $this->getCollection()->getSubstitute();
171
- if(isset($subsitute[$index])) $index = $subsitute[$index];
172
- else return $this;
173
- $filters = array();
174
- if($column->getType()=='number' ){
175
- if(isset($value['from']))
176
- $filters[$index]['$gte'] = $value['from'];
177
- if(isset($value['to']))
178
- $filters[$index]['$lte'] = $value['to'];
179
- } elseif($column->getType()=='datetime' ){
180
- //
181
- if(isset($value['from']))
182
- $filters[$index]['$gte'] = date('Y-m-d',$value['from']->getTimestamp());
183
- if(isset($value['to']))
184
- $filters[$index]['$lte'] = date('Y-m-d',$value['to']->getTimestamp());
185
- } elseif(in_array($index,$this->_is_regex_op)) {
186
- $filters[$index]['$regex'] = '/'.$value.'/i';
187
- } else {
188
- $filters[$index] = $value;
189
- }
190
- $this->getCollection()->addFiltersApi($filters);
191
- return $this;
192
- }
193
-
194
- protected function _prepareMassactionColumn()
195
- {
196
- $columnId = 'massaction';
197
- $massactionColumn = $this->getLayout()->createBlock('adminhtml/widget_grid_column')
198
- ->setData(array(
199
- 'index' => $this->getMassactionIdField(),
200
- 'filter_index' => $this->getMassactionIdFilter(),
201
- 'type' => 'massaction',
202
- 'name' => $this->getMassactionBlock()->getFormFieldName(),
203
- 'align' => 'center',
204
- 'is_system' => true,
205
- 'filter' => false,
206
- 'renderer' => 'Textmaster_Textmaster_Block_Adminhtml_Project_View_Grid_Column_Renderer_Massaction'
207
- ));
208
-
209
- if ($this->getNoFilterMassactionColumn()) {
210
- $massactionColumn->setData('filter', false);
211
- }
212
-
213
- $massactionColumn->setSelected($this->getMassactionBlock()->getSelected())
214
- ->setGrid($this)
215
- ->setId($columnId);
216
-
217
- $oldColumns = $this->_columns;
218
- $this->_columns = array();
219
- $this->_columns[$columnId] = $massactionColumn;
220
- $this->_columns = array_merge($this->_columns, $oldColumns);
221
- return $this;
222
- }
223
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View/Grid/Column/Renderer/Checkbox.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_View_Grid_Column_Renderer_Checkbox extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox {
27
-
28
- protected function _getCheckboxHtml($value, $checked)
29
- {
30
-
31
- $html = '<input type="checkbox" ';
32
- $html .= 'name="' . $this->getColumn()->getFieldName() . '" ';
33
- $html .= 'value="' . $this->escapeHtml($value) . '" ';
34
- $html .= 'class="'. ($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox') .'"';
35
- $html .= $checked . $this->getDisabled() . '/>';
36
-
37
- return $html;
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Project/View/Grid/Column/Renderer/Massaction.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Project_View_Grid_Column_Renderer_Massaction extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox {
27
-
28
- protected function _getCheckboxHtml($value, $checked)
29
- {
30
- $collection = $this->getColumn()->getGrid()->getCollection();
31
- foreach($collection as $document){
32
- if($document->getId()==$value){
33
- if($document->getStatus()!='in_review'){
34
- return '';
35
- }
36
- }
37
- }
38
- $html = '<input type="checkbox" name="' . $this->getColumn()->getName() . '" ';
39
- $html .= 'value="' . $this->escapeHtml($value) . '" class="massaction-checkbox"' . $checked . '/>';
40
- return $html;
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Renderer/Sourcelanguage.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Renderer_Sourcelanguage extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
-
29
- public function render (Varien_Object $row)
30
- {
31
- $store_id = $row->getData('store_id_origin');
32
- $store = Mage::getModel('core/store')->load($store_id);
33
- $value = '';
34
- if ($store->getId()) {
35
- $value = $store->getWebsite()->getName() . ' - ' . $store->getName();
36
- }
37
- return $value;
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Renderer/Targetlanguage.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Renderer_Targetlanguage extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
-
29
- public function render (Varien_Object $row)
30
- {
31
- $store_id = $row->getData('store_id_translation');
32
- $store = Mage::getModel('core/store')->load($store_id);
33
- $value = '';
34
- if ($store->getId()) {
35
- $value = $store->getWebsite()->getName() . ' - ' . $store->getName();
36
- }
37
- return $value;
38
-
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/Renderer/UpdatedAt.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_Renderer_UpdatedAt extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
- {
28
- public function render(Varien_Object $row)
29
- {
30
- $value = $row->getUpdatedAt();
31
- $timestamp = strtotime($value);
32
- $formattedDate = Mage::helper('core')->formatDate($value);
33
- return ''.$formattedDate.'';
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Briefing.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_System_Config_Form_Field_Briefing extends Mage_Adminhtml_Block_System_Config_Form_Field
27
- {
28
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
29
-
30
- $_api = Mage::helper('textmaster')->getApi();
31
- $languages = $_api->getLanguages();
32
-
33
- $original_name = $element->getName();
34
-
35
- if(strpos($element->getHtmlId(),'translation')!==false){
36
- $element_id = 'briefing_message_translation';
37
- } else{
38
- $element_id = 'briefing_message_proofreading';
39
- }
40
-
41
- $html = '';
42
- foreach ($languages as $langue){
43
- $name = str_replace($element_id,$element_id.'_'.$langue['code'],$original_name);
44
- $value = Mage::getStoreConfig('textmaster/defaultvalue/'.$element_id.'_'.$langue['code']);
45
- $html .= '<div><textarea name="'.$name.'" id="'.$element_id.'_'.$langue['code'].'" data-label="'.$langue['value'].'" style="display:none;">'.$value.'</textarea></div>';
46
- }
47
-
48
- $html .= "<script>
49
- var textmaster_breifing_element_id = '".$element_id."';
50
- </script>";
51
-
52
-
53
-
54
- return $html;
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Creation.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_System_Config_Form_Field_Creation extends Mage_Adminhtml_Block_System_Config_Form_Field
27
- {
28
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
29
-
30
- $_api = Mage::helper('textmaster')->getApi();
31
-
32
- $_isLog = $_api->getAPIConnection();
33
-
34
- $html = '<input type="text" placeholder="'.Mage::helper('textmaster')->__('Email').'" name="email" id="email" class=" input-text" /><span style="margin-left:10px;"></span><br/>';
35
- $html .= '<input type="password" placeholder="'.Mage::helper('textmaster')->__('Password').'" name="create_password" id="create_password" class=" input-text" /><span style="margin-left:10px;"></span><br/>';
36
- $html .= '<input type="password" placeholder="'.Mage::helper('textmaster')->__('Confirm password').'" name="create_password2" id="create_password2" class=" input-text" /><span style="margin-left:10px;"></span><br/>';
37
- $html .= '<input type="text" placeholder="'.Mage::helper('textmaster')->__('Phone').'" name="tel" id="tel" class="input-text" /><span style="margin-left:10px;"></span><br/>';
38
- $html .= '<button type="button" style="margin-top:5px;" class="scalable generate_key" onclick="createAjaxAction()"><span>'.Mage::helper('textmaster')->__('Create your free account').'</span></button><br/>';
39
- $html .= '<div id="result2_ajax" style="margin-top:7px;"></div>';
40
- $html .= "<script>
41
- function createAjaxAction(){
42
-
43
- var reloadurl = '". $this->getUrl('adminhtml/textmaster_ajax/create/')."';
44
- new Ajax.Request(reloadurl, {
45
- method: 'post',
46
- parameters: {
47
- login : \$F('email'),
48
- password: \$F('create_password'),
49
- tel : \$F('tel'),
50
- },
51
- requestHeaders: {Accept: 'application/json'},
52
-
53
- onLoading: function (transport) {
54
- $('result2_ajax').update('".Mage::helper('textmaster')->__('Searching...')."');
55
- },
56
- onComplete: function(transport) {
57
-
58
- data = transport.responseText.evalJSON();
59
- if(data.errors){
60
- $('result2_ajax').update(data.errors);
61
- } else {
62
- $('result2_ajax').update(data.html);
63
- window.location = '".$this->getUrl('adminhtml/textmaster_project/index/')."';
64
- }
65
- }
66
- });
67
- }
68
- </script>";
69
- if($_isLog) {
70
- //$html .= '<input type="hidden" class="is_textmasterlog" value="1">';
71
- } else {
72
- $html .= '<input type="hidden" class="is_textmasterlog" value="0">';
73
- }
74
- return $html;
75
- }
76
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Islog.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_System_Config_Form_Field_Islog extends Mage_Adminhtml_Block_System_Config_Form_Field
27
- {
28
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
29
-
30
- $_api = Mage::helper('textmaster')->getApi();
31
-
32
- $_isLog = $_api->getAPIConnection();
33
-
34
- if($_isLog) {
35
- $html = '<input type="hidden" id="textmaster_textmaster_istextmasterlog" name="istextmasterlog" value="1">';
36
- $html .= "<script>
37
- var textmaster_is_log = true;
38
-
39
- </script>";
40
- } else {
41
- $html = '<input type="hidden" id="textmaster_textmaster_istextmasterlog" name="istextmasterlog" value="0">';
42
- $html .= "<script>
43
- var textmaster_is_log = false;
44
- </script>";
45
- }
46
-
47
-
48
- return $html;
49
- }
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Block/Adminhtml/System/Config/Form/Field/Login.php DELETED
@@ -1,98 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Block_Adminhtml_System_Config_Form_Field_Login extends Mage_Adminhtml_Block_System_Config_Form_Field
27
- {
28
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
29
-
30
- $_api = Mage::helper('textmaster')->getApi();
31
-
32
- $_isLog = $_api->getAPIConnection();
33
-
34
- if(!$_isLog){
35
-
36
- $html = '<input type="text" placeholder="'.Mage::helper('textmaster')->__('Login').'" name="login" id="textmaster_textmaster_login" class="login input-text" /><span style="margin-left:10px;"></span>';
37
- $html .= '<input type="password" placeholder="'.Mage::helper('textmaster')->__('Password').'" name="password" id="textmaster_textmaster_password" class="login input-text" /><span style="margin-left:10px;"></span>';
38
- $html .= '<button type="button" style="margin-top:5px;" class="scalable generate_key" onclick="loginAjaxAction()"><span>'.Mage::helper('textmaster')->__('Connexion').'</span></button>';
39
- $html .= '<div id="result_ajax" style="margin-top:7px;"></div>';
40
- $html .= "<script>
41
- function loginAjaxAction(){
42
-
43
- var reloadurl = '". $this->getUrl('adminhtml/textmaster_ajax/login/')."';
44
- new Ajax.Request(reloadurl, {
45
- method: 'post',
46
- parameters: {
47
- login : \$F('textmaster_textmaster_login'),
48
- password: \$F('textmaster_textmaster_password'),
49
- },
50
- requestHeaders: {Accept: 'application/json'},
51
-
52
- onLoading: function (transport) {
53
- $('result_ajax').update('".Mage::helper('textmaster')->__('Searching...')."');
54
-
55
- },
56
- onComplete: function(transport) {
57
-
58
- data = transport.responseText.evalJSON();
59
- if(data.errors){
60
- $('result_ajax').update(data.errors);
61
- } else {
62
- $('result_ajax').update(data.html);
63
- window.location = '".$this->getUrl('adminhtml/textmaster_project/index/')."';
64
- }
65
- }
66
- });
67
- }
68
- </script>";
69
- }
70
- if($_isLog) {
71
- $html = '<input type="hidden" class="is_textmasterlog" value="1">';
72
- $html .= '<button type="button" style="margin-top:5px;" class="scalable generate_key" onclick="logoutAjaxAction()"><span>'.Mage::helper('textmaster')->__('Logout').'</span></button>';
73
- $html .= "<script>
74
- function logoutAjaxAction(){
75
-
76
- var reloadurl = '". $this->getUrl('adminhtml/textmaster_ajax/logout/')."';
77
- new Ajax.Request(reloadurl, {
78
- method: 'post',
79
- requestHeaders: {Accept: 'application/json'},
80
-
81
- onLoading: function (transport) {
82
- $('result_ajax').update('".Mage::helper('textmaster')->__('Searching...')."');
83
-
84
- },
85
- onComplete: function(transport) {
86
-
87
- window.location = window.location;
88
- }
89
- });
90
- }
91
- </script>";
92
-
93
- } else {
94
- $html .= '<input type="hidden" class="is_textmasterlog" value="0">';
95
- }
96
- return $html;
97
- }
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Helper/Data.php DELETED
@@ -1,210 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Helper_Data extends Mage_Core_Helper_Abstract
27
- {
28
-
29
- private $_mot_exclus = array();
30
-
31
- private $_progression_score = array(
32
- 'in_creation' => 0,
33
- 'waiting_assignment' => 0.1,
34
- 'in_progress' => 0.3,
35
- 'in_review' => 0.7,
36
- 'incomplete' => 0.,
37
- 'completed' => 1,
38
- 'paused' => 0.1,
39
- 'quality_control' => 0.5,
40
- 'copyscape' => 0.6,
41
- 'counting_words' => 0
42
- );
43
-
44
- private $_api = false;
45
-
46
- #project_tm_completed callback lancer launch project
47
-
48
- public function countWord ($txt)
49
- {
50
- $string = strip_tags($txt);
51
- $string = str_replace("&#039;", "'", $string);
52
- $t = array(' ', "\t", '=', '+', '-', '*', '/', '\\', ',', '.', ';', ':', '[', ']', '{', '}', '(', ')', '<', '>', '&', '%', '$', '@', '#', '^', '!', '?', '~'); // separators
53
- $string = str_replace($t, " ", $string);
54
- $string = trim(preg_replace("/\s+/", " ", $string));
55
- $num = 0;
56
- if (mb_strlen($string, "UTF-8") > 0) {
57
- $word_array = explode(" ", $string);
58
- $num = count($word_array);
59
- }
60
- return $num;
61
- }
62
-
63
- public function arrayToStringForApi ($arr)
64
- {
65
- if (! is_array($arr))
66
- return $arr;
67
- $r = '';
68
- foreach ($arr as $k1 => $niv1) {
69
- if (! is_array($niv1))
70
- return '';
71
- foreach ($niv1 as $k2 => $niv2) {
72
- if (is_array($niv2)) {
73
- foreach ($niv2 as $k3 => $niv3) {
74
- $r .= ($k1 == 0 ? '' : '&') .
75
- urlencode($k1 . '[' . $k2 . ']' . '[' . $k3 .
76
- ']') . '=' . urlencode($niv3);
77
- }
78
- } else {
79
- $r .= urlencode(($k1 == 0 ? '' : '&') . $k1 . '[' . $k2 .
80
- ']') . '=' . urlencode($niv2);
81
- }
82
- }
83
- }
84
- return $r;
85
- }
86
- public function arrayToStringForApi2 ($arr)
87
- {
88
- if (! is_array($arr))
89
- return $arr;
90
- $r = '';
91
- foreach ($arr as $k1 => $niv1) {
92
- if (! is_array($niv1))
93
- return '';
94
- foreach ($niv1 as $k2 => $niv2) {
95
- if (is_array($niv2)) {
96
- foreach ($niv2 as $k3 => $niv3) {
97
- $r .= ($k1 == 0 ? '' : '&') .
98
- ($k1 . '[' . $k2 . ']' . '[' . $k3 .
99
- ']') . '=' . ($niv3);
100
- }
101
- } else {
102
- $r .= (($k1 == 0 ? '' : '&') . $k1 . '[' . $k2 .
103
- ']') . '=' . ($niv2);
104
- }
105
- }
106
- }
107
- return $r;
108
- }
109
-
110
- public function getCallbackUrl ()
111
- {
112
- // http://aomagento.addonline.devl/textmaster/callback/documentcount/
113
- return Mage::getUrl('textmaster/callback/documentcount');
114
- }
115
-
116
- public function getCallbackCompletedUrl ()
117
- {
118
- return Mage::getUrl('textmaster/callback/documentcomplete');
119
- }
120
-
121
- public function getCallbackUrlTmComplete()
122
- {
123
- return Mage::getUrl('textmaster/callback/projecttmcomplete');
124
- }
125
-
126
- public function getCallbackUrlInProgress ()
127
- {
128
- return Mage::getUrl('textmaster/callback/inprogress');
129
- }
130
-
131
- public function getProgression ($documents_statuses)
132
- {
133
- $nb_docs = 0;
134
- $progression = 0;
135
-
136
- foreach ($documents_statuses as $status => $doc) {
137
- $nb_docs += (int) $doc;
138
- if (isset($this->_progression_score[$status]) && (int) $doc)
139
- $progression += ((int) $doc) * $this->_progression_score[$status];
140
- }
141
-
142
- if ($nb_docs > 0)
143
- $progression = $progression / $nb_docs;
144
- return round($progression * 100, 2);
145
-
146
- }
147
-
148
- public function getApi ()
149
- {
150
- if ($this->_api === false) {
151
- $this->_api = Mage::getSingleton('textmaster/api');
152
- }
153
- return $this->_api;
154
- }
155
-
156
- /**
157
- * Return formated language code like : fr-fr or en-us
158
- * @param $storeId Integer
159
- * @return string
160
- */
161
- public function getFormatedLangCode($storeId)
162
- {
163
- return strtolower(str_replace('_', '-', Mage::getStoreConfig('general/locale/code',$storeId)));
164
- }
165
-
166
- /**
167
- * Return true if translation memory is enable and with have 5% diff word count
168
- * @param $project
169
- * @return boolean
170
- */
171
- public function showProjectDiffWordCount($project){
172
- $totalWordCount = $project->getTotalWordCount();
173
- if(!$project->getTranslationMemory() or $totalWordCount == 0)
174
- return false;
175
- $diffWordCount = $project->getDiffWordCount();
176
- if((($diffWordCount*100)/$totalWordCount) >= 5)
177
- return true;
178
- return false;
179
- }
180
-
181
- public function getNegotiatedContracts(){
182
- $negotiatedContracts = Mage::getModel('textmaster/api')->getNegotiatedContracts();
183
- $negotiatedContracts = $negotiatedContracts['negotiated_contracts'];
184
- return $negotiatedContracts;
185
- }
186
-
187
- public function getNegotiatedContractsFormated(){
188
- $negotiatedContracts = $this->getNegotiatedContracts();
189
- $negotiatedContractsField = array('' => $this->__('No contract selected'));
190
- $currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
191
- $currencySymbol = Mage::app()->getLocale()->currency($currencyCode)->getSymbol();
192
- $symbol = '';
193
- foreach ($negotiatedContracts as $negotiatedContract) {
194
- if($negotiatedContract['client_pricing_in_locale'] > 0)
195
- $symbol = '+';
196
- $price = $symbol.$negotiatedContract['client_pricing_in_locale'].$currencySymbol;
197
- $negotiatedContractsField[$negotiatedContract['id']] = $negotiatedContract['name'].' '.$this->__('(%s/word)', $price, array(), false);
198
- }
199
- return $negotiatedContractsField;
200
- }
201
-
202
- public function getNegotiatedContractsPricing(){
203
- $negotiatedContracts = $this->getNegotiatedContracts();
204
- $negotiatedContractsPrices = array();
205
- foreach ($negotiatedContracts as $negotiatedContract) {
206
- $negotiatedContractsPrices[$negotiatedContract['id']] = $negotiatedContract['client_pricing_in_locale'];
207
- }
208
- return $negotiatedContractsPrices;
209
- }
210
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Api.php DELETED
@@ -1,1165 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Api extends Mage_Core_Model_Abstract
27
- {
28
-
29
- protected $_api_instance;
30
-
31
- protected $_userinfo = false;
32
-
33
- protected $_categories = false;
34
-
35
- protected $_locales = false;
36
-
37
- protected $_languages = false;
38
-
39
- protected $_author = false;
40
-
41
- protected $_authors = false;
42
-
43
- protected $_prices = false;
44
-
45
- protected $_users_me = false;
46
-
47
- protected $_negotiated_contracts = array();
48
-
49
- const TEXTMASTER_API_VERSION = 'v1';
50
-
51
- const TEXTMASTER_PROD_API_URI = 'http://api.textmaster.com';
52
-
53
- const TEXTMASTER_STAGING_API_URI = 'http://api.staging.textmaster.com';
54
-
55
- const TEXTMASTER_SANDBOX_API_URI = 'http://api.sandbox.textmaster.com';
56
-
57
- const TEXTMASTER_PROD_EU_URI = 'http://eu.textmaster.com';
58
-
59
- const TEXTMASTER_STAGING_EU_URI = 'http://eu.staging.textmaster.com';
60
-
61
- const TEXTMASTER_SANDBOX_EU_URI = 'http://eu.sandbox.textmaster.com';
62
-
63
- const TEXTMASTER_TRACKER_ID = '53e3587bcc39f7000200025c';
64
-
65
- const TEXTMASTER_DEFAULT_LOCALE = 'en-EU';
66
-
67
- const TEXTMASTER_API_TIMEOUT_IN_SECONDS = 30;
68
-
69
- public function __construct ()
70
- {
71
- $this->_name = 'name_' . rand(1, 1000000);
72
- $this->api_key = Mage::getStoreConfig('textmaster/textmaster/api_key');
73
- ;
74
- $this->api_secret = Mage::getStoreConfig(
75
- 'textmaster/textmaster/api_secret');
76
- }
77
-
78
- public function getAPIConnection ()
79
- {
80
- if ($this->api_key == '' && $this->api_secret == '')
81
- return false;
82
- if ($this->api_key or $this->api_secret) {
83
- if (! $this->isConnected()) {
84
- return false;
85
- }
86
- } else {
87
- return false;
88
- }
89
- return true;
90
- }
91
-
92
- private function _initConnection ($name, $public, $clients,
93
- $version = self::TEXTMASTER_API_VERSION)
94
- {
95
- $date = gmdate('Y-m-d H:i:s');
96
- $signature = sha1($this->api_secret . $date);
97
-
98
- $header = array(
99
- 'Content-Type: application/json',
100
- 'Accept: application/json',
101
- "HTTP_AGENT: tm-magento-app",
102
- "apikey: {$this->api_key}",
103
- 'signature: ' . $signature,
104
- "date: $date"
105
- );
106
- $uri = $this->getApiUri() . ($version ? "/$version" : '') . '/' .
107
- ($clients ? 'clients/' : '') . ($public ? 'public/' : '') .
108
- $name;
109
- if (function_exists('curl_init')) {
110
- $curl = curl_init();
111
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
112
- curl_setopt($curl, CURLOPT_URL, $uri);
113
- curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
114
- curl_setopt($curl, CURLOPT_USERAGENT,'tm-magento-app');
115
- curl_setopt($curl, CURLOPT_TIMEOUT,
116
- self::TEXTMASTER_API_TIMEOUT_IN_SECONDS);
117
- curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
118
- curl_setopt($curl, CURLINFO_HEADER_OUT, true);
119
- return $curl;
120
- } else
121
- return false;
122
- }
123
-
124
- private function _curlexec ($name, $data, $method = 'post')
125
- {
126
- $public = false;
127
- $clients = true;
128
- $version = self::TEXTMASTER_API_VERSION;
129
- $command = 'curl -i ';
130
- $date = gmdate('Y-m-d H:i:s');
131
- $content = '{"project":{"ctype":"translation","options":{"language_level":"regular"},"language_from":"en","language_to":"fr"}}';
132
- $signature = sha1($this->api_secret . $date);
133
- $command .= '-H "Host: api.sandbox.textmaster.com" ';
134
- $command .= '-H "Content-Type: application/json" ';
135
- $command .= '-H "HTTP_AGENT: tm-magento-app" ';
136
- $command .= '-A "tm-magento-app" ';
137
- $command .= '-H "Accept: application/json" ';
138
- $command .= '-H "apikey: ' . $this->api_key . '" ';
139
- $command .= '-H "signature: ' . $signature . '" ';
140
- $command .= '-H "date: ' . $date . '" ';
141
- $command .= '-d \'' . $content . '\' ';
142
- $uri = $this->getApiUri() . ($version ? "/$version" : '') . '/' .
143
- ($clients ? 'clients/' : '') . ($public ? 'public/' : '') .
144
- $name;
145
-
146
- $command .= $uri;
147
- $r1 = exec($command, $m1, $m2);
148
-
149
- }
150
-
151
- private function _request ($name, $public = false, $clients = false,
152
- $version = self::TEXTMASTER_API_VERSION)
153
- {
154
- if (isset($this->_data[$name]))
155
- return $this->_data[$name];
156
- $debutlog = microtime(true);
157
- $curl = $this->_initConnection($name, $public, $clients, $version);
158
- $content = curl_exec($curl);
159
- $finlog = microtime(true);
160
- Mage::log('Log API ' . $name . ' : ' . ($finlog - $debutlog), null,
161
- 'textmaster.log');
162
- $info = curl_getinfo($curl);
163
- if ($info['http_code'] == '500') {
164
- $result['error'] = 'WS Indisponible';
165
- return $result;
166
- }
167
-
168
-
169
- curl_close($curl);
170
- try {
171
- $this->_data[$name] = Mage::helper('core')->jsonDecode($content);
172
- } catch (Exception $e) {
173
- $result['error'] = 'WS Indisponible';
174
- return $result;
175
- }
176
- return $this->_data[$name];
177
- }
178
-
179
- private function _post ($name, $data, $method = 'post')
180
- {
181
- $debutlog = microtime(true);
182
- $curl = $this->_initConnection($name, false, true);
183
-
184
- if ($method == 'put')
185
- curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
186
- elseif ($method == 'delete')
187
- curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
188
- elseif ($method == 'get') {
189
- curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
190
- } else
191
- curl_setopt($curl, CURLOPT_POST, 1);
192
-
193
- if ($data && $data != null)
194
- curl_setopt($curl, CURLOPT_POSTFIELDS,
195
- Mage::helper('core')->jsonEncode($data));
196
- else
197
- curl_setopt($curl, CURLOPT_POSTFIELDS,
198
- Mage::helper('core')->jsonEncode(''));
199
- $content = curl_exec($curl);
200
-
201
- $result = Mage::helper('core')->jsonDecode($content);
202
- $finlog = microtime(true);
203
- Mage::log(
204
- 'Log API ' . $method . ' ' . $name . ' : ' .
205
- ($finlog - $debutlog), null, 'textmaster.log');
206
- $info = curl_getinfo($curl);
207
-
208
- // Mage::log(Mage::helper('core')->jsonEncode($data),null,'textmaster.log');
209
- // Mage::log($info,null,'textmaster.log');
210
- // Mage::log($result,null,'textmaster.log');
211
-
212
-
213
- if ($info['http_code'] == '500') {
214
- $result['error'] = 'WS Indisponible';
215
- $result['type'] = 'error';
216
- return $result;
217
- }
218
-
219
- if (curl_errno($curl) || $info['http_code'] >= 300) {
220
- if (isset($result['message'])) {
221
- $result['error'] = (is_array($result['message'])) ? implode(' ',
222
- $result['message']) : $result['message'];
223
- $result['type'] = 'message';
224
- } elseif (isset($result['error'])) {
225
- $result['error'] = (is_array($result['error'])) ? implode(' ',
226
- $result['error']) : $result['error'];
227
- $result['type'] = 'error';
228
- } elseif (isset($result['base'])) {
229
- $result['error'] = (is_array($result['base'])) ? implode(' ',
230
- $result['base']) : $result['base'];
231
- $result['type'] = 'base';
232
- } else {
233
- $error_msg = '';
234
- if (is_array($result)) {
235
- if (isset($result['errors']) &&
236
- isset($result['errors']['base'])) {
237
- $result['error'] = reset($result['errors']['base']);
238
- $result['type'] = 'base';
239
- } elseif (isset($result['errors'])) {
240
- $count = count($result);
241
- foreach ($result['errors'] as $fieldname => $message)
242
- $error_msg .= $fieldname . ' : ' . reset($message) .
243
- ((-- $count) ? ', ' : '');
244
- $result['error'] = $error_msg;
245
- $result['type'] = 'error';
246
- }
247
- }
248
- }
249
- }
250
-
251
- curl_close($curl);
252
- if (isset($result['error'])) {
253
- Mage::log($result['error'], null, 'textmaster.log');
254
- }
255
- return $result;
256
- }
257
-
258
- public function getApiUri ()
259
- {
260
- $sandbox = Mage::getConfig()->getNode('adminhtml/api/sandbox')->asArray();
261
- $staging = Mage::getConfig()->getNode('adminhtml/api/staging')->asArray();
262
- if ($sandbox) {
263
- return self::TEXTMASTER_SANDBOX_API_URI/*.'/'.self::TEXTMASTER_API_VERSION.''*/;
264
- } elseif ($staging) {
265
- return self::TEXTMASTER_STAGING_API_URI/*.'/'.self::TEXTMASTER_API_VERSION.''*/;
266
- } else {
267
- return self::TEXTMASTER_PROD_API_URI/*.'/'.self::TEXTMASTER_API_VERSION.''*/;
268
- }
269
- }
270
-
271
- public function getInterfaceUri ()
272
- {
273
- $sandbox = Mage::getConfig()->getNode('adminhtml/api/sandbox')->asArray();
274
- $staging = Mage::getConfig()->getNode('adminhtml/api/staging')->asArray();
275
- if ($sandbox) {
276
- return 'http://eu.app.sandbox.textmaster.com/';
277
- } elseif ($staging) {
278
- return 'http://eu.app.staging.textmaster.com/';
279
- } else {
280
- return 'http://eu.app.textmaster.com/';
281
- }
282
- }
283
-
284
- public function getEuUri ()
285
- {
286
- $sandbox = Mage::getConfig()->getNode('adminhtml/api/sandbox')->asArray();
287
- $staging = Mage::getConfig()->getNode('adminhtml/api/staging')->asArray();
288
- if ($sandbox) {
289
- return self::TEXTMASTER_SANDBOX_EU_URI;
290
- } elseif ($staging) {
291
- return self::TEXTMASTER_STAGING_EU_URI;
292
- } else {
293
- return self::TEXTMASTER_PROD_EU_URI;
294
- }
295
- }
296
-
297
- public function getAuth2Token ($email, $password)
298
- {
299
- if (! function_exists('curl_init')) {
300
- throw new Exception('CURL non activé');
301
- return false;
302
- }
303
- $uri = $this->getEuUri() . '/oauth/token';
304
- $header = "grant_type=password" . "&user[email]={$email}" .
305
- "&user[password]={$password}" . "&client_id=" .
306
- $this->getClientId() . "&client_secret=" .
307
- $this->getClientSecret();
308
-
309
-
310
- $curl = curl_init();
311
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
312
- curl_setopt($curl, CURLOPT_URL, $uri);
313
- curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
314
- curl_setopt($curl, CURLOPT_TIMEOUT, 10); // timeout in seconds
315
- curl_setopt($curl, CURLOPT_POSTFIELDS, $header);
316
- $response = curl_exec($curl);
317
-
318
- try {
319
- Mage::log($response,null,'textmaster.log');
320
- return Mage::helper('core')->jsonDecode($response);
321
- } catch (Exception $e) {
322
- Mage::log('Exception : ' . $uri,null,'textmaster.log');
323
- Mage::log($header,null,'textmaster.log');
324
- Mage::log($response,null,'textmaster.log');
325
- return false;
326
- }
327
- }
328
-
329
- function getAuth2TokenForCreation ()
330
- {
331
- $uri = $this->getEuUri() . '/oauth/token';
332
- $header = "grant_type=client_credentials" . "&client_id=" .
333
- $this->getClientId() . "&client_secret=" .
334
- $this->getClientSecret();
335
-
336
- $curl = curl_init();
337
-
338
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
339
- curl_setopt($curl, CURLOPT_URL, $uri);
340
- curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
341
- curl_setopt($curl, CURLOPT_TIMEOUT, 10); // timeout in seconds
342
- curl_setopt($curl, CURLOPT_POSTFIELDS, $header);
343
- $response = curl_exec($curl);
344
- try {
345
- return Mage::helper('core')->jsonDecode($response);
346
- } catch (Exception $e) {
347
- Mage::log('Exception : ' . $uri,null,'textmaster.log');
348
- Mage::log($header,null,'textmaster.log');
349
- Mage::log($response,null,'textmaster.log');
350
- return false;
351
- }
352
- }
353
-
354
- // Clé publique: 8de45500fd370ed35c0269749ebb872149f8929d0d78cc5b5016bcd584c9058b
355
- // Clé privée: 75324f2849b25c7112d374a1a51a8b442220726639d64583196a7c2385227007
356
-
357
- public function getClientId ()
358
- {
359
- $sandbox = Mage::getConfig()->getNode('adminhtml/api/sandbox')->asArray();
360
- $staging = Mage::getConfig()->getNode('adminhtml/api/staging')->asArray();
361
- if ($sandbox) {
362
- return '8de45500fd370ed35c0269749ebb872149f8929d0d78cc5b5016bcd584c9058b';
363
- // return '97ff3df474ff8776e346e38e322ab2300e96429a4efc88c305078a6213902f21';
364
- } elseif ($staging) {
365
- return '8de45500fd370ed35c0269749ebb872149f8929d0d78cc5b5016bcd584c9058b';
366
- // return '97ff3df474ff8776e346e38e322ab2300e96429a4efc88c305078a6213902f21';
367
- } else {
368
- return '8de45500fd370ed35c0269749ebb872149f8929d0d78cc5b5016bcd584c9058b';
369
- }
370
- }
371
-
372
- public function getClientSecret ()
373
- {
374
- $sandbox = Mage::getConfig()->getNode('adminhtml/api/sandbox')->asArray();
375
- $staging = Mage::getConfig()->getNode('adminhtml/api/staging')->asArray();
376
- if ($sandbox) {
377
- return '75324f2849b25c7112d374a1a51a8b442220726639d64583196a7c2385227007';
378
- // return 'f089333f59275789afc763e60d436fdd740a03f07fe168bf5569ebed0380b6a6';
379
- } elseif ($staging) {
380
- return '75324f2849b25c7112d374a1a51a8b442220726639d64583196a7c2385227007';
381
- // return 'f089333f59275789afc763e60d436fdd740a03f07fe168bf5569ebed0380b6a6';
382
- } else {
383
- return '75324f2849b25c7112d374a1a51a8b442220726639d64583196a7c2385227007';
384
- }
385
- }
386
-
387
- public function getAPIKeys ($oAuthToken)
388
- {
389
- // Mage::log('getAPIKeys', null, 'textmaster.log');
390
- $uri = $this->getApiUri() . '/admin/users/me';
391
- $header = array(
392
- "Authorization: Bearer {$oAuthToken}"
393
- );
394
-
395
- $curl = curl_init();
396
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
397
- curl_setopt($curl, CURLOPT_URL, $uri);
398
- curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
399
- curl_setopt($curl, CURLOPT_TIMEOUT, 10); // timeout in seconds
400
- curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
401
- $response = curl_exec($curl);
402
- try {
403
- return Mage::helper('core')->jsonDecode($response);
404
- } catch (Exception $e) {
405
- Mage::log('Exception',null,'textmaster.log');
406
- Mage::log($oAuthToken,null,'textmaster.log');
407
- Mage::log($response,null,'textmaster.log');
408
- return false;
409
- }
410
- }
411
-
412
- function createUser ($token, $email, $password, $phone = null)
413
- {
414
- $uri = $this->getApiUri() . '/admin/users';
415
-
416
- $header = array(
417
- "Content-Type: application/json",
418
- "Authorization: Bearer {$token}",
419
- "Accept: application/json",
420
- "AGENT: tm-magento-app/agent v1.0"
421
- );
422
-
423
- $aData = $phone ? array(
424
- 'user' => array(
425
- 'locale' => $this->getFullLocale(true),
426
- 'email' => $email,
427
- 'password' => $password,
428
- 'referer_tracker_id' => self::TEXTMASTER_TRACKER_ID,
429
- 'group' => 'clients',
430
- 'contact_information_attributes' => array(
431
- 'phone_number' => $phone
432
- )
433
- )
434
- ) : array(
435
- 'user' => array(
436
- 'locale' => $this->getFullLocale(true),
437
- 'email' => $email,
438
- 'referer_tracker_id' => self::TEXTMASTER_TRACKER_ID,
439
- 'password' => $password,
440
- 'group' => 'clients'
441
- )
442
- );
443
- try {
444
- $jData = Mage::helper('core')->jsonEncode($aData);
445
- } catch (Exception $e) {
446
- return false;
447
- }
448
-
449
- $curl = curl_init();
450
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
451
- curl_setopt($curl, CURLOPT_URL, $uri);
452
- curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
453
- curl_setopt($curl, CURLOPT_TIMEOUT, 10); // timeout in seconds
454
- curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
455
- curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
456
- curl_setopt($curl, CURLOPT_POSTFIELDS, $jData);
457
-
458
- try {
459
- return Mage::helper('core')->jsonDecode($response);
460
- } catch (Exception $e) {
461
- Mage::log('Exception : ' . $uri,null,'textmaster.log');
462
- Mage::log($header,null,'textmaster.log');
463
- Mage::log($response,null,'textmaster.log');
464
- return false;
465
- }
466
- }
467
-
468
- public function getFullLocale ($registration = false)
469
- {
470
- if (! $registration) {
471
- $user_info = $this->getUserInfo();
472
- return $user_info['locale'];
473
- }
474
-
475
- $locales = $this->getLocales();
476
- $admin_locale_code = Mage::getStoreConfig('general/locale/code');
477
- foreach ($locales as $locale) {
478
- if ($admin_locale_code == str_replace('-', '_', $locale['code'])) {
479
- return $locale['code'];
480
- }
481
- }
482
-
483
- return self::TEXTMASTER_DEFAULT_LOCALE;
484
- }
485
-
486
- public function getUserInfo ()
487
- {
488
- // Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
489
- if ($this->_userinfo)
490
- return $this->_userinfo;
491
- $this->_userinfo = Mage::getSingleton('adminhtml/session')->getTextmasterUserInfos();
492
-
493
- //Mage::log($this->_userinfo, null, 'textmaster.log');
494
-
495
- if ($this->_userinfo && is_array($this->_userinfo) &&
496
- ! isset($this->_userinfo['error']))
497
- return $this->_userinfo;
498
- else
499
- Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
500
-
501
- $this->_userinfo = $this->_request('users/me', false, true);
502
- Mage::getSingleton('adminhtml/session')->setTextmasterUserInfos(
503
- $this->_userinfo);
504
- return $this->_userinfo;
505
- }
506
-
507
- public function isUserConnected ()
508
- {
509
- if ($this->api_key == '' || $this->api_secret == '')
510
- return false;
511
-
512
- $user = $this->getUserInfo();
513
- $tmp = ( ! isset($user['errors']) && ! empty($user) &&
514
- isset($user['email']));
515
-
516
- return $tmp;
517
- }
518
-
519
- public function isConnected ()
520
- {
521
- if (! isset($this->_connection))
522
- $this->_connection = $this->testConnection();
523
- return $this->_connection;
524
- }
525
-
526
- public function testConnection ()
527
- {
528
- $result = $this->getUserInfo();
529
- return ! empty($result) && ! isset($result['errors']);
530
- }
531
-
532
- public function getCategories ()
533
- {
534
- if ($this->_categories)
535
- return $this->_categories;
536
-
537
- $this->_categories = Mage::getSingleton('adminhtml/session')->getTextmasterCategories();
538
-
539
- if ($this->_categories && ! isset($this->_categories['error']))
540
- return $this->_categories;
541
-
542
- $locale = Mage::app()->getLocale()->getLocaleCode();
543
-
544
- $data = $this->_request(
545
- 'categories?locale=' . str_replace('_', '-', $locale), true);
546
- $this->_categories = $data['categories'];
547
- if (! isset($this->_categories['error']))
548
- Mage::getSingleton('adminhtml/session')->setTextmasterCategories(
549
- $this->_categories);
550
- return $this->_categories;
551
- }
552
-
553
- public function getCategory ($value)
554
- {
555
- if (! $this->_categories) {
556
- $this->getCategories();
557
- }
558
- // Mage::log($this->_categories,null,'textmaster.log');
559
- foreach ($this->_categories as $cat) {
560
- if ($cat['code'] == $value)
561
- return $cat['value'];
562
- }
563
-
564
- // if(isset($this->_categories[$value])) return
565
- // $this->_categories[$value];
566
- return $value;
567
- }
568
-
569
- public function getLocales ()
570
- {
571
- if ($this->_locales)
572
- return $this->_locales;
573
-
574
- $this->_locales = Mage::getSingleton('adminhtml/session')->getTextmasterLocales();
575
- if ($this->_locales && ! isset($this->_locales['error']))
576
- return $this->_locales;
577
-
578
- $this->_locales = $this->_request("locales", true);
579
- if (! isset($this->_locales['error']))
580
- Mage::getSingleton('adminhtml/session')->setTextmasterLocales(
581
- $this->_locales);
582
- return $this->_locales;
583
- }
584
-
585
- public function getLanguages ()
586
- {
587
- if ($this->_languages)
588
- return $this->_languages;
589
-
590
- $this->_languages = Mage::getSingleton('adminhtml/session')->getTextmasterLanguages();
591
- if ($this->_languages && ! isset($this->_languages['error']))
592
- return $this->_languages;
593
-
594
- $locale = Mage::app()->getLocale()->getLocaleCode();
595
- $data = $this->_request(
596
- 'languages?locale=' . str_replace('_', '-', $locale), true);
597
- $textmaster_languages = $data['languages'];
598
-
599
- $this->_languages = $textmaster_languages;
600
- if (! isset($this->_languages['error']))
601
- Mage::getSingleton('adminhtml/session')->setTextmasterLanguages(
602
- $this->_languages);
603
- return $this->_languages;
604
- }
605
-
606
- public function getLanguage ($value)
607
- {
608
- if (! $this->_languages) {
609
- $this->getLanguages();
610
- }
611
- if (isset($this->_languages[$value]))
612
- return $this->_languages[$value];
613
- return $value;
614
- }
615
-
616
- public function getAuthor ($id_author)
617
- {
618
- if (isset($this->_author[$id_author]))
619
- return $this->_author[$id_author];
620
- $this->_author[$id_author] = $this->_post("my_authors/" . $id_author,
621
- null, 'get');
622
- return $this->_author[$id_author];
623
- }
624
-
625
- public function getAuthors ()
626
- {
627
- if ($this->_authors)
628
- return $this->_authors;
629
- $this->_authors = Mage::getSingleton('adminhtml/session')->getTextmasterMyAuthors();
630
- if ($this->_authors && ! isset($this->_authors['error']))
631
- return $this->_authors;
632
- $this->_authors = $this->_request("my_authors", false, true);
633
- Mage::log($this->_authors,null,'textmaster.log');
634
- if (! isset($this->_authors['error']))
635
- Mage::getSingleton('adminhtml/session')->setTextmasterMyAuthors(
636
- $this->_authors);
637
- return $this->_authors;
638
- }
639
-
640
- public function getAuthorsFilter ($data)
641
- {
642
- $data = array(
643
- 'project' => $data
644
- );
645
- return $this->_post("authors", $data, 'get');
646
- // return $this->_authors;
647
- }
648
-
649
- public function getMyAuthorsByProject ($id_project_api)
650
- {
651
- if(isset($this->_myauthors)) return $this->_myauthors;
652
- $name = "projects/" . $id_project_api . "/my_authors";
653
- $this->_myauthors = $this->_request($name, false, true);
654
- return $this->_myauthors;
655
- }
656
-
657
- public function getServiceLevels ()
658
- {
659
- if (isset($this->_service_levels))
660
- return $this->_service_levels; // return
661
- // vocabulary
662
- // levels
663
- // from
664
- // cache
665
- // if
666
- // exists
667
-
668
- /* put service levels into array */
669
- $this->_service_levels = array(
670
- 'regular' => Mage::helper('textmaster')->__('Regular'),
671
- 'premium' => Mage::helper('textmaster')->__('Premium'),
672
- 'enterprise' => Mage::helper('textmaster')->__('Enterprise')
673
- );
674
- return $this->_service_levels;
675
- }
676
-
677
- public function getServiceLevel ($value)
678
- {
679
- if (! isset($this->_service_levels)) {
680
- $this->getServiceLevels();
681
- }
682
- if (isset($this->_service_levels[$value]))
683
- return $this->_service_levels[$value];
684
- return $value;
685
- }
686
-
687
- /**
688
- * Puts available vocabulary levels into array
689
- *
690
- * @return Array vocabulary levels
691
- */
692
- public function getVocabularyLevels ()
693
- {
694
- if (isset($this->_vocabulary_levels))
695
- return $this->_vocabulary_levels; // return
696
- // vocabulary
697
- // levels
698
- // from
699
- // cache
700
- // if
701
- // exists
702
-
703
- /* put vocabulary levels into cache */
704
- $this->_vocabulary_levels = array(
705
- 'not_specified' => Mage::helper('textmaster')->__(
706
- 'Not specified'),
707
- 'popular' => Mage::helper('textmaster')->__('Popular'),
708
- 'technical' => Mage::helper('textmaster')->__('Technique'),
709
- 'fictional' => Mage::helper('textmaster')->__('Fictional')
710
- );
711
- return $this->_vocabulary_levels;
712
- }
713
-
714
- public function getVocabularyLevel ($value)
715
- {
716
- if (! isset($this->_vocabulary_levels)) {
717
- $this->getVocabularyLevels();
718
- }
719
- if (isset($this->_vocabulary_levels[$value]))
720
- return $this->_vocabulary_levels[$value];
721
- return $value;
722
- }
723
-
724
- /**
725
- * Puts available grammatical persons into array
726
- *
727
- * @return Array grammatical persons
728
- */
729
- public function getGrammaticalPersons ()
730
- {
731
- if (isset($this->_grammatical_persons))
732
- return $this->_grammatical_persons; // return
733
- // grammatical
734
- // persons
735
- // from
736
- // cache
737
- // if
738
- // exists
739
-
740
- /* put grammatical persons into cache */
741
- $this->_grammatical_persons = array(
742
- 'not_specified' => Mage::helper('textmaster')->__(
743
- 'Not specified'),
744
- 'first_person_singular' => Mage::helper('textmaster')->__('I'),
745
- 'second_person_singular' => Mage::helper('textmaster')->__(
746
- 'You'),
747
- 'third_person_singular_masculine' => Mage::helper('textmaster')->__(
748
- 'He'),
749
- 'third_person_singular_feminine' => Mage::helper('textmaster')->__(
750
- 'She'),
751
- 'third_person_singular_neuter' => Mage::helper('textmaster')->__(
752
- 'One'),
753
- 'first_person_plural' => Mage::helper('textmaster')->__('We'),
754
- 'second_person_plural' => Mage::helper('textmaster')->__('You'),
755
- 'third_person_plural' => Mage::helper('textmaster')->__('They')
756
- );
757
-
758
- return $this->_grammatical_persons;
759
- }
760
-
761
- public function getGrammaticalPerson ($value)
762
- {
763
- if (! isset($this->_grammatical_persons)) {
764
- $this->getGrammaticalPersons();
765
- }
766
- if (isset($this->_grammatical_persons[$value]))
767
- return $this->_grammatical_persons[$value];
768
- return $value;
769
- }
770
-
771
- public function getAudiences ()
772
- {
773
- if (isset($this->_audiences))
774
- return $this->_audiences; // return
775
- // audiences
776
- // from
777
- // cache if
778
- // exists
779
-
780
- /* put audieces into cache */
781
- $this->_audiences = array(
782
- 'not_specified' => Mage::helper('textmaster')->__(
783
- 'Not specified'),
784
- 'children' => Mage::helper('textmaster')->__(
785
- 'Children under 14 years old'),
786
- 'teenager' => Mage::helper('textmaster')->__(
787
- 'Teenagers > between 14 and 18 years old'),
788
- 'young_adults' => Mage::helper('textmaster')->__(
789
- 'Young adults > between 19 and 29 years old'),
790
- 'adults' => Mage::helper('textmaster')->__(
791
- 'Adults > between 30 and 59 years old'),
792
- 'old_adults' => Mage::helper('textmaster')->__(
793
- 'Seniors > 60 years old and beyond')
794
- );
795
- return $this->_audiences;
796
- }
797
-
798
- public function getAudience ($audience)
799
- {
800
- if (! isset($this->_audiences)) {
801
- $this->getAudiences();
802
- }
803
- if (isset($this->_audiences[$audience]))
804
- return $this->_audiences[$audience];
805
- return $audience;
806
- }
807
-
808
- public function getNegotiatedContracts(){
809
- if($this->_negotiated_contracts)
810
- return $this->_negotiated_contracts;
811
-
812
- $negotiatedContracts = $this->_request("negotiated_contracts?per_page=100", false, true);
813
- $this->_negotiated_contracts = $negotiatedContracts;
814
-
815
- return $negotiatedContracts;
816
- }
817
-
818
- public function getPricings ($word_count = 1)
819
- {
820
- if ($this->_prices)
821
- return $this->_prices;
822
-
823
- if($word_count==1) {
824
- $this->_prices = Mage::getSingleton('adminhtml/session')->getTextmasterPricings();
825
- if ($this->_prices && ! isset($this->_prices['error']))
826
- return $this->_prices;
827
- }
828
-
829
- $prices = $this->_request("reference_pricings?word_count=$word_count",
830
- true);
831
-
832
- $user = $this->getUserInfo();
833
-
834
- foreach ($prices['reference_pricings'] as $pricings) {
835
- if ($pricings['locale'] == $user['locale']) {
836
- foreach ($pricings['types'] as $type => $params) {
837
- foreach ($params as $key => $param) {
838
- $pricings['types'][$type][$param['name']] = $param['value'];
839
- unset($pricings['types'][$type][$key]);
840
- }
841
- }
842
-
843
- $this->_prices = $pricings;
844
- if($word_count==1 ) {
845
- Mage::getSingleton('adminhtml/session')->setTextmasterPricings($this->_prices);
846
- }
847
- return $this->_prices;
848
- }
849
- }
850
- $this->_prices = array();
851
- return $this->_prices;
852
- }
853
-
854
- public function getProject ($id_project_api)
855
- {
856
-
857
- return $this->_request("projects/$id_project_api", false, true);
858
- }
859
-
860
- public function getProjects ($type = false, $filters = array(), $limit = array(0,20), $order = array('created_at','desc'))
861
- {
862
- $filter_request = 'where='.json_encode($filters['where']);
863
- $md5 = md5($type . '#' . $limit[1] . '#' . $limit[0] . '#' . $filter_request.'#'.$order[0].'#'.$order[1]);
864
- if (isset($this->{'projects_' . $md5}) && $this->{'projects_' . $type})
865
- return $this->{'projects_' . $md5}; // return projects from cache if
866
- // exists
867
-
868
- $request = 'projects/filter?order='.($order[1]=='desc'?'-':'').$order[0].'&per_page=' . $limit[1] . '&page=' . $limit[0];
869
-
870
- if (count($filters['where']))
871
- $request .= '&' . $filter_request;
872
-
873
- $this->{'projects_' . $md5} = $this->_request($request, false, true);
874
- return $this->{'projects_' . $md5};
875
- }
876
-
877
- public function addProject ($parameters, $quotation = false)
878
- {
879
- foreach ($parameters as $field => $value) {
880
- if ($value == '')
881
- unset($parameters[$field]);
882
- }
883
-
884
- $default_project_data = array(
885
- 'same_author_must_do_entire_project' => 'true',
886
- 'language_level' => 'regular',
887
- 'quality' => 'false',
888
- #'expertise' => 'false',
889
- 'vocabulary_type' => Mage::getStoreConfig(
890
- 'textmaster/defaultvalue/type_vocabulary'),
891
- 'grammatical_person' => Mage::getStoreConfig(
892
- 'textmaster/defaultvalue/grammatical_person'),
893
- 'target_reader_groups' => Mage::getStoreConfig(
894
- 'textmaster/defaultvalue/target_audience')
895
- );
896
-
897
- $parameters = array_merge($default_project_data, $parameters); // values,
898
- // sent
899
- // to
900
- // function
901
- // overides
902
- // the
903
- // default
904
- // values
905
- $options = array(
906
- 'language_level' => $parameters['language_level'],
907
- 'quality' => isset($parameters['quality']) ? $parameters['quality'] : '0',
908
- 'translation_memory' => isset($parameters['translation_memory']) ? $parameters['translation_memory'] : '0',
909
- 'negotiated_contract' => isset($parameters['negotiated_contract']) ? $parameters['negotiated_contract'] : '',
910
- 'specific_attachment' => isset($parameters['specific_attachment']) ? $parameters['specific_attachment'] : '0',
911
- 'priority' => isset($parameters['priority']) ? $parameters['priority'] : '0',
912
- 'uniq_author' => isset($parameters['same_author_must_do_entire_project']) ? $parameters['same_author_must_do_entire_project'] : '0'
913
- );
914
-
915
- unset($parameters['language_level'],
916
- $parameters['quality'],
917
- $parameters['expertise'],
918
- $parameters['translation_memory'],
919
- $parameters['negotiated_contract'],
920
- $parameters['specific_attachment'],
921
- $parameters['priority'],
922
- $parameters['same_author_must_do_entire_project']
923
- );
924
-
925
- $parameters['options'] = $options;
926
-
927
-
928
- if (isset($parameters['textmasters'])) {
929
- if (is_array($parameters['textmasters']) &&
930
- count($parameters['textmasters']) == 0)
931
- unset($parameters['textmasters']);
932
- if (! is_array($parameters['textmasters']))
933
- unset($parameters['textmasters']);
934
- }
935
-
936
- $parameters['callback'] = array(
937
- 'project_tm_completed' => array(
938
- 'url' => Mage::helper('textmaster')->getCallbackUrlTmComplete(),
939
- 'format' => 'json'
940
- )
941
- );
942
-
943
- // Mage::log($parameters);
944
-
945
- $data = array(
946
- 'project' => $parameters,
947
- 'tracker' => self::TEXTMASTER_TRACKER_ID
948
- );
949
-
950
-
951
- if ($quotation)
952
- return $this->_post('projects/quotation', $data, 'get');
953
- return $this->_post('projects', $data);
954
- }
955
-
956
- public function updateProject ($id_project_api, $parameters)
957
- {
958
- foreach ($parameters as $field => $value) {
959
- if ($value == '')
960
- unset($parameters[$field]);
961
- }
962
- $options = array(
963
- 'language_level' => $parameters['language_level'],
964
- 'quality' => isset($parameters['quality']) ? $parameters['quality'] : '0',
965
- 'translation_memory' => isset($parameters['translation_memory']) ? $parameters['translation_memory'] : '0',
966
- 'negotiated_contract' => isset($parameters['negotiated_contract']) ? $parameters['negotiated_contract'] : '',
967
- 'specific_attachment' => isset($parameters['specific_attachment']) ? $parameters['specific_attachment'] : '0',
968
- 'priority' => isset($parameters['priority']) ? $parameters['priority'] : '0',
969
- 'uniq_author' => isset($parameters['same_author_must_do_entire_project']) ? $parameters['same_author_must_do_entire_project'] : '0',
970
- // 'expertise' => isset($parameters['expertise']) ? $parameters['expertise'] : '0',
971
- );
972
- unset($parameters['language_level'],
973
- $parameters['quality'],
974
- $parameters['expertise'],
975
- $parameters['translation_memory'],
976
- $parameters['negotiated_contract'],
977
- $parameters['specific_attachment'],
978
- $parameters['priority'],
979
- $parameters['same_author_must_do_entire_project']
980
- );
981
-
982
- $parameters['options'] = $options;
983
- if (isset($parameters['textmasters']) && ((is_array(
984
- $parameters['textmasters']) &&
985
- count($parameters['textmasters']) == 0) ||
986
- ! is_array($parameters['textmasters']))) {
987
- unset($parameters['textmasters']);
988
- }
989
-
990
- $parameters['callback'] = array(
991
- 'project_in_progress' => array(
992
- 'url' => Mage::helper('textmaster')->getCallbackUrlInProgress(),
993
- "format" => "json"
994
- ),
995
- 'project_tm_completed' => array(
996
- 'url' => Mage::helper('textmaster')->getCallbackUrlTmComplete(),
997
- 'format' => 'json'
998
- )
999
- );
1000
-
1001
- $data = array(
1002
- 'project' => $parameters,
1003
- 'tracker' => self::TEXTMASTER_TRACKER_ID
1004
- );
1005
-
1006
- $result = $this->_post("projects/{$id_project_api}", $data, 'put');
1007
- return $result;
1008
- }
1009
- public function updateProjectTextmasters ($id_project_api, $textmasters)
1010
- {
1011
- $data = array(
1012
- 'project' => array('textmasters'=>$textmasters)
1013
- );
1014
- $result = $this->_post("projects/{$id_project_api}", $data, 'put');
1015
- return $result;
1016
- }
1017
-
1018
- public function addDocument ($id_project_api, $data)
1019
- {
1020
- $data['perform_word_count'] = $this->getUrl('');
1021
- $data = array(
1022
- 'document' => $textmasters
1023
- );
1024
- return $this->_post("projects/$id_project_api/documents", $data);
1025
- }
1026
-
1027
- public function addDocuments ($id_project_api, $data)
1028
- {
1029
- foreach ($data as &$item) {
1030
- $item['word_count'] = 0;
1031
- unset($item['word_count_rule']);
1032
- $item['perform_word_count'] = true;
1033
- $item['callback'] = array(
1034
- 'word_count_finished' => array(
1035
- 'url' => Mage::helper('textmaster')->getCallbackUrl(),
1036
- "format" => "json"
1037
- ),
1038
- 'complete' => array(
1039
- 'url' => Mage::helper('textmaster')->getCallbackCompletedUrl(),
1040
- "format" => "json"
1041
- )
1042
-
1043
- );
1044
- }
1045
-
1046
- $data = array(
1047
- 'documents' => $data
1048
- );
1049
- $reponse = $this->_post("projects/$id_project_api/batch/documents",
1050
- $data);
1051
- return $reponse;
1052
- }
1053
-
1054
- public function getDocuments ($id_project_api, $filters,$limit = array(0,20),$order=array('reference','desc'))
1055
- {
1056
- $filter_request = 'where='.json_encode($filters['where']);
1057
- $request = 'projects/'.$id_project_api.'/documents/filter?order='.($order[1]=='desc'?'-':'').$order[0].'&per_page=' . $limit[1] . '&page=' . $limit[0];
1058
- if (count($filters['where']))
1059
- $request .= '&' . $filter_request;
1060
- return $this->_request($request, false, true);
1061
- }
1062
-
1063
- public function getDocument ($id_project_api, $id_document_api)
1064
- {
1065
- return $this->_request(
1066
- "projects/$id_project_api/documents/$id_document_api", false,
1067
- true);
1068
- }
1069
-
1070
- public function launchProject ($id_project_api, $asynchro = true)
1071
- {
1072
- if ($asynchro) {
1073
- $result = $this->_post("projects/$id_project_api/async_launch",
1074
- null);
1075
- return $result;
1076
- }
1077
- return $this->_post("projects/$id_project_api/launch", null, 'put');
1078
- }
1079
-
1080
- public function pauseProject ($id_project_api)
1081
- {
1082
- return $this->_post("projects/$id_project_api/pause", null, 'put');
1083
- }
1084
-
1085
- public function resumeProject ($id_project_api)
1086
- {
1087
- return $this->_post("projects/$id_project_api/resume", null, 'put');
1088
- }
1089
-
1090
- public function cancelProject ($id_project_api)
1091
- {
1092
- return $this->_post("projects/$id_project_api/cancel", null, 'put');
1093
- }
1094
-
1095
- public function completeProject ($id_project_api)
1096
- {
1097
- return $this->_post("projects/$id_project_api/complete", null, 'put');
1098
- }
1099
-
1100
- public function duplicateProject ($id_project_api)
1101
- {
1102
- return $this->_post("projects/$id_project_api/duplicate", null, 'post');
1103
- }
1104
-
1105
- public function updateDocument ($id_project_api, $id_document_api,
1106
- $parameters)
1107
- {
1108
- $data = array(
1109
- 'document' => $parameters
1110
- );
1111
- return $this->_post(
1112
- "projects/$id_project_api/documents/{$id_document_api}", $data,
1113
- 'put');
1114
- }
1115
-
1116
- public function deleteDocument ($id_project_api, $id_document_api)
1117
- {
1118
- return $this->_post(
1119
- "projects/$id_project_api/documents/$id_document_api", null,
1120
- 'delete');
1121
- }
1122
-
1123
- public function approveDocument ($id_project_api, $id_document_api)
1124
- {
1125
- return $this->_post(
1126
- "projects/$id_project_api/documents/$id_document_api/complete",
1127
- null, 'put');
1128
- }
1129
-
1130
- public function commentDocument ($id_project_api, $id_document_api, $message)
1131
- {
1132
- return $this->_post(
1133
- "projects/$id_project_api/documents/$id_document_api/support_messages",
1134
- array(
1135
- 'support_message' => array(
1136
- 'message' => $message
1137
- )
1138
- ), 'post');
1139
- }
1140
-
1141
- public function completeDocument ($id_project_api, $id_document_api,$callback = false,$message = false,$satisfaction = false)
1142
- {
1143
- $document_ids = array($id_document_api);
1144
- return $this->completeDocuments($id_project_api,$document_ids,$callback,$message,$satisfaction);
1145
- }
1146
- public function completeDocuments ($id_project_api, $document_ids,$callback = false,$message = false,$satisfaction = false)
1147
- {
1148
- $data = array('documents'=>$document_ids);
1149
- if(!empty($message)) {
1150
- $data['message'] = $message;
1151
- }
1152
- if(!empty($satisfaction)) {
1153
- $data['satisfaction'] = $satisfaction;
1154
- }
1155
-
1156
- return $this->_post("projects/$id_project_api/batch/documents/complete", $data, 'post');
1157
- }
1158
-
1159
- public function getSupportMessages ($id_project_api, $id_document_api)
1160
- {
1161
- $name = "projects/" . $id_project_api .
1162
- "/documents/$id_document_api/support_messages";
1163
- return $this->_request($name, false, true);
1164
- }
1165
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Document.php DELETED
@@ -1,265 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Document extends Mage_Core_Model_Abstract {
27
-
28
- private $_product = false;
29
-
30
- const DOCUMENT_STATUS_IN_CREATION = "in_creation";
31
- const DOCUMENT_STATUS_IN_PROGRESS = "in_progress";
32
- const DOCUMENT_STATUS_IN_REVIEW = "in_review";
33
- const DOCUMENT_STATUS_CANCEL = "canceled";
34
- const DOCUMENT_STATUS_COMPLETED = "completed";
35
- const DOCUMENT_STATUS_PAUSED = "paused";
36
-
37
- public function _construct() {
38
- parent::_construct ();
39
- $this->_init ( 'textmaster/document' );
40
- }
41
-
42
- public function send() {
43
- if (! $this->getSend ()) {
44
-
45
- $data = $this->prepareData();
46
-
47
- $project = Mage::getModel ( 'textmaster/project' )->load ( $this->getTextmasterProjectId (), null, false );
48
-
49
- $result = Mage::helper('textmaster')->getApi()->addDocument ( $project->getProjectApiid (), $data );
50
- if (! isset ( $result ['error'] )) {
51
- $this->setDocumentApiId ( $result ['id'] );
52
- $this->setSend ( 1 );
53
- $this->save ();
54
- }
55
- }
56
- }
57
-
58
- public function canComplete() {
59
- return $this->getStatus()==self::DOCUMENT_STATUS_IN_REVIEW;
60
- }
61
-
62
- public function complete(){
63
-
64
- $this->setStatus(self::DOCUMENT_STATUS_COMPLETED);
65
- $this->setCompleted(1);
66
- $this->setData('encourscomplete',0);
67
- $this->save();
68
- $this->transfert();
69
-
70
- return $this;
71
- }
72
- public function prepareToComplete(){
73
-
74
- $this->setData('encourscomplete',1);
75
- $this->setSendforcomplete(1);
76
- $this->setCompleted(0);
77
- $this->save();
78
-
79
- return $this;
80
- }
81
- public function sendToComplete(){
82
-
83
- $result = Mage::helper('textmaster')->getApi()->completeDocument($this->getProject()->getProjectApiid(),$this->getDocumentApiId());
84
- if(!isset($result['error'])){
85
- $this->prepareToComplete();
86
- }
87
-
88
- return $this;
89
- }
90
-
91
- public function canTransfert(){
92
- return $this->getStatus()==self::DOCUMENT_STATUS_COMPLETED;
93
- }
94
- public function transfert(){
95
- //if($this->canTransfert()) {
96
- $translations = $this->getTranslations();
97
- Mage::getSingleton('catalog/product_action')->updateAttributes(array($this->getProductId()), $translations, $this->getProject()->getStoreIdTranslation());
98
- //}
99
- return $this;
100
- }
101
-
102
- public function getStatusTexte() {
103
- // Mage::
104
- $statuses = array (
105
- 'in_creation' => Mage::helper ( 'textmaster' )->__ ( 'In creation' ),
106
- 'waiting_assignment' => Mage::helper ( 'textmaster' )->__ ( 'Waiting assignment' ),
107
- 'in_progress' => Mage::helper ( 'textmaster' )->__ ( 'In progress' ),
108
- 'in_review' => Mage::helper ( 'textmaster' )->__ ( 'In review' ),
109
- 'completed' => Mage::helper ( 'textmaster' )->__ ( 'Completed' ),
110
- 'incomplete' => Mage::helper ( 'textmaster' )->__ ( 'Incomplete' ),
111
- 'paused' => Mage::helper ( 'textmaster' )->__ ( 'Paused' ),
112
- 'canceled' => Mage::helper ( 'textmaster' )->__ ( 'Cancelled' ),
113
- 'copyscape' => Mage::helper ( 'textmaster' )->__ ( 'Copyscape' ),
114
- 'counting_words' => Mage::helper ( 'textmaster' )->__ ( 'Counting words' ),
115
- 'quality_control' => Mage::helper ( 'textmaster' )->__ ( 'Quality control' )
116
- );
117
- if (isset ( $statuses [parent::getStatus ()] ))
118
- return $statuses [parent::getStatus ()];
119
- return $this->getStatus ();
120
- }
121
-
122
-
123
- public function delete(){
124
- if($this->getProject() && $this->getProject()->getProjectApiid()!='' && $this->getDocumentApiId()!=''){
125
- Mage::helper('textmaster')->getApi()->deleteDocument($this->getProject()->getProjectApiid(),$this->getDocumentApiId());
126
- }
127
- return parent::delete();
128
- }
129
-
130
- public function load($id, $field = null,$api = true,$project_api=true) {
131
- $return = parent::load ( $id, $field = null );
132
- $project_api = $project_api && $api;
133
-
134
- $this->setProject(Mage::getModel('textmaster/project')->load($this->getTextmasterProjectId(),null,$project_api));
135
-
136
- if($api && $this->getProject() && $this->getDocumentApiId()!='' && $this->getProject()->getProjectApiid()!='') {
137
- $data_api = Mage::helper('textmaster')->getApi()->getDocument($this->getProject()->getProjectApiid(),$this->getDocumentApiId());
138
- $this->setStatus($data_api['status']);
139
- if(isset($data_api['author_work']))
140
- $this->setTranslations($data_api['author_work']);
141
- }
142
- return $return;
143
- }
144
- public function loadByApiId($api_id) {
145
- $documentId = $this->getResource()->loadByApiId($api_id);
146
-
147
- if ($documentId) {
148
- $this->load($documentId);
149
- } else {
150
- $this->setData(array());
151
- }
152
- return $this;
153
- }
154
- public function getSupportMessages(){
155
- if($this->_support_message) return $this->_support_message;
156
- $this->_support_message = Mage::helper('textmaster')->getApi()->getSupportMessages($this->getProject()->getProjectApiid(),$this->getDocumentApiId());
157
- return $this->_support_message;
158
- }
159
-
160
- public function prepareData(){
161
- $data = $this->getData ();
162
- $data ['title'] = $data ['name'];
163
- $data ['type'] = 'key_value';
164
- unset ( $data ['name'] );
165
-
166
- $attributes = Mage::getModel ( 'textmaster/project_attribute' )->getCollection ()->addFieldToFilter ( 'textmaster_project_id', $this->getTextmasterProjectId () );
167
- $product = Mage::getModel ( 'catalog/product' )->setStoreId( $this->getProject()->getStoreIdOrigin() )->load ( $this->getProductId () );
168
- $data ['original_content'] = array ();
169
- $data['markup_in_content'] = false;
170
- $text = '';
171
- foreach ( $attributes as $attr ) {
172
- $attribute = Mage::getModel ( 'catalog/resource_eav_attribute' )->load ( $attr->getTextmasterAttributeId () );
173
- $text_attr = $product->getData ( $attribute->getName () );
174
- $text .= $text_attr . ' ';
175
- if (! empty ( $text_attr )){
176
- $data ['original_content'] [$attribute->getName ()] = array (
177
- 'original_phrase' => $text_attr
178
- );
179
- if(strip_tags($text_attr) != $text_attr){
180
- $data['markup_in_content'] = true;
181
- }
182
- }
183
- }
184
-
185
- $data ['word_count'] = Mage::helper ( 'textmaster' )->countWord ( $text );
186
- $data ['word_count_rule'] = 1;
187
- $data ['instructions'] = '';
188
- $data ['keyword_list'] = '';
189
- $data ['keywords_repeat_count'] = 0;
190
- $data ['id_product'] = $this->getProductId ();
191
-
192
- if(isset( $data ['_project'])) unset ( $data ['_project'] );
193
- unset ( $data ['send'] );
194
- unset ( $data ['counted'] );
195
- unset ( $data ['textmaster_document_id'] );
196
- unset ( $data ['product_id'] );
197
- unset ( $data ['updated_at'] );
198
- unset ( $data ['textmaster_project_id'] );
199
- unset ( $data ['created_at'] );
200
- unset ( $data ['document_api_id'] );
201
- unset ( $data ['original_content'] ['image'] );
202
-
203
- return $data;
204
- }
205
-
206
- public function updateApiData($message){
207
- $data = $this->prepareData();
208
-
209
- $project = Mage::getModel ( 'textmaster/project' )->load ( $this->getTextmasterProjectId (), null, false );
210
-
211
- $result = Mage::helper('textmaster')->getApi()->updateDocument ( $project->getProjectApiid (),$this->getProjectApiId(), $data );
212
-
213
- }
214
-
215
-
216
- public function setProject($project){
217
- $this->_project = $project;
218
- return $this;
219
- }
220
-
221
- public function getProject(){
222
- return $this->_project;
223
- }
224
- public function getProduct(){
225
- if($this->_product) return $this->_product;
226
- if(!$this->getProject()){
227
- $this->_project = Mage::getModel('textmaster/projet')->load($this->getTextmasterProjectId(),null,false);
228
- }
229
- $this->_product = Mage::getModel('catalog/product')->setStoreId( $this->getProject()->getStoreIdOrigin())->load($this->getProductId());
230
- return $this->_product;
231
- }
232
- public function getTranslations(){
233
- $all_translations = Mage::getSingleton('adminhtml/session')->getTextmasterTranslations();
234
- if(isset($all_translations[$this->getId()])) return $all_translations[$this->getId()];
235
-
236
- $translations = $this->getData('translations');
237
- if($translations == null){
238
- $this->load($this->getId());
239
- }
240
-
241
- if($all_translations!=null){
242
- $all_translations[$this->getId()] = $translations;
243
- } else {
244
- $all_translations = array($this->getId()=>$translations);
245
- }
246
- if($this->canComplete())
247
- Mage::getSingleton('adminhtml/session')->setTextmasterTranslations($all_translations);
248
-
249
- return $all_translations[$this->getId()];
250
- }
251
- public function revision($message){
252
- $all_translations = Mage::getSingleton('adminhtml/session')->getTextmasterTranslations();
253
- if(isset($all_translations[$this->getId()])){
254
- unset($all_translations[$this->getId()]);
255
- Mage::getSingleton('adminhtml/session')->setTextmasterTranslations($all_translations);
256
- }
257
- //if($this->canComplete()){
258
- $data = $this->prepareData();
259
- $result = Mage::helper('textmaster')->getApi()->commentDocument( $this->getProject()->getProjectApiid (),$this->getDocumentApiId(),$message );
260
- if ( isset ( $result ['error'] )) {
261
- Mage::getSingleton('adminhtml/session')->addError($this->getName().' '.$result['error']);
262
- }
263
- //}
264
- }
265
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Mysql4/Document.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Mysql4_Document extends Mage_Core_Model_Mysql4_Abstract
27
- {
28
- public function _construct()
29
- {
30
- $this->_init('textmaster/document', 'textmaster_document_id');
31
- // $this->setEntityIdField('textmaster_document_id');
32
- }
33
-
34
- public function loadByApiId($api_id) {
35
- $adapter = $this->_getReadAdapter();
36
- $bind = array('api_id' => $api_id);
37
- $select = $adapter->select()
38
- ->from($this->getTable('document'))
39
- ->where('document_api_id = :api_id');
40
-
41
- $documentId = $adapter->fetchOne($select, $bind);
42
- return $documentId;
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Mysql4/Document/Collection.php DELETED
@@ -1,182 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Mysql4_document_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
27
-
28
- private $_load_api = false;
29
- private $_project_api_id = false;
30
- private $_filters_api = array();
31
- private $_filters_standard = array();
32
- private $_subsitute = array(
33
- 'name' => 'title',
34
- 'reference' => 'ref',
35
- 'status' => 'status',
36
- );
37
-
38
- public function addFiltersApi($filters){
39
- $this->_filters_api = array_merge($this->_filters_api,$filters);
40
-
41
- }
42
-
43
- public function addFiltersStandard($filters){
44
- $this->_filters_standard = array_merge($this->_filters_standard,$filters);
45
- }
46
-
47
- public function _construct() {
48
- parent::_construct ();
49
- $this->_init ( 'textmaster/document' );
50
- }
51
- /*protected function _beforeLoad() {
52
-
53
- }*/
54
- public function load($printQuery = false, $logQuery = false)
55
- {
56
- if(!$this->_load_api){
57
- return parent::load($printQuery,$logQuery);
58
- }
59
- if(!$this->_project_api_id){
60
- return parent::load($printQuery,$logQuery);
61
- }
62
- if ($this->isLoaded()) {
63
- return $this;
64
- }
65
-
66
-
67
- $this->_renderOrders()
68
- ->_renderLimit();
69
-
70
- $this->_beforeLoad();
71
-
72
- $_api = Mage::helper('textmaster')->getApi();
73
- $this->documents_api_result = $_api->getDocuments($this->_project_api_id,array('where'=>$this->_filters_api),array($this->_end ,$this->_start),isset($this->_order)?array($this->_order,$this->_sens):array('ref','asc'));
74
-
75
- $this->printLogQuery($printQuery, $logQuery);
76
- $data = $this->getData();
77
- $this->resetData();
78
- $this->_totalRecords = $this->documents_api_result['count'];
79
- if (is_array($data) && isset($this->documents_api_result['documents'])) {
80
- foreach($this->documents_api_result['documents'] as $doc){
81
- foreach ($data as $row) {
82
- if($doc['id']==$row['document_api_id']){
83
- $item = $this->getNewEmptyItem();
84
- if ($this->getIdFieldName()) {
85
- $item->setIdFieldName($this->getIdFieldName());
86
- }
87
- $item->addData($row);
88
- $item->setAuthor($doc['author_id']);
89
- $item->setName($doc['title']);
90
- $item->setType($doc['ctype']);
91
- $item->setStatus($doc['status']);
92
- $item->setReference($doc['reference']);
93
- $this->addItem($item);
94
- }
95
- }
96
- }
97
- }
98
-
99
- $this->_setIsLoaded();
100
- $this->_afterLoad();
101
- return $this;
102
- }
103
-
104
- protected function __afterLoad() {
105
- if($this->_load_api && $this->documents_api_result){
106
- $i=0;
107
- foreach ( $this->_items as $k=>$item ) {
108
- $exist = false;
109
- foreach($this->documents_api_result['documents'] as $doc){
110
- if($doc['id']==$item->getDocumentApiId()){
111
- $item->setAuthor($doc['author_id']);
112
- $item->setType($doc['ctype']);
113
- $item->setStatus($doc['status']);
114
- $item->setReference($doc['reference']);
115
- $i++;
116
- $exist = true;
117
- break;
118
- }
119
- }
120
- if(!$exist) {
121
- if (is_null($this->_totalRecords)) {
122
- $this->getSize();
123
- }
124
- $this->_totalRecords--;
125
- }
126
- if($i>($this->getCurPage()-1)*$this->_pageSize && $i<=($this->getCurPage()+0)*$this->_pageSize){
127
- } else {
128
- $exist = false;
129
- }
130
- if(!$exist) {
131
- unset($this->_items[$k]);
132
- }
133
- }
134
- //Mage ::log('count : '. count($this->_items));
135
- }
136
- }
137
- /*public function getSize(){
138
- return count($this->_items);
139
- }*/
140
-
141
- protected function _renderOrders()
142
- {
143
-
144
- if (!$this->_isOrdersRendered) {
145
- foreach ($this->_orders as $field => $direction) {
146
- //$this->_select->order(new Zend_Db_Expr($field . ' ' . $direction));
147
- if(isset($this->_subsitute[$field])) {
148
- $this->_order = $this->_subsitute[$field];
149
- $this->_sens = strtolower($direction);
150
- $this->_isOrdersRendered = true;
151
- return $this;
152
- }
153
- }
154
- }
155
- return $this;
156
- }
157
- protected function _renderLimit()
158
- {
159
- if($this->_pageSize){
160
- //$this->_select->limitPage($this->getCurPage(), $this->_pageSize);
161
- $page = $this->_curPage ;
162
- $rowCount = $this->_pageSize;
163
- $page = ($page > 0) ? $page : 1;
164
- $rowCount = ($rowCount > 0) ? $rowCount : 1;
165
- $this->_start = (int) $rowCount;
166
- $this->_end = $page;
167
- }
168
- return $this;
169
- }
170
-
171
- public function setLoadApi($value){
172
- $this->_load_api = $value;
173
- return $this;
174
- }
175
- public function setProjectApiId($value){
176
- $this->_project_api_id = $value;
177
- return $this;
178
- }
179
- public function getSubstitute(){
180
- return $this->_subsitute;
181
- }
182
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Mysql4/Project.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Mysql4_Project extends Mage_Core_Model_Mysql4_Abstract
27
- {
28
- public function _construct()
29
- {
30
- $this->_init('textmaster/project', 'textmaster_project_id');
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Mysql4/Project/Attribute.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Mysql4_Project_Attribute extends Mage_Core_Model_Mysql4_Abstract
27
- {
28
- public function _construct()
29
- {
30
- $this->_init('textmaster/project_attribute', 'textmaster_project_attribute_id');
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Mysql4/Project/Attribute/Collection.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Mysql4_Project_Attribute_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
27
-
28
- public function _construct() {
29
- parent::_construct ();
30
- $this->_init ( 'textmaster/project_attribute' );
31
- }
32
-
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Mysql4/Project/Collection.php DELETED
@@ -1,323 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Mysql4_Project_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
27
- private $_api_loaded = false;
28
- private $_all_project = false;
29
- private $_api = null;
30
- private $_filters_api = array();
31
- private $_filters_standard = array();
32
-
33
- private $_subsitute = array(
34
- 'name' => 'name',
35
- 'reference' => 'ref',
36
- 'progression' => 'progress',
37
- 'level' => 'level_name',
38
- 'store_id_origin' => 'language_from_code',
39
- 'store_id_translation' => 'language_to_code',
40
- 'nb_document' => 'cached_documents_count',
41
- 'total_word_count' => 'total_word_count',
42
- 'price' => 'pricing.total_cost_at_launch_time',
43
- 'updated_at' => 'updated_at',
44
- 'status' => 'status',
45
- );
46
-
47
- public function _construct() {
48
- parent::_construct ();
49
- $this->_init ( 'textmaster/project' );
50
- }
51
-
52
- public function addFiltersApi($filters){
53
- $this->_filters_api = array_merge($this->_filters_api,$filters);
54
- return $this;
55
- }
56
-
57
- public function addFiltersStandard($filters){
58
- $this->_filters_standard = array_merge($this->_filters_standard,$filters);
59
- return $this;
60
- }
61
- protected function _beforeLoad() {
62
-
63
- }
64
- public function load($printQuery = false, $logQuery = false) {
65
-
66
- if ($this->isLoaded()) {
67
- return $this;
68
- }
69
-
70
- if (! $this->_api_loaded) {
71
- $this->_api_loaded = true;
72
- $this->_api = Mage::helper('textmaster')->getApi();
73
- }
74
-
75
- $this->_beforeLoad();
76
-
77
- $this->_renderOrders()
78
- ->_renderLimit();
79
-
80
- $this->data_api = $this->_api->getProjects(
81
- false,
82
- array('where' => $this->_filters_api),
83
- isset($this->_end) && isset($this->_start) ? array($this->_end, $this->_start) : array(0, 20),
84
- isset($this->_order) ? array($this->_order, $this->_sens) : array('updated_at','desc')
85
- );
86
-
87
- if(isset($this->data_api['projects'])){
88
- $this->_totalRecords = $this->data_api['count'];
89
- $result = array();
90
- foreach ($this->data_api['projects'] as $_api_project){
91
- $item = $this->getNewEmptyItem();
92
- $item->loadByApiData($_api_project);
93
- $this->addItem($item);
94
- }
95
- }
96
-
97
- $this->_setIsLoaded();
98
- $this->_afterLoad();
99
-
100
- return $this;
101
- }
102
- public function getSize()
103
- {
104
- return intval($this->_totalRecords);
105
- }
106
-
107
-
108
-
109
- public function addItem(Varien_Object $item)
110
- {
111
-
112
- $this->_addItem($item);
113
-
114
- return $this;
115
- }
116
-
117
- protected function __afterLoad() {
118
- parent::_afterLoad ();
119
- if (! $this->_api_loaded) {
120
- $this->_api_loaded = true;
121
- $this->_api = Mage::helper('textmaster')->getApi();
122
- $data_api = $this->_api->getProjects (false,array('where'=>$this->_filters_api) );
123
-
124
- }
125
- $locale = Mage::app()->getLocale();
126
-
127
- $resource = Mage::getSingleton('core/resource');
128
- $tabledocument = $resource->getTableName('textmaster_document');
129
- $readConnection = $resource->getConnection('core_read');
130
- $i=0;
131
- $order = $this->getSelect()->getPart('order');
132
-
133
- if(isset($order[0])){
134
- if(strpos((string)$order[0],'progression')!==false){
135
- if(strpos((string)$order[0],'ASC')!==false){
136
- usort($this->_items,array($this,'callbackSortByProgressionAsc'));
137
- } else {
138
- usort($this->_items,array($this,'callbackSortByProgressionDesc'));
139
- }
140
- }
141
- if(strpos((string)$order[0],'price')!==false){
142
- if(strpos((string)$order[0],'ASC')!==false){
143
- usort($this->_items,array($this,'callbackSortByPriceAsc'));
144
- } else {
145
- usort($this->_items,array($this,'callbackSortByPriceDesc'));
146
- }
147
- }
148
- if(strpos((string)$order[0],'total_word_count')!==false){
149
- if(strpos((string)$order[0],'ASC')!==false){
150
- usort($this->_items,array($this,'callbackSortByWordAsc'));
151
- } else {
152
- usort($this->_items,array($this,'callbackSortByWordDesc'));
153
- }
154
- }
155
- if(strpos((string)$order[0],'reference')!==false){
156
- if(strpos((string)$order[0],'ASC')!==false){
157
- usort($this->_items,array($this,'callbackSortByRefAsc'));
158
- } else {
159
- usort($this->_items,array($this,'callbackSortByRefDesc'));
160
- }
161
- }if(strpos((string)$order[0],'level')!==false){
162
- if(strpos((string)$order[0],'ASC')!==false){
163
- usort($this->_items,array($this,'callbackSortByLevelAsc'));
164
- } else {
165
- usort($this->_items,array($this,'callbackSortByLevelDesc'));
166
- }
167
- }
168
- }
169
- foreach ( $this->_items as $k=>&$item ) {
170
- $exist = false;
171
- if(isset($data_api['projects'])){
172
- foreach($data_api['projects'] as $data){
173
- if($data['id']==$item->getProjectApiid()){
174
- $exist = true;
175
- $i++;
176
- $item->setReference($data['reference']);
177
- if($data['status']!=$item->getStatus()) {
178
- $item->setStatus($data['status']);
179
- //$item->save();
180
- } else {
181
- $item->setStatus($data['status']);
182
- }
183
- $item->setTotalWordCount($data['total_word_count']);
184
- if(isset($data['total_costs'][0]['amount'])){
185
- $item->setPrice($data['total_costs'][0]['amount']);
186
- $item->setCurrency($data['total_costs'][0]['currency']);
187
- }
188
- elseif(isset($data['cost_in_currency']['amount'])) {
189
- $item->setPrice($data['cost_in_currency']['amount']);
190
- $item->setCurrency($data['cost_in_currency']['currency']);
191
- }
192
- if(isset($data['progress']))
193
- $item->setProgression(round((float)$data['progress'],0).'%');
194
- else $item->setProgression('0%');
195
-
196
- $item->setLevel($data['options']['language_level']);
197
- $item->setUpdatedAt($data['updated_at']['full']);
198
-
199
-
200
- }
201
- }
202
- }
203
-
204
-
205
- foreach($this->_filters_standard as $key => $value){
206
- if(is_array($value)){
207
- if(isset($value['from'])){
208
- if($item->getData($key)<$value['from']) $exist = false;
209
- }
210
- if(isset($value['to'])){
211
- if($item->getData($key)>$value['to']) $exist = false;
212
- }
213
- } elseif($key=='progression') {
214
- $value = str_replace('%','',$value);
215
- if(strpos($item->getData($key),$value)===false) $exist = false;
216
- } else {
217
- if(strpos($item->getData($key),$value)===false) $exist = false;
218
- }
219
- }
220
- if(!$exist) {
221
- if (is_null($this->_totalRecords)) {
222
- $this->getSize();
223
- }
224
- $this->_totalRecords--;
225
- }
226
- if($i>($this->getCurPage()-1)*$this->_pageSize && $i<=($this->getCurPage()+0)*$this->_pageSize){
227
- } else {
228
- $exist = false;
229
- }
230
-
231
- if(!$exist ){
232
- $item->setIn(false);
233
- if(!$this->_all_project) {
234
- $this->removeItemByKey($k);
235
- }
236
- } else {
237
- $item->setIn(true);
238
- }
239
-
240
- //$item->setReference ( 'TEST2' );
241
- }
242
-
243
- //if($this->getOrder())
244
- return $this;
245
- }
246
- /*public function getSize(){
247
- return count($this->_items);
248
- }*/
249
-
250
- public function callbackSortByProgressionAsc($a,$b){
251
- return $a->getProgression()>$b->getProgression();
252
- }
253
-
254
- public function callbackSortByProgressionDesc($a,$b){
255
- return $a->getProgression()<$b->getProgression();
256
- }
257
-
258
- public function callbackSortByPriceAsc($a,$b){
259
- return $a->getPrice()>$b->getPrice();
260
- }
261
-
262
- public function callbackSortByPriceDesc($a,$b){
263
- return $a->getPrice()<$b->getPrice();
264
- }
265
- public function callbackSortByWordAsc($a,$b){
266
- return $a->getTotalWordCount()>$b->getTotalWordCount();
267
- }
268
-
269
- public function callbackSortByWordDesc($a,$b){
270
- return $a->getTotalWordCount()<$b->getTotalWordCount();
271
- }
272
- public function callbackSortByRefAsc($a,$b){
273
- return $a->getTotalReferenceCount()>$b->getTotalReferenceCount();
274
- }
275
-
276
- public function callbackSortByRefDesc($a,$b){
277
- return $a->getTotalReferenceCount()<$b->getTotalReferenceCount();
278
- }
279
- public function callbackSortByLevelAsc($a,$b){
280
- return $a->getLevel()>$b->getLevel();
281
- }
282
-
283
- public function callbackSortByLevelDesc($a,$b){
284
- return $a->getLevel()<$b->getLevel();
285
- }
286
- protected function _renderLimit()
287
- {
288
- if($this->_pageSize){
289
- //$this->_select->limitPage($this->getCurPage(), $this->_pageSize);
290
- $page = $this->_curPage ;
291
- $rowCount = $this->_pageSize;
292
- $page = ($page > 0) ? $page : 1;
293
- $rowCount = ($rowCount > 0) ? $rowCount : 1;
294
- $this->_start = (int) $rowCount;
295
- $this->_end = $page;
296
- }
297
- return $this;
298
- }
299
- protected function _renderOrders()
300
- {
301
-
302
- if (!$this->_isOrdersRendered) {
303
- foreach ($this->_orders as $field => $direction) {
304
- //$this->_select->order(new Zend_Db_Expr($field . ' ' . $direction));
305
- if(isset($this->_subsitute[$field])) {
306
- $this->_order = $this->_subsitute[$field];
307
- $this->_sens = strtolower($direction);
308
- $this->_isOrdersRendered = true;
309
- return $this;
310
- }
311
- }
312
- }
313
- return $this;
314
- }
315
-
316
- public function setAllProject($val){
317
- $this->_all_project = $val;
318
- return $this;
319
- }
320
- public function getSubstitute(){
321
- return $this->_subsitute;
322
- }
323
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Observer.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Observer extends Mage_Core_Model_Abstract {
27
-
28
- public function _productCreateBlock(Varien_Event_Observer $observer) {
29
-
30
- $action = Mage::app()->getRequest()->getRequestedActionName();
31
- $block = $observer->getEvent()->getBlock();
32
- if ($block->getNameInLayout() == 'root') {
33
- if (Mage::app()->getRequest()->getControllerName() == 'catalog_product' ) {
34
-
35
- $extendBlock = new Mage_Core_Block_Template();
36
- $extendBlock->setTemplate('textmaster/product/edit.phtml');
37
- $extendBlock->setIsAnonymous(true);
38
- if ($extendBlock) {
39
- $block->getChild('content')->insert($extendBlock, '', false, 'TM_Translate_form');
40
- }
41
- //return $block;
42
- }
43
- }
44
- }
45
-
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Project.php DELETED
@@ -1,809 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Project extends Mage_Core_Model_Abstract {
27
-
28
-
29
- const PROJECT_CTYPE_COPYWRITING = "copywriting";
30
- const PROJECT_CTYPE_TRANSLATION = "translation";
31
- const PROJECT_CTYPE_PROOFREADING = "proofreading";
32
-
33
- const PROJECT_LANGUAGE_LEVEL_REGULAR = "regular";
34
- const PROJECT_LANGUAGE_LEVEL_PREMIUM = "premium";
35
- const PROJECT_LANGUAGE_LEVEL_ENTERPRISE = "enterprise";
36
-
37
- const PROJECT_STATUS_IN_LAUNCH_PROCESSING = "in_launch_processing";
38
- const PROJECT_STATUS_IN_CREATION = "in_creation";
39
- const PROJECT_STATUS_IN_PROGRESS = "in_progress";
40
- const PROJECT_STATUS_IN_REVIEW = "in_review";
41
- const PROJECT_STATUS_CANCEL = "canceled";
42
- const PROJECT_STATUS_COMPLETED = "completed";
43
- const PROJECT_STATUS_PAUSED = "paused";
44
-
45
- const PROJECT_TM_STATUS_IN_PROGRESS = "in_progress";
46
- const PROJECT_TM_STATUS_COMPLETED = "completed";
47
-
48
- private $_store_name_origin = false;
49
- private $_store_name_translation = false;
50
- private $_api_loaded = false;
51
- private $_load_api = true;
52
- private $_api = null;
53
- private $_products_id = false;
54
- private $_nb_author = 0;
55
- private $_authors = array();
56
- public $_before_save_api = true;
57
- private $_project_loaded = true;
58
-
59
- public function _construct() {
60
- parent::_construct ();
61
- $this->_init ( 'textmaster/project' );
62
- }
63
- public function setBeforeSaveApi($val){
64
- $this->_before_save_api = $val;
65
- }
66
- public function getBeforeSaveApi($val){
67
- return $this->_before_save_api;
68
- }
69
-
70
- public function getStoreNameOrigin() {
71
- if ($this->_store_name_origin)
72
- return $this->_store_name_origin;
73
- $store = Mage::getModel ( 'core/store' )->load ( $this->getStoreIdOrigin () );
74
- $this->_store_name_origin = $store->getWebsite()->getName().' - '.$store->getName ();
75
- return $this->_store_name_origin;
76
-
77
- /* AFFICHE la langue du STORE au lieu du nom
78
- * $localecode = Mage::getStoreConfig('general/locale/code', $this->getStoreIdOrigin ());
79
- $data = explode('_', $localecode);
80
- $localeAdmin = Mage::app()->getLocale();
81
- $tmp = $localeAdmin->getTranslation($data[0], 'language', $localeAdmin);
82
-
83
- $tmp = ucwords($tmp);
84
- $this->_store_name_origin = $tmp;
85
-
86
- return $this->_store_name_origin;*/
87
- }
88
- public function getStoreOriginLangCode(){
89
- $localecode = Mage::getStoreConfig('general/locale/code', $this->getStoreIdOrigin ());
90
- $data = explode('_', $localecode);
91
- return $data[0];
92
- }
93
- public function getStoreTranslationLangCode(){
94
- $localecode = Mage::getStoreConfig('general/locale/code', $this->getStoreIdTranslation ());
95
- $data = explode('_', $localecode);
96
- return $data[0];
97
- }
98
-
99
-
100
- public function getStoreNameTranslation() {
101
- if ($this->_store_name_translation)
102
- return $this->_store_name_translation;
103
- $store = Mage::getModel ( 'core/store' )->load ( $this->getStoreIdTranslation () );
104
- $this->_store_name_translation = $store->getWebsite()->getName().' - '.$store->getName ();
105
- return $this->_store_name_translation;
106
-
107
- /* AFFICHE la langue du STORE au lieu du nom
108
- * $localecode = Mage::getStoreConfig('general/locale/code', $this->getStoreIdTranslation ());
109
- $locale = new Zend_Locale($localecode);
110
- $data = explode('_', $localecode);
111
- $tmp = $locale->getTranslation($data[0], 'language', $locale);
112
-
113
- $tmp = ucwords($tmp);
114
- $this->_store_name_translation = $tmp;
115
-
116
- return $this->_store_name_translation;*/
117
- }
118
-
119
- public function load($id, $field = null, $api = true) {
120
- $this->_load_api = $api;
121
-
122
- $return = parent::load ( $id, $field = null );
123
- if($this->getTextmasters()!='') {
124
- $textmaster = $this->getTextmasters();
125
- if(!is_array($textmaster)){
126
- $serializeData = @unserialize($textmaster);
127
- if($serializeData)
128
- $this->setTextmasters($serializeData);
129
- else
130
- $this->setTextmasters(null);
131
- }
132
- }
133
-
134
-
135
- if($api && $this->getProjectApiid() && !$this->project_loaded) {
136
- $data_api = Mage::helper('textmaster')->getApi()->getProject($this->getProjectApiid());
137
- //Mage::log ( $data_api,null,'textmaster.log' );
138
- if(!isset($data_api['error'])){
139
- $this->project_loaded = true;
140
- if(isset($data_api['options']['language_level']))
141
- $this->setLanguageLevel($data_api['option_values']['language_level']);
142
- else
143
- $this->setLanguageLevel('regular');
144
- if(isset($data_api['reference']))
145
- $this->setReference( $data_api['reference'] );
146
-
147
- $this->setCategory($data_api['category']);
148
- $this->setCtype($data_api['ctype']);
149
- $this->setTemplate($data_api['work_template']['name']);
150
- $this->setSameAuthorMustDoEntireProject($data_api['same_author_must_do_entire_project']);
151
- $this->setVocabularyType($data_api['vocabulary_type']);
152
- $this->setGrammaticalPerson($data_api['grammatical_person']);
153
- $this->setTotalWordCount($data_api['total_word_count']);
154
- $this->setTargetReaderGroups($data_api['target_reader_groups']);
155
- $this->setStatus($data_api['status']);
156
- $this->setProjectBriefing($data_api['project_briefing']);
157
-
158
- if(isset($data_api['options']['specific_attachment']))
159
- $this->setSpecificAttachment($data_api['option_values']['specific_attachment']);
160
- else
161
- $this->setSpecificAttachment(0);
162
-
163
- if(isset($data_api['cost_in_currency'])){
164
- $this->setPrice($data_api['cost_in_currency']['amount']);
165
- $this->setCurrency($data_api['cost_in_currency']['currency']);
166
- } elseif(isset($data_api['total_costs']['0'])){
167
- $this->setPrice($data_api['total_costs']['0']['amount']);
168
- $this->setCurrency($data_api['total_costs']['0']['currency']);
169
- } else {
170
- $this->setPrice(0);
171
- }
172
- if(isset($data_api['options']['priority']))
173
- $this->setPriority($data_api['option_values']['priority']);
174
- else {
175
- $this->setPriority(0);
176
- }
177
- if(isset($data_api['options']['quality']))
178
- $this->setQuality($data_api['option_values']['quality']);
179
- else {
180
- $this->setQuality(0);
181
- }
182
- if(isset($data_api['options']['expertise']))
183
- $this->setExpertise($data_api['option_values']['expertise']);
184
- else {
185
- $this->setExpertise(0);
186
- }
187
- if(isset($data_api['options']['translation_memory']))
188
- $this->setTranslationMemory($data_api['option_values']['translation_memory']);
189
- if(isset($data_api['options']['negotiated_contract']))
190
- $this->setNegotiatedContract($data_api['option_values']['negotiated_contract']);
191
-
192
- //TODO
193
- $this->setIsmytextmaster(0);
194
- $this->setTextmasters($data_api['textmasters']);
195
-
196
- } else {
197
- throw new Exception('ERREUR chargement data API');
198
- }
199
- }
200
- return $return;
201
- }
202
-
203
- protected function _beforeSave(){
204
- if(!$this->_before_save_api){
205
- return parent::_beforeSave();
206
- }
207
- if (! $this->_api_loaded) {
208
- $this->_api = Mage::helper('textmaster')->getApi();
209
- }
210
- $data = $this->getData();
211
- /*if(isset($data['textmasters']) && isset($data['textmasters'][0]) && !strpos($data['textmasters'][0],',')!==false){
212
- $data['textmasters'] = explode(',',$data['textmasters'][0]);
213
-
214
- }*/
215
- if(isset($data['textmasters']) && is_array($data['textmasters']))
216
- $this->setTextmasters(serialize($data['textmasters']));
217
-
218
- //Create
219
- if(!$this->getId()){
220
-
221
- //unset($params['_documents']);
222
- foreach($data as $k=>$v){
223
- if(gettype($v)!='object')
224
- $params[$k]=$v;
225
- }
226
- $this->setTextmasterUser(Mage::getStoreConfig('textmaster/textmaster/api_key'));
227
- // $params['language_from'] = substr(Mage::getStoreConfig('general/locale/code',$params['store_id_origin']),0,2);
228
- $params['language_from'] = Mage::helper('textmaster')->getFormatedLangCode($params['store_id_origin']);
229
-
230
- if($params['ctype']!='translation')
231
- $params['store_id_translation'] = $params['store_id_origin'];
232
- // $params['language_to'] = substr(Mage::getStoreConfig('general/locale/code',$params['store_id_translation']),0,2);
233
- $params['language_to'] = Mage::helper('textmaster')->getFormatedLangCode($params['store_id_translation']);
234
-
235
- //Unset translation_memory from params data when create project
236
- if(isset($params['translation_memory']))
237
- unset($params['translation_memory']);
238
-
239
- /*if(!is_array($params['textmasters']) && !empty($params['textmasters']))
240
- $params['textmasters'] = explode(',',$params['textmasters']);*/
241
- $result = $this->_api->addProject($params);
242
- if(!isset($result['error'])){
243
- $this->setProjectApiid($result['id']);
244
- $this->setStatus($result['status']);
245
- } else {
246
- throw new Exception($result['error']);
247
- }
248
-
249
-
250
- } else {
251
- if($this->getStatus()==self::PROJECT_STATUS_IN_CREATION && !$this->getHasChangeMemoryStatus()){
252
- //$data = $this->getData();
253
-
254
- //unset($params['_documents']);
255
- foreach($data as $k=>$v){
256
- if(gettype($v)!='object')
257
- $params[$k]=$v;
258
- }
259
- $params['language_from'] = Mage::helper('textmaster')->getFormatedLangCode($params['store_id_origin']);
260
- $params['language_to'] = Mage::helper('textmaster')->getFormatedLangCode($params['store_id_translation']);
261
-
262
- //Unset translation_memory from params data when create project
263
- if(isset($params['translation_memory']))
264
- unset($params['translation_memory']);
265
-
266
- $result = $this->_api->updateProject($this->getProjectApiid(),$params);
267
- if(!isset($result['error'])){
268
- $this->setStatus($result['status']);
269
- } else {
270
- throw new Exception($result['error']);
271
- }
272
- }
273
- }
274
-
275
- return parent::_beforeSave();
276
- }
277
-
278
- public function startTranslationMemory(){
279
- if(
280
- $this->getStatus() == self::PROJECT_STATUS_IN_CREATION
281
- && $this->getTranslationMemory()
282
- && $this->getTranslationMemoryStatus() == ''
283
- ){
284
- if(!$this->_api_loaded) {
285
- $this->_api = Mage::helper('textmaster')->getApi();
286
- }
287
- $this->setTranslationMemoryStatus(self::PROJECT_TM_STATUS_IN_PROGRESS);
288
- $this->setHasChangeMemoryStatus(true);
289
- $params['translation_memory'] = $this->getTranslationMemory();
290
- $params['language_level'] = $this->getLanguageLevel();
291
- $params['quality'] = $this->getQuantity();
292
- $params['specific_attachment'] = $this->getSpecificAttachment();
293
- $params['priority'] = $this->getPriority();
294
- $params['same_author_must_do_entire_project'] = $this->getSameAuthorMustDoEntireProject();
295
- $result = $this->_api->updateProject($this->getProjectApiid(), $params);
296
- if(!isset($result['error'])){
297
- $this->setStatus($result['status']);
298
- $this->save();
299
- } else {
300
- throw new Exception($result['error']);
301
- }
302
- }
303
- }
304
-
305
- public function getStatusTexte(){
306
- //Mage::
307
- $statuses = array(
308
- 'in_creation' => Mage::helper('textmaster')->__('In creation'),
309
- 'waiting_assignment'=> Mage::helper('textmaster')->__('Waiting assignment'),
310
- 'in_progress' => Mage::helper('textmaster')->__('In progress'),
311
- 'in_review' => Mage::helper('textmaster')->__('In review'),
312
- 'completed' => Mage::helper('textmaster')->__('Completed'),
313
- 'incomplete' => Mage::helper('textmaster')->__('Incomplete'),
314
- 'paused' => Mage::helper('textmaster')->__('Paused'),
315
- 'canceled' => Mage::helper('textmaster')->__('Cancelled'),
316
- 'copyscape' => Mage::helper('textmaster')->__('Copyscape'),
317
- 'counting_words' => Mage::helper('textmaster')->__('Counting words'),
318
- 'quality_control' => Mage::helper('textmaster')->__('Quality control'));
319
- if(isset($statuses[parent::getStatus()])) return $statuses[parent::getStatus()];
320
- return $this->getStatus();
321
- }
322
- public function getStatuses(){
323
- $statuses = array(
324
- 'in_creation' => Mage::helper('textmaster')->__('In creation'),
325
- 'waiting_assignment'=> Mage::helper('textmaster')->__('Waiting assignment'),
326
- 'in_progress' => Mage::helper('textmaster')->__('In progress'),
327
- 'in_review' => Mage::helper('textmaster')->__('In review'),
328
- 'completed' => Mage::helper('textmaster')->__('Completed'),
329
- 'incomplete' => Mage::helper('textmaster')->__('Incomplete'),
330
- 'paused' => Mage::helper('textmaster')->__('Paused'),
331
- 'canceled' => Mage::helper('textmaster')->__('Cancelled'),
332
- 'copyscape' => Mage::helper('textmaster')->__('Copyscape'),
333
- 'counting_words' => Mage::helper('textmaster')->__('Counting words'),
334
- 'quality_control' => Mage::helper('textmaster')->__('Quality control'));
335
- return $statuses;
336
- }
337
-
338
- public function getPrice(){
339
- $currency = Mage::getModel('directory/currency')->load($this->getCurrency());
340
- return $currency->format($this->getData('price')/1000,array(),false);
341
- }
342
-
343
- public function getVocabularyTypeTexte(){
344
- if(!$this->_api){
345
- $this->_api = Mage::helper('textmaster')->getApi();
346
- }
347
- return Mage::helper ( 'textmaster' )->__ ($this->_api->getVocabularyLevel($this->getVocabularyType()));
348
- }
349
-
350
- public function getGrammaticalPersonTexte(){
351
- if(!$this->_api){
352
- $this->_api = Mage::helper('textmaster')->getApi();
353
- }
354
- return Mage::helper ( 'textmaster' )->__ ($this->_api->getGrammaticalPerson($this->getGrammaticalPerson()));
355
- }
356
-
357
- public function getLanguageLevelTexte(){
358
- if(!$this->_api){
359
- $this->_api = Mage::helper('textmaster')->getApi();
360
- }
361
- return Mage::helper ( 'textmaster' )->__ ($this->_api->getServiceLevel($this->getLanguageLevel()));
362
- }
363
-
364
- public function getCategoryTexte(){
365
- if(!$this->_api){
366
- $this->_api = Mage::helper('textmaster')->getApi();
367
- }
368
- return Mage::helper ( 'textmaster' )->__ ($this->_api->getCategory($this->getCategory()));
369
- }
370
-
371
- protected function _afterSave(){
372
- if(!$this->_before_save_api){
373
- return parent::_afterSave();
374
- }
375
- if($this->getTextmasters()!='') {
376
- $textmasters = $this->getTextmasters();
377
- if(is_array($textmasters))
378
- $this->setTextmasters(unserialize($this->getTextmasters()));
379
- }
380
- return parent::_afterSave();
381
- }
382
- public function saveTextmasters($textmasters){
383
- if($textmasters[0]=="aucun"){
384
- $textmasters= array();
385
- }
386
- $r = Mage::helper('textmaster')->getApi()->updateProjectTextmasters($this->getProjectApiid(),$textmasters);
387
- }
388
-
389
- public function setDocuments($documents){
390
- $this->_documents = $documents;
391
- }
392
-
393
- public function getDocuments(){
394
- if(!isset($this->_documents)){
395
- $this->_documents = Mage::getModel('textmaster/document')->getCollection()->setLoadApi($this->_api_loaded)->addFieldToFilter('textmaster_project_id',$this->getId());
396
-
397
- foreach($this->_documents as $doc){
398
- //$doc->get
399
- if(!isset($this->_authors[$doc->getAuthor()])){
400
- $this->_authors[$doc->getAuthor()] = $doc->getAuthor();
401
- }
402
- $doc->setProject($this);
403
- }
404
- }
405
- return $this->_documents;
406
- }
407
- public function getAuthor(){
408
- $this->getDocuments();
409
- return $this->_authors;
410
- }
411
- public function getMyAuthors(){
412
- return Mage::helper('textmaster')->getApi()->getMyAuthorsByProject($this->getProjectApiid());
413
- }
414
-
415
- public function getNbAuthor(){
416
- $this->getDocuments();
417
- return count($this->_authors);
418
- }
419
- public function getDocumentsNotSend(){
420
- if(isset($this->_documents_not_send)) return $this->_documents_not_send;
421
- $this->_documents_not_send = Mage::getModel('textmaster/document')->getCollection()->setLoadApi($this->_api_loaded)
422
- ->addFieldToFilter('textmaster_project_id',$this->getId())
423
- ->addFieldToFilter('send',0);
424
- foreach($this->_documents_not_send as $doc){
425
- $doc->setProject($this);
426
- }
427
-
428
- return $this->_documents_not_send;
429
- }
430
- public function getDocumentsNotCount(){
431
- if(isset($this->_documents_not_count)) return $this->_documents_not_count;
432
- $this->_documents_not_count = Mage::getModel('textmaster/document')->getCollection()->setLoadApi($this->_api_loaded)
433
- ->addFieldToFilter('textmaster_project_id',$this->getTextmasterProjectId())
434
- ->addFieldToFilter('counted',0);
435
- foreach($this->_documents_not_count as $doc){
436
- $doc->setProject($this);
437
- }
438
- return $this->_documents_not_count;
439
- }
440
- public function getDocumentsSendToCompleted(){
441
- if(isset($this->_documents_send_tocompleted)) return $this->_documents_send_tocompleted;
442
- $this->_documents_send_tocompleted = Mage::getModel('textmaster/document')->getCollection()->setLoadApi($this->_api_loaded)
443
- ->addFieldToFilter('textmaster_project_id',$this->getTextmasterProjectId())
444
- ->addFieldToFilter('encourscomplete',1)
445
- ->addFieldToFilter('sendforcomplete',1)
446
- ;
447
- foreach($this->_documents_send_tocompleted as $doc){
448
- $doc->setProject($this);
449
- }
450
- return $this->_documents_send_tocompleted;
451
- }
452
- public function getDocumentsSendNotCompleted(){
453
- if(isset($this->_documents_send_notcompleted)) return $this->_documents_send_notcompleted;
454
- $this->_documents_send_notcompleted = Mage::getModel('textmaster/document')->getCollection()->setLoadApi($this->_api_loaded)
455
- ->addFieldToFilter('textmaster_project_id',$this->getTextmasterProjectId())
456
- ->addFieldToFilter('encourscomplete',1)
457
- ->addFieldToFilter('sendforcomplete',1)
458
- ->addFieldToFilter('completed',0);
459
- foreach($this->_documents_send_notcompleted as $doc){
460
- $doc->setProject($this);
461
- }
462
-
463
- return $this->_documents_send_notcompleted;
464
- }
465
- public function getDocumentsCounted(){
466
- if(isset($this->_documents_completed)) return $this->_documents_completed;
467
- $this->_documents_completed = Mage::getModel('textmaster/document')->getCollection()->setLoadApi($this->_api_loaded)
468
- ->addFieldToFilter('textmaster_project_id',$this->getTextmasterProjectId())
469
- ->addFieldToFilter('counted',1);
470
- foreach($this->_documents_completed as $doc){
471
- $doc->setProject($this);
472
- }
473
-
474
- return $this->_documents_completed;
475
- }
476
- public function getLocalWordCount(){
477
- $docs = $this->getDocumentsCounted();
478
- $totalWordCount = 0;
479
- foreach ($docs as $doc) {
480
- $data = $doc->prepareData();
481
- $totalWordCount += $data['word_count'];
482
- }
483
- return $totalWordCount;
484
- }
485
- public function getDiffWordCount(){
486
- $externalWordCount = $this->getTotalWordCount();
487
- $localWordCount = $this->getLocalWordCount();
488
- if(($externalWordCount >= $localWordCount) or $localWordCount == 0)
489
- return 0;
490
- return $localWordCount-$externalWordCount;
491
- }
492
- public function sendDocuments(){
493
- if($this->hasDocumentsNotSend()){
494
- $nbDocumentToSend = Mage::getConfig()->getNode('adminhtml/api/documents/send/nb')->asArray();
495
- $i=0;
496
- $dataToSend = array();
497
- $documents = $this->getDocumentsNotSend();
498
- foreach ($documents as $document){
499
- if($nbDocumentToSend<=$i) break;
500
- $dataToSend[] = $document->prepareData();
501
- $i++;
502
- }
503
- $error = 0;
504
- $_api = Mage::helper('textmaster')->getApi();
505
- $result = $_api->addDocuments($this->getProjectApiid(),$dataToSend);
506
- $i=0;
507
- foreach ($documents as $k=>$document){
508
- if($nbDocumentToSend<=$i) break;
509
- if (! isset ( $result[$i]['error'] )) {
510
- $document->setDocumentApiId ( $result[$i] ['id'] );
511
- $document->setSend ( 1 );
512
- $document->save();
513
- } else {
514
- $error = 1;
515
- //$document->setStatus ( 'in_error' );
516
- $document->delete();
517
- }
518
- $i++;
519
- }
520
- }
521
- return $this;
522
- }
523
- public function hasDocumentsNotSend(){
524
- $docs = $this->getDocumentsNotSend();
525
- return count($docs)>0;
526
- }
527
-
528
- public function hasDocumentsNotCount(){
529
- // Est ce qu'un document n'a pas été compté
530
- $docs = $this->getDocumentsNotCount();
531
- return count($docs)>0;
532
- }
533
-
534
- public function getProductIds(){
535
- if($this->_products_id) return $this->_products_id;
536
- $this->_products_id = array();
537
- if(isset($this->_documents)){
538
- foreach($this->_documents as $document){
539
- $this->_products_id[] = $document->getProductId();
540
- }
541
- } else {
542
- $table = Mage::getSingleton('core/resource')->getTableName('textmaster_document');
543
- $results = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll("SELECT DISTINCT product_id FROM $table WHERE textmaster_project_id = ".$this->getId());
544
-
545
- foreach ($results as $result){
546
- $this->_products_id[] = $result['product_id'];
547
- }
548
- }
549
- return $this->_products_id;
550
- }
551
-
552
- public function getAttributes(){
553
- if(!isset($this->_attributes)){
554
- $this->_attributes = Mage::getModel('textmaster/project_attribute')->getCollection()->addFieldToFilter('textmaster_project_id',$this->getId());
555
- foreach($this->_attributes as $attribute){
556
- $attribute->setProject($this);
557
- }
558
- }
559
- return $this->_attributes;
560
- }
561
- public function getAttributesFull(){
562
- if(!isset($this->_attributes_full)){
563
-
564
- $this->_attributes_full = Mage::getModel('textmaster/project_attribute')->getCollection()->addFieldToFilter('textmaster_project_id',$this->getId());
565
- $this->_attributes_full->getSelect()->joinInner(array('attribute'=>Mage::getSingleton('core/resource')->getTableName('eav_attribute')),'main_table.textmaster_attribute_id = attribute.attribute_id');
566
- foreach($this->_attributes_full as $attribute){
567
- $attribute->setProject($this);
568
- }
569
- }
570
- return $this->_attributes_full;
571
- }
572
-
573
- public function canLaunch() {
574
- if($this->getStatus()==self::PROJECT_STATUS_IN_CREATION){
575
- $user_info = Mage::helper('textmaster')->getApi()->getUserInfo();
576
- if($user_info['wallet']['current_money']>=$this->getPrice()){
577
- return true;
578
- }
579
- return false;
580
- }
581
- return false;
582
- }
583
-
584
- public function delete(){
585
- foreach ($this->getDocuments() as $doc){
586
- $doc->delete();
587
- }
588
- foreach($this->getAttributes() as $attr){
589
- $attr->delete();
590
- }
591
- return parent::delete();
592
- }
593
-
594
- public function duplicate(){
595
- $newProject = Mage::getModel('textmaster/project');
596
- $data = $this->getData();
597
- if(isset($data['id'])){
598
- unset($data['id']);
599
- }
600
- if(isset($data['textmaster_project_id'])){
601
- unset($data['textmaster_project_id']);
602
- }
603
- if(isset($data['reference'])){
604
- unset($data['reference']);
605
- }
606
- if(isset($data['project_apiid'])){
607
- unset($data['project_apiid']);
608
- }
609
- $newProject->setData($data);
610
- $newProject->setBeforeSaveApi(false);
611
- $newProject->save();
612
- if($newProject->getId()) {
613
-
614
- $result = Mage::helper('textmaster')->getApi()->duplicateProject($this->getProjectApiid());
615
- if(isset($result['id'])) {
616
- $newProject->setProjectApiid($result['id']);
617
- $newProject->save();
618
- }
619
- }
620
-
621
-
622
-
623
- //return parent::delete();
624
- }
625
-
626
- public function launch(){
627
- if($this->canLaunch()) {
628
- $result = Mage::helper('textmaster')->getApi()->launchProject($this->getProjectApiid());
629
- if(!isset($result['error'])){
630
- Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
631
- $this->setStatus(self::PROJECT_STATUS_IN_LAUNCH_PROCESSING);
632
- $this->save();
633
- Mage::getSingleton('adminhtml/session')->addSuccess($this->getName().' '.Mage::helper('textmaster')->__('launched'));
634
- return true;
635
- } else {
636
- Mage::getSingleton('adminhtml/session')->addError($this->getName().' '.$result['error']);
637
- }
638
- }
639
- return false;
640
- }
641
-
642
- public function canPause() {
643
- return $this->getStatus()==self::PROJECT_STATUS_IN_PROGRESS;
644
- }
645
-
646
- public function pause(){
647
- //if($this->canPause()) {
648
- $result = Mage::helper('textmaster')->getApi()->pauseProject($this->getProjectApiid());
649
- if(!isset($result['error'])){
650
- $this->setStatus(self::PROJECT_STATUS_PAUSED);
651
- $this->save();
652
- Mage::getSingleton('adminhtml/session')->addSuccess($this->getName().' '.Mage::helper('textmaster')->__('paused'));
653
- } else {
654
- Mage::getSingleton('adminhtml/session')->addError($this->getName().' '.$result['error']);
655
- }
656
- //}
657
- }
658
-
659
- public function canResume() {
660
- return $this->getStatus()==self::PROJECT_STATUS_PAUSED;
661
- }
662
-
663
- public function resume(){
664
- //if($this->canResume()) {
665
- $result = Mage::helper('textmaster')->getApi()->resumeProject($this->getProjectApiid());
666
- if(!isset($result['error'])){
667
- $this->setStatus(self::PROJECT_STATUS_IN_PROGRESS);
668
- $this->save();
669
- Mage::getSingleton('adminhtml/session')->addSuccess($this->getName().' '.Mage::helper('textmaster')->__('resumed'));
670
- } else {
671
- Mage::getSingleton('adminhtml/session')->addError($this->getName().' '.$result['error']);
672
- }
673
- //}
674
- }
675
-
676
- public function canCancel() {
677
- return $this->getStatus()!=self::PROJECT_STATUS_IN_REVIEW && $this->getStatus()!=self::PROJECT_STATUS_COMPLETED;
678
- }
679
-
680
- public function cancel(){
681
- //if($this->canCancel()) {
682
- $result = Mage::helper('textmaster')->getApi()->cancelProject($this->getProjectApiid());
683
- if(!isset($result['error'])){
684
- $this->setStatus(self::PROJECT_STATUS_CANCEL);
685
- $this->save();
686
- Mage::getSingleton('adminhtml/session')->addSuccess($this->getName().' '.Mage::helper('textmaster')->__('canceled'));
687
- } else {
688
- Mage::getSingleton('adminhtml/session')->addError($this->getName().' '.$result['error']);
689
- }
690
- //}
691
- }
692
-
693
- public function canComplete() {
694
- if(isset($this->_canComplete)) return $this->_canComplete;
695
- $this->_canComplete = false;
696
- if($this->getStatus()==self::PROJECT_STATUS_IN_REVIEW) {
697
- $this->_canComplete = true;
698
- foreach($this->getDocuments() as $document){
699
- if($document->getStatus()!=Textmaster_Textmaster_Model_Document::DOCUMENT_STATUS_COMPLETED){
700
- $this->_canComplete = false;
701
- }
702
- }
703
- }
704
- return $this->_canComplete;
705
- }
706
-
707
- public function canTransfert(){
708
- if($this->getStatus()==self::PROJECT_STATUS_COMPLETED && $this->getDocumentTransfert()==0) {
709
-
710
- }
711
- }
712
- public function complete(){
713
- if($this->canComplete()) {
714
- $this->setStatus(self::PROJECT_STATUS_COMPLETED);
715
- $this->transfert();
716
- $this->save();
717
- Mage::getSingleton('adminhtml/session')->addSuccess($this->getName().' '.Mage::helper('textmaster')->__('completed'));
718
- }
719
- return $this;
720
- }
721
- public function transfert(){
722
- if($this->canTransfert()){
723
- foreach($this->getDocuments() as $doc){
724
- if($doc->canComplete()){
725
- $doc->complete();
726
- } elseif($doc->canTransfert()) {
727
- $doc->transfert();
728
- }
729
- }
730
- $this->setDocumentsTransfert(1);
731
- $this->setBeforeSaveApi(false);
732
- $this->save();
733
- }
734
- return $this;
735
- }
736
- /*
737
- * NON UTILISER
738
- * */
739
- public function getTranslation(){
740
- $documents = $this->getDocuments();
741
- $tr = array();
742
- foreach($documents as $document){
743
- $document->load($document->getId());
744
- $tr[$document->getProductId()] = $document->getTranslation();
745
- }
746
- return $tr;
747
- }
748
- public function loadByApiData($data){
749
- $_subsitute = array(
750
- 'name' => 'name',
751
- 'reference' => 'ref',
752
- 'progression' => 'progress',
753
- 'level' => 'level_name',
754
- 'store_id_origin' => 'language_from_code',
755
- 'store_id_translation' => 'language_to_code',
756
- 'nb_document' => 'cached_documents_count',
757
- 'total_word_count' => 'total_word_count',
758
- 'price' => 'pricing.total_cost_at_launch_time',
759
- 'updated_at' => 'updated_at',
760
- 'status' => 'status',
761
- );
762
- $_subsitute = array_flip($_subsitute);
763
- $this->_getResource()->load($this, $data['id'], 'project_apiid');
764
-
765
- if($this->getId()==0) {
766
- $this->setName($data['name']);
767
- $this->setData('store_id_origin',null) ;
768
- $this->setData('store_id_translation',null);
769
-
770
- }
771
-
772
- $this->setReference($data['reference']);
773
- if($data['status']!=$this->getStatus()) {
774
- $this->setStatus($data['status']);
775
- //$this->save();
776
- } else {
777
- $this->setStatus($data['status']);
778
- }
779
- //Nombre de document
780
-
781
- $nb_document = 0;
782
- if(isset($data['documents_statuses'])) {
783
- foreach ($data['documents_statuses'] as $nb) {
784
- $nb_document += $nb;
785
- }
786
- }
787
-
788
- $this->setNbDocument($nb_document);
789
- $this->setTotalWordCount($data['total_word_count']);
790
- if(isset($data['total_costs'][0]['amount'])){
791
- $this->setPrice($data['total_costs'][0]['amount']);
792
- $this->setCurrency($data['total_costs'][0]['currency']);
793
- }
794
- elseif(isset($data['cost_in_currency']['amount'])) {
795
- $this->setPrice($data['cost_in_currency']['amount']);
796
- $this->setCurrency($data['cost_in_currency']['currency']);
797
- }
798
- if(isset($data['progress']))
799
- $this->setProgression(round((float)($data['progress']*100),0).'%');
800
- else $this->setProgression('0%');
801
-
802
- if(isset($data['options']['language_level']))
803
- $this->setLevel($data['options']['language_level']);
804
-
805
- $this->setUpdatedAt($data['updated_at']['full']);
806
-
807
- }
808
-
809
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Project/Attribute.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Project_Attribute extends Mage_Core_Model_Abstract {
27
- public function _construct()
28
- {
29
- parent::_construct();
30
- $this->_init('textmaster/project_attribute');
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Audience.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Audience{
27
-
28
- public function toOptionArray()
29
- {
30
- $vocs = Mage::helper('textmaster')->getApi()->getAudiences();
31
- $aOptions = array();
32
- foreach ($vocs as $k=>$voc){
33
- $aOptions[] = array('value'=>$k, 'label'=>$voc);
34
- }
35
- return $aOptions ;
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Author.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Author{
27
-
28
- public function toOptionArray()
29
- {
30
- $_api = Mage::helper('textmaster')->getApi();
31
- $aOptions = array();
32
-
33
- if(!$_api->isUserConnected()) return $aOptions;
34
-
35
- $aAuthors = $_api->getAuthors();
36
- if(!isset($aAuthors['errors'])){
37
- foreach ($aAuthors['my_authors'] as $_item){
38
- $aOptions[] = array('value'=>$_item['author_id'], 'label'=>$_item['description'].' ('.$_item['author_ref'].')');
39
- }
40
- }
41
- return $aOptions;
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Category.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Category{
27
-
28
- public function toOptionArray()
29
- {
30
- $_api = Mage::helper('textmaster')->getApi();
31
- $aOptions = array();
32
-
33
- if(!$_api->isUserConnected()) return $aOptions;
34
-
35
- $aCategories = $_api->getCategories();
36
- foreach ($aCategories as $_item){
37
- $aOptions[] = array('value'=>$_item['code'], 'label'=>$_item['value']);
38
- }
39
- return $aOptions;
40
- }
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Grammatical.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Grammatical{
27
-
28
- public function toOptionArray()
29
- {
30
- $vocs = Mage::helper('textmaster')->getApi()->getGrammaticalPersons();
31
- $aOptions = array();
32
- foreach ($vocs as $k=>$voc){
33
- $aOptions[] = array('value'=>$k, 'label'=>$voc);
34
- }
35
- return $aOptions ;
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Lang.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Lang{
27
-
28
- public function toOptionArray()
29
- {
30
- $_api = Mage::helper('textmaster')->getApi();
31
- $aOptions = array();
32
-
33
- if(!$_api->isUserConnected()) return $aOptions;
34
-
35
- $aLanguages = $_api->getLanguages();
36
- foreach ($aLanguages as $_item){
37
- $aOptions[] = array('value'=>$_item['code'], 'label'=>$_item['value']);
38
- }
39
- return $aOptions;
40
- }
41
- public function toOptions(){
42
- Mage::getModel('core/store')->getCollection()->toOptionHash();
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Type.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Type{
27
-
28
- public function toOptionArray()
29
- {
30
-
31
- return array(
32
- 0 => array(
33
- 'value'=>'translate',
34
- 'label'=> Mage::helper('textmaster')->__('Translate'),
35
- ),
36
- 1 => array(
37
- 'value'=>'proofreading',
38
- 'label'=> Mage::helper('textmaster')->__('Proofreading'),
39
- )
40
- );
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/Model/Source/Api/Vocabulary.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Model_Source_Api_Vocabulary{
27
-
28
- public function toOptionArray()
29
- {
30
- $vocs = Mage::helper('textmaster')->getApi()->getVocabularyLevels();
31
- $aOptions = array();
32
- foreach ($vocs as $k=>$voc){
33
- $aOptions[] = array('value'=>$k, 'label'=>$voc);
34
- }
35
- return $aOptions ;
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/controllers/Adminhtml/Textmaster/AjaxController.php DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Adminhtml_Textmaster_AjaxController extends Mage_Adminhtml_Controller_action
27
- {
28
- protected function _isAllowed()
29
- {
30
- return true;
31
- }
32
-
33
- public function loginAction(){
34
-
35
- $_api = Mage::helper('textmaster')->getApi();
36
- $email = $this->getRequest()->getPost('login');
37
- $password = $this->getRequest()->getPost('password');
38
-
39
- Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
40
- Mage::getSingleton('adminhtml/session')->unsTextmasterMyAuthors();
41
- Mage::getSingleton('adminhtml/session')->unsTextmasterCategories();
42
- Mage::getSingleton('adminhtml/session')->unsTextmasterLanguages();
43
- Mage::getSingleton('adminhtml/session')->unsTextmasterPricings();
44
-
45
- $result = $_api->getAuth2Token($email,$password);
46
- $this->getResponse()->setHeader('Content-type', 'application/json');
47
-
48
-
49
- if (!isset($result['access_token'])){
50
- $html = Mage::helper('textmaster')->__('Wrong login / password');
51
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
52
- return;
53
- }
54
-
55
-
56
- $result = $_api->getAPIKeys($result['access_token']);
57
-
58
- if (!isset($result['api_info']['api_key']) || !isset($result['api_info']['api_secret'])) {
59
- Mage::log('Could not get API key / secret',null,'textmaster.log');
60
- $html = Mage::helper('textmaster')->__('Could not get API key / secret');
61
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
62
- return;
63
- }
64
-
65
- Mage::getConfig()->saveConfig('textmaster/textmaster/api_key',$result['api_info']['api_key']);
66
- Mage::getConfig()->saveConfig('textmaster/textmaster/api_secret',$result['api_info']['api_secret']);
67
- Mage::app()->cleanCache('config');
68
- $this->getResponse()->setBody( Mage::helper('core')->jsonEncode(array('html'=> '<div class="success" style="padding:2px 8px;background:#EFF5EA ;border:1px solid #95A486;color:#3D6611;font-weight:bold">'.Mage::helper('textmaster')->__('Connected to textmaster').'</div>')));
69
-
70
- }
71
- public function logoutAction(){
72
- Mage::getConfig()->saveConfig('textmaster/textmaster/api_key','');
73
- Mage::getConfig()->saveConfig('textmaster/textmaster/api_secret','');
74
- Mage::app()->cleanCache('config');
75
-
76
- Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
77
- Mage::getSingleton('adminhtml/session')->unsTextmasterMyAuthors();
78
-
79
- $this->getResponse()->setHeader('Content-type', 'application/json');
80
- }
81
-
82
- public function createAction(){
83
-
84
- $this->getResponse()->setHeader('Content-type', 'application/json');
85
- $_api = Mage::helper('textmaster')->getApi();
86
-
87
- $email = $this->getRequest()->getPost('login');
88
- $post = $this->getRequest()->getPost();
89
- $password = $this->getRequest()->getParam('password');
90
- $phone = $this->getRequest()->getParam('tel');
91
-
92
- Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
93
- Mage::getSingleton('adminhtml/session')->unsTextmasterMyAuthors();
94
-
95
- if (!Zend_Validate::is($email, 'EmailAddress')) {
96
- $html = Mage::helper('textmaster')->__('Email invalid');
97
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
98
- }
99
- if ($password == ''){
100
- $html = Mage::helper('textmaster')->__('Password mandatory');
101
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
102
- }
103
- if(isset($html)){
104
- return ;
105
- }
106
-
107
- $token = $_api->getAuth2TokenForCreation();
108
- if (!isset($token['access_token'])){
109
- $html = Mage::helper('textmaster')->__('Could not get access token');
110
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
111
- return;
112
- }
113
-
114
- //CREATION DU CLIENT
115
- $aUserInfo = $_api->createUser($token['access_token'], $email, $password,$phone?$phone:null);
116
- if (isset($aUserInfo['errors'])){
117
- $html = '';
118
- foreach ($aUserInfo['errors'] AS $key => $error)
119
- foreach ($error AS $error_key => $value)
120
- $html .= $key.' - '.$value.'<br/>';
121
- $html = '<div class="success" style="padding:2px 8px;background:#FFEEEE ;border:1px solid #FF9999;color:#CC0000;font-weight:bold">'.$html.'</div>';
122
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
123
- return;
124
- }
125
-
126
- if (!isset($aUserInfo['api_info']['api_key']) || !isset($aUserInfo['api_info']['api_secret'])) {
127
- Mage::log('Could not get API key / secret',null,'textmaster.log');
128
- $html = '<div class="success" style="padding:2px 8px;background:#FFEEEE ;border:1px solid #FF9999;color:#CC0000;font-weight:bold">'.Mage::helper('textmaster')->__('Could not get API key / secret').'</div>';
129
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('errors'=>$html)));
130
- return;
131
- }
132
- Mage::getModel('core/config')->saveConfig('textmaster/textmaster/api_key',$aUserInfo['api_info']['api_key']);
133
- Mage::getModel('core/config')->saveConfig('textmaster/textmaster/api_secret',$aUserInfo['api_info']['api_secret']);
134
- Mage::app()->cleanCache('config');
135
- $this->getResponse()->setBody( Mage::helper('core')->jsonEncode(array('html'=>'<div class="success" style="padding:2px 8px;background:#EFF5EA ;border:1px solid #95A486;color:#3D6611;font-weight:bold">'.Mage::helper('textmaster')->__('Your account has been successfully created.').'</div>')));
136
-
137
- }
138
-
139
- public function indexAction()
140
- {
141
- $this->loadLayout();
142
- $this->renderLayout();
143
- }
144
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/controllers/Adminhtml/Textmaster/ApiController.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Adminhtml_Textmaster_ApiController extends Mage_Core_Controller_Front_Action
27
- {
28
- protected function _isAllowed()
29
- {
30
- return true;
31
- }
32
-
33
- public function documentaddAction(){
34
- $projectId = $this->getRequest()->getParam('id');
35
- $project = Mage::getModel('textmaster/project')->load($projectId);
36
- $project->sendDocument();
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/controllers/Adminhtml/Textmaster/ProjectController.php DELETED
@@ -1,656 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_Adminhtml_Textmaster_ProjectController extends Mage_Adminhtml_Controller_Action
27
- {
28
- protected function _isAllowed()
29
- {
30
- return Mage::getSingleton('admin/session')->isAllowed('textmaster/projet');
31
- }
32
-
33
- protected function _initAction() {
34
- $this->loadLayout()
35
- ->_setActiveMenu('textmaster/project');
36
- return $this;
37
- }
38
-
39
- public function indexAction()
40
- {
41
- $api_key = Mage::getStoreConfig('textmaster/textmaster/api_key');;
42
- $api_secret = Mage::getStoreConfig('textmaster/textmaster/api_secret');
43
- $user = Mage::helper('textmaster')->getApi()->getUserInfo();
44
- if(!isset($user['email'])) {
45
- $this->_redirect('*/*/login');
46
- } else {
47
- $this->_initAction()->renderLayout();
48
- }
49
- }
50
- public function loginAction()
51
- {
52
- $this->_initAction()->renderLayout();
53
- }
54
-
55
-
56
- public function editAction()
57
- {
58
- /*$projectId = $this->getRequest()->getParam('id');
59
- $projectModel = Mage::getModel('textmaster/project')->load($projectId);*/
60
-
61
- if (/*$projectModel->getId() || $projectId == 0*/1)
62
- {
63
- $step = $this->getRequest()->getParam("step");
64
-
65
- //Mage::register('project_data', $projectModel);
66
- //$this->loadLayout();
67
- $this->_initAction();
68
-
69
-
70
- $ongletBlock = $this->getLayout()->createBlock('textmaster/adminhtml_project_onglets')->assign('step', $step);
71
- $ongletBlock->setTemplate('textmaster/onglet.phtml');
72
-
73
- $step1Block = $this->getLayout()->createBlock('textmaster/adminhtml_project_onglets_step1');
74
- $step2Block = $this->getLayout()->createBlock('textmaster/adminhtml_project_onglets_step2');
75
- $step3Block = $this->getLayout()->createBlock('textmaster/adminhtml_project_onglets_step3');
76
-
77
- $this->_addContent($ongletBlock);
78
- switch ($step){
79
- default:
80
- case 1:
81
- $project_id = Mage::getSingleton('core/session')->getProjectId();
82
- $project = Mage::getModel('textmaster/project');
83
- if($project_id && is_numeric($project_id)){
84
- $project->load($project_id);
85
- $docs = $project->getDocuments();
86
- $pids = array();
87
- foreach($docs as $doc){
88
- $pids[] = $doc->getProductId();
89
- }
90
-
91
- $this->getRequest()->setParam('internal_products_id',implode(',',$pids));
92
-
93
- }
94
-
95
- $ongletBlock->setIntroHtml(Mage::helper('textmaster')->__('Select the list of products to translate or proofread. Use the filter in the last column to select the product descriptions that haven\'t been translated yet. If the product description has already been translated on TextMaster, a flag will appear beside each completed translation.'));
96
-
97
-
98
- $this->_addContent($step1Block);
99
- break;
100
- case 2:
101
- $project_id = Mage::getSingleton('core/session')->getProjectId();
102
- $project = Mage::getModel('textmaster/project');
103
- if($project_id && is_numeric($project_id)){
104
- $project->load($project_id);
105
- $step2Block->setProject($project);
106
- }
107
-
108
- $summary = $this->getLayout()->createBlock('textmaster/adminhtml_project_onglets_summary');
109
- $ongletBlock->setChild('textmaster.step2',$step2Block);
110
- $ongletBlock->setChild('textmaster.summary',$summary);
111
- // $this->_addContent($step2Block);
112
- $ongletBlock->setIntroHtml(Mage::helper('textmaster')->__('Fill out the project details and choose the service level and extra options. Give translator or proofreader special instructions (specific terms, layout guidelines, etc.)'));
113
-
114
-
115
- break;
116
- case 3:
117
- $project_id = Mage::getSingleton('core/session')->getProjectId();
118
- $post = Mage::app()->getRequest()->getPost();
119
- if($post && count($post)){
120
- $project = Mage::getModel('textmaster/project')->load($project_id, null, false);
121
- $r = $project->launch();
122
- if(!isset($r['error'])) {
123
- $this->_redirect('*/*/');
124
- } else {
125
- Mage::getSingleton('adminhtml/session')->addError($r['error']);
126
- $this->_redirect('*/*/edit', array("step" => 3));
127
- }
128
- return ;
129
- }
130
- Mage::getSingleton('adminhtml/session')->unsTextmasterUserInfos();
131
-
132
-
133
- $project = Mage::getModel('textmaster/project')->load($project_id, null, true);
134
- if($project->hasDocumentsNotCount() || ($project->getTranslationMemory() && $project->getTranslationMemoryStatus() == Textmaster_Textmaster_Model_Project::PROJECT_TM_STATUS_IN_PROGRESS)){
135
- $this->_redirect('*/*/edit', array("step" => 2));
136
- }
137
- $ongletBlock->setIntroHtml(Mage::helper('textmaster')->__('Verify your project setting before placing your order. If you do not have enough credits on TextMaster, click on the link below to add credits to your account on TextMaster.com'));
138
- $products_id = Mage::getSingleton('core/session')->getSelectedProducts();
139
- if(empty($products_id)){
140
- $products_id = array();
141
- $documents = $project->getDocuments();
142
- foreach($documents as $document){
143
- $products_id[] = $document->getProductId();
144
- }
145
- Mage::getSingleton('core/session')->setSelectedProducts($products_id);
146
- }
147
-
148
- if($project->canLaunch()){
149
- $ongletBlock->addButton ( 'save', array (
150
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Launch' ),
151
- 'onclick' => 'editForm.submit();',
152
- 'class' => 'save',
153
- ), - 100 );
154
- } else {
155
- $ongletBlock->addButton ( 'save', array (
156
- 'label' => Mage::helper ( 'textmaster' )->__ ( 'Launch' ),
157
- 'onclick' => 'editForm.submit();',
158
- 'class' => 'save',
159
- 'disabled'=>'disabled'
160
-
161
- ), - 100 );
162
- }
163
-
164
- $step3Block->setProject($project);
165
-
166
- $ongletBlock->insert($step3Block);
167
-
168
- $this->_addContent($step3Block);
169
-
170
- break;
171
- }
172
-
173
- $this->renderLayout();
174
- }
175
- else
176
- {
177
- Mage::getSingleton('adminhtml/session')
178
- ->addError(Mage::helper('textmaster')->__('Project does not exist'));
179
- $this->_redirect('*/*/');
180
- }
181
- }
182
-
183
- public function newAction()
184
- {
185
- Mage::getSingleton('core/session')->setSelectedProducts(array());
186
- Mage::getSingleton('core/session')->setProjectId(0);
187
- Mage::getSingleton('core/session')->setProjectInfo(array());
188
- $this->_redirect('*/*/edit');
189
- }
190
-
191
- public function massAddAction()
192
- {
193
- $products = $this->getRequest()->getParam('products_id');
194
- if(!is_array($products) || !count($products) || empty($products[0])) {
195
- $this->_redirect('*/*/edit', array("step" => 1));
196
- return;
197
- }
198
- Mage::getSingleton('core/session')->setSelectedProducts($products);
199
-
200
-
201
- $this->_redirect('*/*/edit', array("step" => 2));
202
- }
203
- public function createprojectfromproductAction(){
204
- Mage::getSingleton('core/session')->setSelectedProducts(array());
205
- Mage::getSingleton('core/session')->setProjectId(0);
206
- Mage::getSingleton('core/session')->setProjectInfo(array());
207
-
208
- $product = $this->getRequest()->getParam('id');
209
- Mage::getSingleton('core/session')->setSelectedProducts(array($product));
210
- $this->_redirect('*/*/edit', array("step" => 2));
211
- }
212
-
213
- public function massSendAction()
214
- {
215
- $docs = $this->getRequest()->getParam('document_id');
216
-
217
- //$projectId = $this->getRequest()->getParam('id');
218
- //Mage::getSingleton('core/session')->setSelectedProducts($products);
219
- foreach($docs as $doc){
220
-
221
- Mage::getModel('textmaster/document')->load($doc)->send();
222
- $projectId = Mage::getModel('textmaster/document')->load($doc)->getTextmasterProjectId();
223
- }
224
-
225
- $this->_redirect('*/*/view', array("id" => $projectId));
226
- }
227
-
228
- public function viewAction() {
229
- $projectId = $this->getRequest()->getParam('id');
230
- $projectModel = Mage::getModel('textmaster/project')->load($projectId);
231
- if ($projectModel->getId()) {
232
- if($projectModel->getStatus() == Textmaster_Textmaster_Model_Project::PROJECT_STATUS_IN_CREATION){
233
- Mage::getSingleton('core/session')->setProjectId($projectModel->getId());
234
- if(count($projectModel->getDocuments()))
235
- $this->_redirect('*/*/edit',array('step'=>'3'));
236
- elseif($projectModel->hasDocumentsNotCount())
237
- $this->_redirect('*/*/edit',array('step'=>'2'));
238
- else
239
- $this->_redirect('*/*/edit',array('step'=>'1'));
240
- return;
241
- }
242
-
243
- //ACTIONS
244
- $action = $this->getRequest()->getParam('a');
245
- if($action && is_callable(array($projectModel,$action))){
246
- call_user_func(array($projectModel,$action));
247
- }
248
-
249
- $this->_initAction();
250
- $viewBlock = $this->getLayout()->getBlock('project.view');
251
- $viewBlock->setProject($projectModel);
252
- $viewBlock->prepareButton();
253
- $documentsBlock = $this->getLayout()->getBlock('project.view.documents');
254
- $documentsBlock->setProject($projectModel);
255
-
256
- $this->_addContent($documentsBlock);
257
-
258
-
259
-
260
- $this->renderLayout();
261
- } else {
262
- Mage::getSingleton('adminhtml/session')
263
- ->addError(Mage::helper('textmaster')->__('Project does not exist'));
264
- $this->_redirect('*/*/');
265
- }
266
- }
267
- public function masscompletedocAction() {
268
-
269
- $projectId = $this->getRequest()->getParam('id');
270
- $project = Mage::getModel('textmaster/project')->load($projectId,null,false);
271
- $docs = $this->getRequest()->getParam('document_id');
272
- $doc_api_ids = array();
273
- foreach($docs as $doc_id){
274
- $document = Mage::getModel('textmaster/document')->load($doc_id,null,false);
275
- $document->prepareToComplete();
276
- $doc_api_ids[]=$document->getDocumentApiId();
277
- }
278
-
279
- Mage::helper('textmaster')->getApi()->completeDocuments($project->getProjectApiid(),$doc_api_ids);
280
- $this->getResponse()->setHeader('Content-type', 'application/json');
281
- $this->getResponse()->setBody( Mage::helper('core')->jsonEncode(array('url'=>$this->getUrl('*/*/doccompleteready',array('id'=>$projectId)))));
282
- //$this->_redirect('*/*/view',array('id'=>$projectId));
283
- }
284
- public function doccompleteAction() {
285
- $documentId = $this->getRequest()->getParam('id');
286
- $document = Mage::getModel('textmaster/document')->load($documentId,null,false);
287
- if ($document->getId()){
288
- $document->sendToComplete();
289
- $json = Mage::helper('core')->jsonEncode(
290
- array('counturl' => $this->getUrl('*/*/doccompleteready',array('id'=>$document->getTextmasterProjectId())))
291
- );
292
- } else {
293
- $json = Mage::helper('core')->jsonEncode(
294
- array()
295
- );
296
- }
297
-
298
- $this->getResponse()->setHeader('Content-type', 'application/json');
299
- $this->getResponse()->setBody($json);
300
- //$this->_redirect('*/*/document/',array('id'=>$documentId));
301
- }
302
- public function doccompletereadyAction() {
303
- $timetosleed = 2;
304
- sleep($timetosleed);
305
-
306
-
307
- $projectId = $this->getRequest()->getParam('id');
308
- $project = Mage::getModel('textmaster/project');
309
- $project->load($projectId,null,false);
310
- $docs_all = $project->getDocumentsSendToCompleted();
311
- $docs_notcomp = $project->getDocumentsSendNotCompleted();
312
- $ndocc = count($docs_notcomp);
313
-
314
-
315
- if($ndocc!=0) {
316
- $ndoc = count($docs_all);
317
-
318
-
319
- $nd = ($ndoc-$ndocc) / $ndoc;
320
- $r = round($nd,2)*100;
321
- echo $r;
322
- exit;
323
- }
324
- echo $this->getUrl('*/*/view',array('id'=>$projectId));
325
- exit;
326
- }
327
- public function revisionAction() {
328
- $documentId = $this->getRequest()->getParam('id');
329
- $message = $this->getRequest()->getParam('message');
330
- $document = Mage::getModel('textmaster/document')->load($documentId,null,false);
331
- if ($document->getId()){
332
- $documents = $document->revision($message);
333
- }
334
-
335
- $this->_redirect('*/*/document/',array('id'=>$documentId));
336
- }
337
- public function documentAction() {
338
- $docId = $this->getRequest()->getParam('id');
339
- $document = Mage::getModel('textmaster/document')->load($docId,null,true,false);
340
-
341
- if ($document->getId()){
342
- $this->_initAction();
343
- $documentBlock = $this->getLayout()->getBlock('project.document.view');
344
- $documentBlock->setDocument($document);
345
- $supporttBlock = $this->getLayout()->getBlock('project.document.supportmessage');
346
- $supporttBlock->setDocument($document);
347
- $this->renderLayout();
348
- } else {
349
- $this->_redirect('*/*/');
350
- }
351
- }
352
-
353
- public function massLaunchAction() {
354
- $projects = $this->getRequest()->getParam('project_id');
355
- foreach($projects as $project_id){
356
- Mage::getModel('textmaster/project')->load($project_id,null,false)->launch();
357
- }
358
- $this->_redirect('*/*/index');
359
- }
360
- public function massPauseAction() {
361
- $projects = $this->getRequest()->getParam('project_id');
362
- foreach($projects as $project_id){
363
- Mage::getModel('textmaster/project')->load($project_id)->pause();
364
- }
365
- $this->_redirect('*/*/index');
366
- }
367
- public function massResumeAction() {
368
- $projects = $this->getRequest()->getParam('project_id');
369
- foreach($projects as $project_id){
370
- Mage::getModel('textmaster/project')->load($project_id)->resume();
371
- }
372
- $this->_redirect('*/*/index');
373
- }
374
- public function massCancelAction() {
375
- $projects = $this->getRequest()->getParam('project_id');
376
- foreach($projects as $project_id){
377
- Mage::getModel('textmaster/project')->load($project_id)->cancel();
378
- }
379
- $this->_redirect('*/*/index');
380
- }
381
- public function massCompleteAction() {
382
- $projects = $this->getRequest()->getParam('project_id');
383
- foreach($projects as $project_id){
384
- Mage::getModel('textmaster/project')->load($project_id)->complete();
385
- }
386
- $this->_redirect('*/*/index');
387
- }
388
- public function massDuplicateAction(){
389
- $projects = $this->getRequest()->getParam('project_id');
390
- foreach($projects as $project_id){
391
- Mage::getModel('textmaster/project')->load($project_id)->duplicate();
392
- }
393
- $this->_redirect('*/*/index');
394
- }
395
-
396
-
397
- public function createprojectreadyAction(){
398
-
399
- //echo $project->hasDocumentsNotSend()?'0':$this->getUrl('*/*/edit',array('step'=>3));
400
- $timetosleed = 2;
401
- sleep($timetosleed);
402
-
403
- $projectId = $this->getRequest()->getParam('id');
404
- $project = Mage::getModel('textmaster/project');
405
- $project->load($projectId, null, true);
406
- $docs_all = $project->getDocuments();
407
- $docs_notcount = $project->getDocumentsNotCount();
408
-
409
- if($project->hasDocumentsNotCount()) {
410
- $ndoc = count($docs_all);
411
- $ndocc = count($docs_notcount);
412
-
413
- /*
414
- * Ceinture de sécurité : au cas où l'appel à $project->sendDocuments()
415
- * n'ai pas été déjà fait dans le callBack, on le relance ici
416
- * */
417
- $docs_notsend = $project->getDocumentsNotSend();
418
- $ndocs = count($docs_notsend);
419
- if($ndocc==$ndocs)
420
- $project->sendDocuments();
421
-
422
-
423
- $nd = $ndoc-$ndocc;
424
- $nd = $nd / $ndoc;
425
- $r = round($nd,2)*100;
426
- echo $r;
427
- exit;
428
- }
429
-
430
- $project->startTranslationMemory(); // start TM if needed
431
- if($project->getTranslationMemoryStatus() == Textmaster_Textmaster_Model_Project::PROJECT_TM_STATUS_IN_PROGRESS){
432
- echo Textmaster_Textmaster_Model_Project::PROJECT_TM_STATUS_IN_PROGRESS;
433
- exit;
434
- }
435
-
436
- //echo '100';
437
- echo $this->getUrl('*/*/edit',array('step'=>3));
438
- exit;
439
- }
440
- public function addprojectAction(){
441
- $project_id = Mage::getSingleton('core/session')->getProjectId();
442
- $project = Mage::getModel('textmaster/project');
443
- if($project_id && is_numeric($project_id)){
444
- $project->load($project_id);
445
- }
446
-
447
- $post = Mage::app()->getRequest()->getPost();
448
-
449
- $this->getResponse()->setHeader('Content-type', 'application/json');
450
- if($post && count($post)){
451
- Mage::getSingleton('core/session')->setProjectInfo($post);
452
- $products_id = Mage::getSingleton('core/session')->getSelectedProducts();
453
- $text = '';
454
- foreach($products_id as $id){
455
- $product = Mage::getModel('catalog/product')->load($id);
456
- if(isset($post['attribute'])) {
457
- foreach($post['attribute'] as $attr){
458
- $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attr);
459
- $text .= $product->getData($attribute->getName ()).' ';
460
- }
461
- }
462
- }
463
- $word_count = Mage::helper('textmaster')->countWord($text);
464
- //$pricing = Mage::helper('textmaster')->getApi()->getPricings($word_count);
465
- //$project_id = Mage::getSingleton('core/session')->getProjectId();
466
-
467
- $update = false;
468
- if($project_id && is_numeric($project_id)){
469
- $project->load($project_id);
470
- $project->setName($post['name']);
471
- $project->setProjectBriefing($post['project_briefing']);
472
- $project->setCtype($post['ctype']);
473
- $project->setCategory($post['category']);
474
- $project->setStoreIdOrigin($post['store_id_origin']);
475
-
476
- if($post['ctype']=='translation')
477
- $project->setStoreIdTranslation($post['store_id_translation']);
478
- else
479
- $project->setStoreIdTranslation($post['store_id_origin']);
480
-
481
- $project->setLanguageLevel($post['language_level']);
482
- if(isset($post['specific_attachment']))
483
- $project->setSpecificAttachment($post['specific_attachment']);
484
- $project->setPriority($post['priority']);
485
- if(!isset($post['quality'])) $post['quality'] = 0;
486
- $project->setQuality($post['quality']);
487
- $project->setExpertise($post['expertise']);
488
- $project->setSameAuthorMustDoEntireProject($post['same_author_must_do_entire_project']);
489
- if(isset($post['ismytextmaster']))
490
- $project->setIsmytextmaster($post['ismytextmaster']);
491
- if(isset($post['mytextmaster'])) {
492
- $project->setTextmasters($post['mytextmaster']);
493
- }
494
- $project->setTranslationMemory($post['translation_memory']);
495
- if(isset($post['negotiated_contract'])) {
496
- $project->setNegotiatedContract($post['negotiated_contract']);
497
- }
498
-
499
- $update = true;
500
-
501
- $documents = $project->getDocuments();
502
- $products_id = Mage::getSingleton('core/session')->getSelectedProducts();
503
- foreach($documents as $document){
504
- $document->delete();
505
- }
506
- $project_attributes = $project->getAttributes();
507
- foreach($project_attributes as $project_attribute){
508
- $project_attribute->delete();
509
- }
510
-
511
- } else {
512
- if($post['ctype']!='translation')
513
- $post['store_id_translation'] = $post['store_id_origin'];
514
- $project->setData($post);
515
- }
516
-
517
- try {
518
- $project->save();
519
- if($project->getId()){
520
- Mage::getSingleton('core/session')->setProjectId($project->getId());
521
- if(is_array($post['attribute'])) {
522
- foreach($post['attribute'] as $attr){
523
- $project_attribute = Mage::getModel('textmaster/project_attribute');
524
- $project_attribute->setTextmasterAttributeId($attr);
525
- $project_attribute->setTextmasterProjectId($project->getId());
526
- $project_attribute->save();
527
- }
528
- }
529
- $products_id = Mage::getSingleton('core/session')->getSelectedProducts();
530
-
531
-
532
- $documents = array();
533
- $nbsend = 0;
534
- foreach($products_id as $id){
535
- $product = Mage::getModel('catalog/product')->setStoreId( $project->getStoreIdOrigin() )->load($id);
536
- $document = Mage::getModel('textmaster/document');
537
- $document->setProject($project);
538
- $document->setName($product->getName());
539
- $document->setProductId($id);
540
- $document->setTextmasterProjectId($project->getId());
541
- $document->setSend(0);
542
- $document->save();
543
- $documents[]=$document;
544
- $nbsend++;
545
- }
546
-
547
- $project->sendDocuments();
548
-
549
- $json = Mage::helper('core')->jsonEncode(
550
- array(
551
- 'url'=>$this->getUrl('*/*/edit',array('step'=>3)),
552
- 'counturl' => $this->getUrl('*/*/createprojectready',array('id'=>$project->getId()))
553
-
554
- )
555
- );
556
- $this->getResponse()->setBody($json);
557
- } else {
558
- Mage::getSingleton('core/session')->addError(Mage::helper('textmaster')->__('Project creation error'));
559
- $json = Mage::helper('core')->jsonEncode(array('url'=>$this->getUrl('*/*/edit',array('step'=>2))));
560
- $this->getResponse()->setBody($json);
561
- }
562
- } catch (Exception $e){
563
- Mage::getSingleton('core/session')->addError($e->getMessage());
564
- $json = Mage::helper('core')->jsonEncode(array('url'=>$this->getUrl('*/*/edit',array('step'=>2,'reload'=>1))));
565
- $this->getResponse()->setBody($json);
566
- }
567
-
568
- return;
569
- }
570
- $json = Mage::helper('core')->jsonEncode(array('erreur'=>$e->getMessage()));
571
- //throw new Exception('Project creation error');
572
- $this->getResponse()->setBody('NO POST');
573
- }
574
-
575
-
576
-
577
- public function authorAction (){
578
- $this->getResponse()->setHeader('Content-type', 'application/json');
579
- $post = Mage::app()->getRequest()->getPost();
580
- if($post && count($post)==10){
581
- $post['options'] = array(
582
- 'language_level' => $post['language_level'],
583
- //'quality' => $post['quality'],
584
- //'priority' => $post['priority'],
585
- //'expertise' => $post['expertise'],
586
- //'specific_attachment' => $post['specific_attachment'],
587
- );
588
- //$post['total_word_count'] = $post['word_count'];
589
- unset($post['language_level']);
590
- unset($post['quality']);
591
- unset($post['priority']);
592
- unset($post['expertise']);
593
- unset($post['specific_attachment']);
594
- unset($post['form_key']);
595
- unset($post['word_count']);
596
-
597
- $post['language_from'] = substr(Mage::getStoreConfig('general/locale/code',$post['language_from']),0,2);
598
-
599
- if($post['ctype']!='translation') {
600
- unset($post['language_to']);
601
- } else {
602
- $post['language_to'] = substr(Mage::getStoreConfig('general/locale/code',$post['language_to']),0,2);
603
- }
604
- try{
605
- $authors = Mage::helper('textmaster')->getApi()->getAuthorsFilter($post);
606
- if(isset($authors['error'])){
607
- throw new Exception($authors['error']);
608
- }
609
- $result['authors'] = $authors['authors'];
610
-
611
- } catch (Exception $e){
612
- $result['error'] = $e->getMessage();
613
- }
614
-
615
-
616
- } else {
617
- $result['error'] = Mage::helper('textmaster')->__('No post');
618
- }
619
- $json = Mage::helper('core')->jsonEncode($result);
620
- $this->getResponse()->setBody($json);
621
- }
622
-
623
-
624
- public function getmyauthorsAction(){
625
-
626
- $projectId = $this->getRequest()->getParam('id');
627
- $projectModel = Mage::getModel('textmaster/project')->load($projectId);
628
- if ($projectModel->getId()) {
629
- $this->loadLayout();
630
- $d = $projectModel->getData();
631
- $post = Mage::app()->getRequest()->getPost();
632
- if(count($post) && !isset($post['textmasters'])) $post['textmasters']=array();
633
- try{
634
- if($post && count($post) && isset($post['textmasters'])){
635
- if(is_array($post['textmasters'])){
636
- $projectModel->saveTextmasters($post['textmasters']);
637
- } elseif(is_string($post['textmasters'])){
638
- $projectModel->saveTextmasters(array($post['textmasters']));
639
- }
640
-
641
- Mage::getSingleton('adminhtml/session')
642
- ->addSuccess(Mage::helper('textmaster')->__('Textmasters saved'));
643
- }
644
- } catch (Exception $e){
645
- Mage::log(__LINE__.' : '.$e->getMessage(), null, 'textmaster.log');
646
- }
647
- $viewBlock = $this->getLayout()->createBlock('textmaster/adminhtml_project_onglets_step3_form_author');
648
- $viewBlock->setProject($projectModel);
649
- $this->getLayout()->getBlock('step3_author')->setChild('form',$viewBlock);;
650
- $this->renderLayout();
651
- return ;
652
- }
653
- exit;
654
- }
655
- //ster/adminhtml_project/getmyauthors/id/53/key/bed5288e3b1f1d075710db7ab5b6a207/
656
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/controllers/CallbackController.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_CallbackController extends Mage_Core_Controller_Front_Action
27
- {
28
- public function indexAction()
29
- {
30
- $this->loadLayout();
31
- $this->renderLayout();
32
- }
33
-
34
- public function documentcountAction()
35
- {
36
- $params = $this->getRequest()->getParams();
37
- $postData = $this->getRequest()->getPost();
38
-
39
- $postData = json_decode(file_get_contents('php://input'));
40
- // recupere les donnée poster en JSON
41
- Mage::log('Callback documentcount '.(isset($postData->id)?$postData->id:'id inconnu'),null,'textmaster.log');
42
-
43
- if(is_object($postData) && isset($postData->id) && strlen($postData->id)==24) {
44
- $document = Mage::getModel('textmaster/document')->loadByApiId($postData->id);
45
- if($document->getId()) {
46
- $document->setCounted(1);
47
- $document->save();
48
-
49
- //On renvoie un batch de 20 documents si il en reste à envoyer sur le projet
50
- //quand on a "compté" tous ceux qui ont déjà été envoyé
51
- $project = $document->getProject();
52
- $docs_notsend = $project->getDocumentsNotSend();
53
-
54
- if($project->hasDocumentsNotSend()) {
55
- $docs_notcount = $project->getDocumentsNotCount();
56
- $ndocc = count($docs_notcount);
57
- $ndocs = count($docs_notsend);
58
- if($ndocc==$ndocs) {
59
- $project->sendDocuments();
60
- }
61
- }
62
-
63
- }
64
- }
65
- $this->loadLayout();
66
- $this->renderLayout();
67
- }
68
-
69
- public function documentcompleteAction()
70
- {
71
- $params = $this->getRequest()->getParams();
72
- $postData = $this->getRequest()->getPost();
73
-
74
- $postData = json_decode(file_get_contents('php://input'));
75
- // recupere les donnée poster en JSON
76
- Mage::log('Callback documentcomplete '.(isset($postData->id)?$postData->id:'id inconnu'),null,'textmaster.log');
77
-
78
- if(is_object($postData) && isset($postData->id) && strlen($postData->id)==24) {
79
- $document = Mage::getModel('textmaster/document')->loadByApiId($postData->id);
80
- if($document->getId()) {
81
- $document->complete();
82
- } else {
83
- //Mage::log('not loaded',null,'textmaster.log');
84
- }
85
- } else {
86
- }
87
- $this->loadLayout();
88
- $this->renderLayout();
89
- }
90
-
91
- public function projecttmcompleteAction()
92
- {
93
- $params = $this->getRequest()->getParams();
94
- $postData = $this->getRequest()->getPost();
95
-
96
- $postData = json_decode(file_get_contents('php://input'));
97
- // recupere les données poster en JSON
98
- Mage::log('Callback projecttmcompleted '.(isset($postData->id) ? $postData->id : 'id inconnu'), null, 'textmaster.log');
99
-
100
- if(is_object($postData) && isset($postData->id)) {
101
- $project = Mage::getModel('textmaster/project')->getCollection()->addFieldToFilter('project_apiid', $postData->id)->getFirstItem();
102
- if($project->getId()) {
103
- $project->setTranslationMemoryStatus(Textmaster_Textmaster_Model_Project::PROJECT_TM_STATUS_COMPLETED);
104
- $project->setHasChangeMemoryStatus(true);
105
- $project->save();
106
- }
107
- }
108
- $this->loadLayout();
109
- $this->renderLayout();
110
- }
111
-
112
- public function inprogressAction(){
113
- $postData = json_decode(file_get_contents('php://input'));
114
- Mage::log('CALLBACK IN PROGRESS',null,'textmaster.log');
115
- Mage::log($postData,null,'textmaster.log');
116
- }
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/controllers/IndexController.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
- class Textmaster_Textmaster_IndexController extends Mage_Core_Controller_Front_Action
27
- {
28
- public function indexAction()
29
- {
30
- $this->loadLayout();
31
- $this->renderLayout();
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/etc/config.xml DELETED
@@ -1,201 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- /**
4
- * Copyright (c) 2014 Textmaster
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- *
12
- * @category Addonline
13
- * @package Textmaster_Textmaster
14
- * @copyright Copyright (c) 2014 Textmaster
15
- * @author Addonline (http://www.addonline.fr)
16
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
- */
18
-
19
- /**
20
- * Textmaster_Textmaster
21
- *
22
- * @category Addonline
23
- * @package Textmaster_Textmaster
24
- * @copyright Copyright (c) 2014 Textmaster
25
- * @author Addonline (http://www.addonline.fr)
26
- */
27
- -->
28
- <config>
29
-
30
- <modules>
31
- <Textmaster_Textmaster>
32
- <version>1.0.10</version>
33
- </Textmaster_Textmaster>
34
- </modules>
35
- <global>
36
- <helpers>
37
- <textmaster><class>Textmaster_Textmaster_Helper</class></textmaster>
38
- </helpers>
39
- <blocks>
40
- <textmaster><class>Textmaster_Textmaster_Block</class></textmaster>
41
- </blocks>
42
- <models>
43
- <textmaster>
44
- <class>Textmaster_Textmaster_Model</class>
45
- <resourceModel>textmaster_mysql4</resourceModel>
46
- </textmaster>
47
- <textmaster_mysql4>
48
- <class>Textmaster_Textmaster_Model_Mysql4</class>
49
- <entities>
50
- <project>
51
- <table>textmaster_project</table>
52
- </project>
53
- <document>
54
- <table>textmaster_document</table>
55
- </document>
56
- <project_attribute>
57
- <table>textmaster_project_attribute</table>
58
- </project_attribute>
59
- </entities>
60
- </textmaster_mysql4>
61
- </models>
62
- <resources>
63
- <textmaster_setup>
64
- <setup>
65
- <module>Textmaster_Textmaster</module>
66
- </setup>
67
- <connection>
68
- <use>core_setup</use>
69
- </connection>
70
- </textmaster_setup>
71
- <textmaster_write>
72
- <connection>
73
- <use>core_write</use>
74
- </connection>
75
- </textmaster_write>
76
- <textmaster_read>
77
- <connection>
78
- <use>core_read</use>
79
- </connection>
80
- </textmaster_read>
81
- </resources>
82
- <events>
83
- <adminhtml_block_html_before>
84
- <observers>
85
- <textmaster_product_translate_hook>
86
- <type>singleton</type>
87
- <class>textmaster/observer</class>
88
- <method>_productCreateBlock</method>
89
- </textmaster_product_translate_hook>
90
- </observers>
91
- </adminhtml_block_html_before>
92
- </events>
93
- </global>
94
- <admin>
95
- <routers>
96
- <adminhtml>
97
- <args>
98
- <modules>
99
- <textmaster after="Mage_Adminhtml">Textmaster_Textmaster_Adminhtml</textmaster>
100
- </modules>
101
- </args>
102
- </adminhtml>
103
- </routers>
104
- </admin>
105
- <adminhtml>
106
- <menu>
107
- <textmaster translate="title" module="textmaster">
108
- <title>TextMaster</title>
109
- <sort_order>100</sort_order>
110
- <children>
111
- <projet translate="title" module="textmaster">
112
- <title>Manage Projects</title>
113
- <action>adminhtml/textmaster_project/index</action>
114
- </projet>
115
- <config translate="title" module="textmaster">
116
- <title>Configuration</title>
117
- <action>adminhtml/system_config/edit/section/textmaster</action>
118
- </config>
119
- </children>
120
- </textmaster>
121
- </menu>
122
- <acl>
123
- <resources>
124
- <all>
125
- <title>Allow Everything</title>
126
- </all>
127
- <admin>
128
- <children>
129
- <textmaster translate="title" module="textmaster">
130
- <title>Textmaster</title>
131
- <sort_order>65</sort_order>
132
- <children>
133
- <projet translate="title">
134
- <title>Manage Projects</title>
135
- </projet>
136
- <config translate="title">
137
- <title>Configuration</title>
138
- </config>
139
- </children>
140
- </textmaster>
141
- <system>
142
- <children>
143
- <config>
144
- <children>
145
- <textmaster translate="title">
146
- <title>Textmaster section</title>
147
- <sort_order>100</sort_order>
148
- </textmaster>
149
- </children>
150
- </config>
151
- </children>
152
- </system>
153
- </children>
154
- </admin>
155
- </resources>
156
- </acl>
157
- <layout>
158
- <updates>
159
- <textmaster>
160
- <file>textmaster.xml</file>
161
- </textmaster>
162
- </updates>
163
- </layout>
164
- <api>
165
- <documents>
166
- <send>
167
- <nb>20</nb>
168
- </send>
169
- </documents>
170
- <sandbox>0</sandbox>
171
- <staging>0</staging>
172
- </api>
173
- <translate>
174
- <modules>
175
- <Textmaster_Textmaster>
176
- <files>
177
- <default>Textmaster_Textmaster.csv</default>
178
- </files>
179
- </Textmaster_Textmaster>
180
- </modules>
181
- </translate>
182
- </adminhtml>
183
- <frontend>
184
- <routers>
185
- <textmaster>
186
- <use>standard</use>
187
- <args>
188
- <module>Textmaster_Textmaster</module>
189
- <frontName>textmaster</frontName>
190
- </args>
191
- </textmaster>
192
- </routers>
193
- </frontend>
194
- <default>
195
- <textmaster>
196
- <defaultvalue>
197
- <category>C019</category><!-- Commerce -->
198
- </defaultvalue>
199
- </textmaster>
200
- </default>
201
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/etc/jstranslator.xml DELETED
@@ -1,50 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- /**
4
- * Copyright (c) 2014 Textmaster
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- *
12
- * @category Addonline
13
- * @package Textmaster_Textmaster
14
- * @copyright Copyright (c) 2014 Textmaster
15
- * @author Addonline (http://www.addonline.fr)
16
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
- */
18
-
19
- /**
20
- * Textmaster_Textmaster
21
- *
22
- * @category Addonline
23
- * @package Textmaster_Textmaster
24
- * @copyright Copyright (c) 2014 Textmaster
25
- * @author Addonline (http://www.addonline.fr)
26
- */
27
- -->
28
- <jstranslator>
29
- <textmaster_control_quality translate="message" module="textmaster">
30
- <message>Control Quality</message>
31
- </textmaster_control_quality>
32
- <textmaster_priority translate="message" module="textmaster">
33
- <message>Priority</message>
34
- </textmaster_priority>
35
- <textmaster_expertise translate="message" module="textmaster">
36
- <message>Expertise</message>
37
- </textmaster_expertise>
38
- <textmaster_word translate="message" module="textmaster">
39
- <message>word</message>
40
- </textmaster_word>
41
- <textmaster_worth translate="message" module="textmaster">
42
- <message>worth</message>
43
- </textmaster_worth>
44
- <textmaster_translation_memory translate="message" module="textmaster">
45
- <message>Translation memory</message>
46
- </textmaster_translation_memory>
47
- <textmaster_negotiated_contract translate="message" module="textmaster">
48
- <message>Negotiated contract</message>
49
- </textmaster_negotiated_contract>
50
- </jstranslator>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/etc/system.xml DELETED
@@ -1,226 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Copyright (c) 2014 Textmaster
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- *
12
- * @category Addonline
13
- * @package Textmaster_Textmaster
14
- * @copyright Copyright (c) 2014 Textmaster
15
- * @author Addonline (http://www.addonline.fr)
16
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
- */
18
-
19
- /**
20
- * Textmaster_Textmaster
21
- *
22
- * @category Addonline
23
- * @package Textmaster_Textmaster
24
- * @copyright Copyright (c) 2014 Textmaster
25
- * @author Addonline (http://www.addonline.fr)
26
- */
27
- -->
28
- <config>
29
- <tabs>
30
- <addonline translate="label">
31
- <label>Addonline config</label>
32
- <sort_order>203</sort_order>
33
- </addonline>
34
- </tabs>
35
- <sections>
36
- <textmaster translate="label">
37
- <label>Textmaster</label>
38
- <tab>addonline</tab>
39
- <active>true</active>
40
- <frontend_type>text</frontend_type>
41
- <sort_order>150</sort_order>
42
- <show_in_default>1</show_in_default>
43
- <show_in_website>1</show_in_website>
44
- <show_in_store>1</show_in_store>
45
- <groups>
46
- <textmaster translate="label" module="textmaster">
47
- <label>TextMaster Login</label>
48
- <frontend_type>text</frontend_type>
49
- <sort_order>18</sort_order>
50
- <show_in_default>1</show_in_default>
51
- <show_in_website>1</show_in_website>
52
- <show_in_store>1</show_in_store>
53
- <fields>
54
- <istextmasterlog>
55
- <label></label>
56
- <source_model>adminhtml/system_config_source_yesno</source_model>
57
- <frontend_model>textmaster/adminhtml_system_config_form_field_islog</frontend_model>
58
- <sort_order>100</sort_order>
59
- <show_in_default>1</show_in_default>
60
- <show_in_website>1</show_in_website>
61
- <show_in_store>1</show_in_store>
62
- </istextmasterlog>
63
- <login translate="label">
64
- <label>Login</label>
65
- <frontend_model>textmaster/adminhtml_system_config_form_field_login</frontend_model>
66
- <sort_order>10</sort_order>
67
- <show_in_default>1</show_in_default>
68
- <show_in_website>1</show_in_website>
69
- <show_in_store>1</show_in_store>
70
- <depends><istextmasterlog>0</istextmasterlog></depends>
71
- </login>
72
- <creation translate="label">
73
- <label>Create your account</label>
74
- <frontend_model>textmaster/adminhtml_system_config_form_field_creation</frontend_model>
75
- <sort_order>15</sort_order>
76
- <show_in_default>1</show_in_default>
77
- <show_in_website>1</show_in_website>
78
- <show_in_store>1</show_in_store>
79
- <depends><istextmasterlog>0</istextmasterlog></depends>
80
- </creation>
81
- <api_key translate="label">
82
- <label>API Key</label>
83
- <frontend_type>text</frontend_type>
84
- <sort_order>25</sort_order>
85
- <show_in_default>1</show_in_default>
86
- <show_in_website>1</show_in_website>
87
- <show_in_store>1</show_in_store>
88
- <depends><istextmasterlog>1</istextmasterlog></depends>
89
- </api_key>
90
- <api_secret translate="label">
91
- <label>API secret</label>
92
- <frontend_type>text</frontend_type>
93
- <sort_order>30</sort_order>
94
- <show_in_default>1</show_in_default>
95
- <show_in_website>1</show_in_website>
96
- <show_in_store>1</show_in_store>
97
- <depends><istextmasterlog>1</istextmasterlog></depends>
98
- </api_secret>
99
-
100
-
101
-
102
- </fields>
103
- </textmaster>
104
- <defaultvalue translate="label" module="textmaster">
105
- <label>Default values</label>
106
- <frontend_type>text</frontend_type>
107
- <sort_order>19</sort_order>
108
- <show_in_default>1</show_in_default>
109
- <show_in_website>1</show_in_website>
110
- <show_in_store>1</show_in_store>
111
- <fields>
112
-
113
- <default_type translate="label">
114
- <label>Activities</label>
115
- <frontend_type>select</frontend_type>
116
- <source_model>textmaster/source_api_type</source_model>
117
- <sort_order>5</sort_order>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>1</show_in_website>
120
- <show_in_store>1</show_in_store>
121
-
122
- </default_type>
123
- <default_language translate="label">
124
- <label>Product Default Language</label>
125
- <frontend_type>select</frontend_type>
126
- <source_model>textmaster/source_api_lang</source_model>
127
- <sort_order>10</sort_order>
128
- <show_in_default>1</show_in_default>
129
- <show_in_website>1</show_in_website>
130
- <show_in_store>1</show_in_store>
131
-
132
- </default_language>
133
- <briefing_message_translation translate="label">
134
- <label>Briefing message for translation</label>
135
- <frontend_model>textmaster/adminhtml_system_config_form_field_briefing</frontend_model>
136
- <sort_order>15</sort_order>
137
- <show_in_default>1</show_in_default>
138
- <show_in_website>1</show_in_website>
139
- <show_in_store>1</show_in_store>
140
-
141
- </briefing_message_translation>
142
- <briefing_message_proofreading translate="label">
143
- <label>Briefing message for proofreading</label>
144
- <frontend_model>textmaster/adminhtml_system_config_form_field_briefing</frontend_model>
145
- <sort_order>16</sort_order>
146
- <show_in_default>1</show_in_default>
147
- <show_in_website>1</show_in_website>
148
- <show_in_store>1</show_in_store>
149
-
150
- </briefing_message_proofreading>
151
- <category translate="label">
152
- <label>Category</label>
153
- <frontend_type>select</frontend_type>
154
- <source_model>textmaster/source_api_category</source_model>
155
- <sort_order>25</sort_order>
156
- <show_in_default>1</show_in_default>
157
- <show_in_website>1</show_in_website>
158
- <show_in_store>1</show_in_store>
159
-
160
- </category>
161
- <single_author translate="label">
162
- <label>Single author</label>
163
- <frontend_type>select</frontend_type>
164
- <source_model>adminhtml/system_config_source_yesno</source_model>
165
- <sort_order>30</sort_order>
166
- <show_in_default>1</show_in_default>
167
- <show_in_website>1</show_in_website>
168
- <show_in_store>1</show_in_store>
169
-
170
- </single_author>
171
- <author translate="label">
172
- <label>Favorite authors</label>
173
- <frontend_type>multiselect</frontend_type>
174
- <source_model>textmaster/source_api_author</source_model>
175
- <sort_order>35</sort_order>
176
- <show_in_default>1</show_in_default>
177
- <show_in_website>1</show_in_website>
178
- <show_in_store>1</show_in_store>
179
-
180
- </author>
181
- <type_vocabulary translate="label">
182
- <label>Type of vocabulary</label>
183
- <frontend_type>select</frontend_type>
184
- <source_model>textmaster/source_api_vocabulary</source_model>
185
- <sort_order>40</sort_order>
186
- <show_in_default>1</show_in_default>
187
- <show_in_website>1</show_in_website>
188
- <show_in_store>1</show_in_store>
189
-
190
- </type_vocabulary>
191
- <target_audience translate="label">
192
- <label>Target audience</label>
193
- <frontend_type>select</frontend_type>
194
- <source_model>textmaster/source_api_audience</source_model>
195
- <sort_order>45</sort_order>
196
- <show_in_default>1</show_in_default>
197
- <show_in_website>1</show_in_website>
198
- <show_in_store>1</show_in_store>
199
-
200
- </target_audience>
201
- <grammatical_person translate="label">
202
- <label>Grammatical Person</label>
203
- <frontend_type>select</frontend_type>
204
- <source_model>textmaster/source_api_grammatical</source_model>
205
- <sort_order>50</sort_order>
206
- <show_in_default>1</show_in_default>
207
- <show_in_website>1</show_in_website>
208
- <show_in_store>1</show_in_store>
209
-
210
- </grammatical_person>
211
- <!-- <expertise translate="label">
212
- <label>Expertise</label>
213
- <frontend_type>select</frontend_type>
214
- <source_model>adminhtml/system_config_source_yesno</source_model>
215
- <sort_order>55</sort_order>
216
- <show_in_default>1</show_in_default>
217
- <show_in_website>1</show_in_website>
218
- <show_in_store>1</show_in_store>
219
-
220
- </expertise> -->
221
- </fields>
222
- </defaultvalue>
223
- </groups>
224
- </textmaster>
225
- </sections>
226
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-install-0.0.1.php DELETED
@@ -1,110 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
- $installer = $this;
31
- $installer->startSetup();
32
-
33
- $installer->run("
34
- DROP TABLE IF EXISTS `{$this->getTable('textmaster_document')}`;
35
- CREATE TABLE `{$this->getTable('textmaster_document')}` (
36
- `textmaster_document_id` int(11) NOT NULL auto_increment,
37
- `textmaster_project_id` int(11) NOT NULL,
38
- `product_id` int(10) unsigned NOT NULL,
39
- `document_api_id` varchar(60) default NULL,
40
- `name` varchar(45) default NULL,
41
- `send` tinyint(1) default '0',
42
- `updated_at` datetime default NULL,
43
- `created_at` datetime default NULL,
44
- `counted` tinyint(1) default '0',
45
- PRIMARY KEY (`textmaster_document_id`),
46
- KEY `fk_textmaster_document_textmaster_project1_idx` (`textmaster_project_id`),
47
- KEY `fk_textmaster_document_catalog_product_entity1_idx` (`product_id`),
48
- CONSTRAINT `fk_textmaster_document_catalog_product_entity1` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
49
- CONSTRAINT `fk_textmaster_document_textmaster_project1` FOREIGN KEY (`textmaster_project_id`) REFERENCES `{$this->getTable('textmaster_project')}` (`textmaster_project_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
50
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;"
51
- );
52
-
53
- $installer->run("
54
- DROP TABLE IF EXISTS `{$this->getTable('textmaster_project_attribute')}`;
55
- CREATE TABLE `{$this->getTable('textmaster_project_attribute')}` (
56
- `textmaster_project_attribute_id` int(11) NOT NULL auto_increment,
57
- `textmaster_attribute_id` int(11) default NULL,
58
- `textmaster_project_id` int(11) default NULL,
59
- PRIMARY KEY (`textmaster_project_attribute_id`)
60
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
61
- ");
62
-
63
- $installer->run("
64
- DROP TABLE IF EXISTS `{$this->getTable('textmaster_project')}`;
65
- CREATE TABLE `{$this->getTable('textmaster_project')}` (
66
- `textmaster_project_id` int(11) NOT NULL auto_increment,
67
- `store_id_origin` smallint(5) unsigned NOT NULL,
68
- `store_id_translation` smallint(5) unsigned NOT NULL,
69
- `name` varchar(45) default NULL,
70
- `status` varchar(45) default NULL,
71
- `project_apiid` varchar(50) default NULL,
72
- `textmasters` text,
73
- `documents_transfert` tinyint(1) default '0',
74
- PRIMARY KEY (`textmaster_project_id`),
75
- KEY `fk_textmaster_project_core_store1_idx` (`store_id_origin`),
76
- KEY `fk_textmaster_project_core_store2_idx` (`store_id_translation`),
77
- CONSTRAINT `fk_textmaster_project_core_store1` FOREIGN KEY (`store_id_origin`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
78
- CONSTRAINT `fk_textmaster_project_core_store2` FOREIGN KEY (`store_id_translation`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
79
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
80
- ");
81
-
82
- // Configation par defaut des category
83
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/category', 'path');
84
- $configData->setPath('textmaster/defaultvalue/category')
85
- ->setValue('C019')
86
- ->save();
87
-
88
-
89
- //configuration par defaut du briefing
90
- $admin_locale_code = Mage::getStoreConfig('general/locale/code');
91
- if(substr($admin_locale_code,0,2)=='fr') {
92
- $t1 = "Bonjour, Merci de traduire aussi fidèlement que possible le texte fourni en veillant à bien adapter les tournures et phrases dans votre langue maternelle pour garantir une bonne fluidité du texte. Merci aussi de conserver la mise en forme et les balises HTML.";
93
- $t2 = "Bonjour, Merci de corriger le texte fourni en veillant à conserver la structure du contenu. Vous devez corriger toutes les fautes d'orthographe, de grammaire (etc.) sans modifier l'organisation des phrases. Merci aussi de conserver la mise en forme et les balises HTML.";
94
- } else {
95
- $t1 = "Hello, Please translate as faithfully as possible the text provided while respecting the paragraph structure of the document. Please note that the expected number of words is given as an indication only. Also, please maintain the text format and HTML tags. Thank you.";
96
- $t2 = "Hello, Thank you for proofreading this text. Please maintain the style and vocabulary level and make sure you correct any grammatical error or typo. Also, please maintain the text format and HTML tags. Thank you";
97
- }
98
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/briefing_message_translation', 'path');
99
- $configData->setPath('textmaster/defaultvalue/briefing_message_translation')
100
- ->setValue($t1)
101
- ->save();
102
-
103
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/briefing_message_proofreading', 'path');
104
- $configData->setPath('textmaster/defaultvalue/briefing_message_proofreading')
105
- ->setValue($t2)
106
- ->save();
107
-
108
-
109
-
110
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.1-0.0.2.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
-
31
- $installer = $this;
32
- $installer->startSetup();
33
-
34
-
35
-
36
- $installer->run("ALTER TABLE `{$this->getTable('textmaster_project')}`
37
- ADD COLUMN `textmaster_user` VARCHAR(45) NULL AFTER `documents_transfert`;
38
- ");
39
-
40
-
41
-
42
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.2-0.0.3.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
-
28
- /**
29
- * @var $installer Mage_Core_Model_Resource_Setup
30
- */
31
-
32
- $installer = $this;
33
- $installer->startSetup();
34
-
35
- $admin_locale_code = Mage::getStoreConfig('general/locale/code');
36
- if(substr($admin_locale_code,0,2)=='fr') {
37
- $t1 = "Bonjour, Merci de traduire aussi fidèlement que possible le texte fourni en veillant à bien adapter les tournures et phrases dans votre langue maternelle pour garantir une bonne fluidité du texte. Merci aussi de conserver la mise en forme et les balises HTML.";
38
- $t2 = "Bonjour, Merci de corriger le texte fourni en veillant à conserver la structure du contenu. Vous devez corriger toutes les fautes d'orthographe, de grammaire (etc.) sans modifier l'organisation des phrases. Merci aussi de conserver la mise en forme et les balises HTML.";
39
- } else {
40
- $t1 = "Hello, Please translate as faithfully as possible the text provided while respecting the paragraph structure of the document. Please note that the expected number of words is given as an indication only. Also, please maintain the text format and HTML tags. Thank you.";
41
- $t2 = "Hello, Thank you for proofreading this text. Please maintain the style and vocabulary level and make sure you correct any grammatical error or typo. Also, please maintain the text format and HTML tags. Thank you";
42
- }
43
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/briefing_message_translation', 'path');
44
- $configData->setPath('textmaster/defaultvalue/briefing_message_translation')
45
- ->setValue($t1)
46
- ->save();
47
-
48
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/briefing_message_proofreading', 'path');
49
- $configData->setPath('textmaster/defaultvalue/briefing_message_proofreading')
50
- ->setValue($t2)
51
- ->save();
52
-
53
-
54
-
55
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.3-0.0.4.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
-
31
-
32
- $installer = $this;
33
- $installer->startSetup();
34
-
35
-
36
-
37
- $installer->run("ALTER TABLE `{$this->getTable('textmaster_document')}`
38
- ADD COLUMN `sendforcomplete` TINYINT(1) NULL AFTER `counted`,
39
- ADD COLUMN `completed` TINYINT(1) NULL AFTER `sendforcomplete`;
40
- ");
41
-
42
-
43
-
44
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.4-0.0.5.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
-
31
-
32
- $installer = $this;
33
- $installer->startSetup();
34
-
35
-
36
-
37
- $installer->run("ALTER TABLE `{$this->getTable('textmaster_document')}`
38
- ADD COLUMN `encourscomplete` TINYINT(1) NULL AFTER `completed`;
39
- ");
40
-
41
-
42
-
43
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.5-0.0.6.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
-
31
-
32
- $installer = $this;
33
- $installer->startSetup();
34
-
35
- $_api = Mage::helper('textmaster')->getApi();
36
- $languages = $_api->getLanguages();
37
-
38
- foreach ($languages as $langue){
39
- $admin_locale_code = $langue['code'];
40
- if(substr($admin_locale_code,0,2)=='fr') {
41
- $t1 = "Bonjour, Merci de traduire aussi fidèlement que possible le texte fourni en veillant à bien adapter les tournures et phrases dans votre langue maternelle pour garantir une bonne fluidité du texte. Merci aussi de conserver la mise en forme et les balises HTML.";
42
- $t2 = "Bonjour, Merci de corriger le texte fourni en veillant à conserver la structure du contenu. Vous devez corriger toutes les fautes d'orthographe, de grammaire (etc.) sans modifier l'organisation des phrases. Merci aussi de conserver la mise en forme et les balises HTML.";
43
- } else {
44
- $t1 = "Hello, Please translate as faithfully as possible the text provided while respecting the paragraph structure of the document. Please note that the expected number of words is given as an indication only. Also, please maintain the text format and HTML tags. Thank you.";
45
- $t2 = "Hello, Thank you for proofreading this text. Please maintain the style and vocabulary level and make sure you correct any grammatical error or typo. Also, please maintain the text format and HTML tags. Thank you";
46
- }
47
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/briefing_message_translation_'.$admin_locale_code, 'path');
48
- $configData->setPath('textmaster/defaultvalue/briefing_message_translation_'.$admin_locale_code)
49
- ->setValue($t1)
50
- ->save();
51
-
52
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/briefing_message_proofreading_'.$admin_locale_code, 'path');
53
- $configData->setPath('textmaster/defaultvalue/briefing_message_proofreading_'.$admin_locale_code)
54
- ->setValue($t2)
55
- ->save();
56
- }
57
-
58
-
59
-
60
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.6-0.0.7.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
-
31
-
32
- $installer = $this;
33
- $installer->startSetup();
34
-
35
-
36
- $documents = Mage::getModel('textmaster/document')->getCollection();
37
- foreach($documents as $document) {
38
- $project = Mage::getModel('textmaster/project')->load($document->getTextmasterProjectId(),null,false);
39
- $document->setProject($project);
40
- $product = Mage::getModel('catalog/product')->setStoreId( $project->getStoreIdOrigin() )->load($document->getProductId());
41
- $document->setName($product->getName());
42
- $document->save();
43
- }
44
-
45
-
46
-
47
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-0.0.7-0.0.8.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Addonline
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Textmaster_Textmaster
20
- *
21
- * @category Addonline
22
- * @package Textmaster_Textmaster
23
- * @copyright Copyright (c) 2014 Textmaster
24
- * @author Addonline (http://www.addonline.fr)
25
- */
26
-
27
- /**
28
- * @var $installer Mage_Core_Model_Resource_Setup
29
- */
30
-
31
-
32
- $installer = $this;
33
- $installer->startSetup();
34
-
35
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/type_vocabulary', 'path');
36
- $configData->setPath('textmaster/defaultvalue/type_vocabulary')
37
- ->setValue('not_specified')
38
- ->save();
39
-
40
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/target_audience', 'path');
41
- $configData->setPath('textmaster/defaultvalue/target_audience')
42
- ->setValue('not_specified')
43
- ->save();
44
-
45
- $configData = Mage::getModel('core/config_data')->load('textmaster/defaultvalue/grammatical_person', 'path');
46
- $configData->setPath('textmaster/defaultvalue/grammatical_person')
47
- ->setValue('not_specified')
48
- ->save();
49
-
50
-
51
-
52
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Textmaster/Textmaster/sql/textmaster_setup/mysql4-upgrade-1.0.2-1.0.3.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * @var $installer Mage_Core_Model_Resource_Setup
4
- */
5
-
6
- $installer = $this;
7
- $installer->startSetup();
8
-
9
- $installer->getConnection()
10
- ->addColumn($installer->getTable('textmaster/project'), 'translation_memory', array(
11
- 'type' => Varien_Db_Ddl_Table::TYPE_BOOLEAN,
12
- 'nullable' => false,
13
- 'default' => false,
14
- 'comment' => 'Translation memory'
15
- ));
16
-
17
- $installer->getConnection()
18
- ->addColumn($installer->getTable('textmaster/project'), 'translation_memory_status', array(
19
- 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
20
- 'nullable' => true,
21
- 'default' => null,
22
- 'comment' => 'Translation memory status'
23
- ));
24
-
25
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/textmaster.xml DELETED
@@ -1,135 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Copyright (c) 2014 Textmaster
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * It is available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- *
12
- * @category Textmaster
13
- * @package Textmaster_Textmaster
14
- * @copyright Copyright (c) 2014 Textmaster
15
- * @author Addonline (http://www.addonline.fr)
16
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
- */
18
-
19
- /**
20
- * Addonline_Textmaster
21
- *
22
- * @category Addonline
23
- * @package Addonline_Textmaster
24
- * @copyright Copyright (c) 2014 Textmaster
25
- * @author Addonline (http://www.addonline.fr)
26
- */
27
- -->
28
- <layout version="0.1.0">
29
-
30
- <default>
31
- <reference name="head">
32
- <action method="addItem"><type>skin_js</type><name>js/textmaster/script.js</name></action>
33
- </reference>
34
- </default>
35
- <adminhtml_textmaster_project_index>
36
- <reference name="head">
37
- <action method="addCss">
38
- <name>css/textmaster/styles.css</name>
39
- </action>
40
-
41
-
42
- </reference>
43
- <reference name="content">
44
- <block type="textmaster/adminhtml_credit" name="credit" template="textmaster/credit.phtml" />
45
- <block type="textmaster/adminhtml_project" template="textmaster/grid/container.phtml" name="project" />
46
- </reference>
47
- </adminhtml_textmaster_project_index>
48
- <adminhtml_textmaster_project_login>
49
- <reference name="content">
50
- <block type="core/template" name="credit" template="textmaster/login.phtml" />
51
-
52
- </reference>
53
- </adminhtml_textmaster_project_login>
54
- <adminhtml_textmaster_project_edit>
55
- <reference name="head">
56
- <action method="addJs"><script>prototype/window.js</script></action>
57
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
58
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>
59
- <action method="addCss">
60
- <name>css/textmaster/styles.css</name>
61
- </action>
62
- <action method="addCss">
63
- <name>css/textmaster/styles.css</name>
64
- </action>
65
-
66
-
67
- </reference>
68
- <reference name="content">
69
- <block type="textmaster/adminhtml_credit" name="credit" template="textmaster/credit.phtml" />
70
- </reference>
71
- <reference name="root">
72
- <action method="setTemplate"><template>textmaster/page.phtml</template></action>
73
- </reference>
74
-
75
- </adminhtml_textmaster_project_edit>
76
- <adminhtml_textmaster_project_view>
77
- <reference name="head">
78
- <action method="addCss">
79
- <name>css/textmaster/styles.css</name>
80
- </action>
81
-
82
- </reference>
83
- <reference name="content">
84
- <block type="textmaster/adminhtml_credit" name="credit" template="textmaster/credit.phtml" />
85
- <block type="textmaster/adminhtml_project_view" template="textmaster/view.phtml" name="project.view">
86
- <block type="textmaster/adminhtml_project_view_documents" name="project.view.documents"></block>
87
- </block>
88
- </reference>
89
- <reference name="root">
90
- <action method="setTemplate"><template>textmaster/page.phtml</template></action>
91
- </reference>
92
- </adminhtml_textmaster_project_view>
93
- <adminhtml_textmaster_project_document>
94
-
95
- <reference name="content">
96
- <block type="textmaster/adminhtml_credit" name="credit" template="textmaster/credit.phtml" />
97
- <block type="textmaster/adminhtml_document_view" template="textmaster/document/view.phtml" name="project.document.view">
98
- </block>
99
- <block type="textmaster/adminhtml_document_supportmessage" template="textmaster/document/support_messages.phtml" name="project.document.supportmessage">
100
- </block>
101
- </reference>
102
- <reference name="head">
103
- <action method="addJs"><script>prototype/window.js</script></action>
104
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
105
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>
106
- <action method="addCss">
107
- <name>css/textmaster/styles.css</name>
108
- </action>
109
- <action method="addCss">
110
- <name>css/textmaster/styles.css</name>
111
- </action>
112
- <action method="addItem"><type>skin_js</type><name>js/textmaster/script.js</name></action>
113
- </reference>
114
- <reference name="root">
115
- <action method="setTemplate"><template>textmaster/page.phtml</template></action>
116
- </reference>
117
- </adminhtml_textmaster_project_document>
118
-
119
- <adminhtml_textmaster_project_getmyauthors>
120
- <remove name="menu" />
121
- <remove name="notifications" />
122
- <remove name="header" />
123
- <remove name="footer" />
124
- <reference name="head">
125
- <action method="addCss">
126
- <name>css/textmaster/popin.css</name>
127
- </action>
128
- </reference>
129
- <reference name="content">
130
- <block type="textmaster/adminhtml_project_onglets_step3_author" name="step3_author" as="step3_author">
131
- </block>
132
- </reference>
133
-
134
- </adminhtml_textmaster_project_getmyauthors>
135
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/credit.phtml DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <div class="textmaster-info">
19
- <span class="textmaster-email">
20
- <?php echo Mage::helper('textmaster')->__('Textmaster account'); ?> <?php echo $this->getEmail(); ?>
21
- </span>
22
- <span class="textmaster-credit">
23
- <?php echo Mage::helper('textmaster')->__('Credits:'); ?> <?php echo $this->getCredit(); ?>
24
- <a href="http://textmaster.com/clients/payment_requests/new" target="_blank" ><?php echo Mage::helper('textmaster')->__('Buy credits'); ?></a>
25
- </span>
26
-
27
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/document/support_messages.phtml DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- $_support_messages = $this->getDocument()->getSupportMessages();
19
-
20
- if(isset($_support_messages['support_messages']) && count($_support_messages['support_messages'])) :
21
- ?>
22
- <div class="entry-edit">
23
- <div class="entry-edit-head">
24
- <h4 class="icon-head head-customer-view"><?php echo Mage::helper('textmaster')->__('Support messages'); ?></h4>
25
- </div>
26
- <br/>
27
- <?php foreach($_support_messages['support_messages'] as $message) : ?>
28
- <fieldset>
29
- <?php if($message['written_by_you']) : ?>
30
- <strong><?php echo Mage::helper('textmaster')->__('Written by %s ',Mage::helper('textmaster')->__('you'));?> <?php echo $this->formatTime($message['created_at']['full'], Mage_Core_Model_Locale::FORMAT_TYPE_SHORT,true);?></strong><br/>
31
- <?php else :?>
32
- <strong><?php echo Mage::helper('textmaster')->__('Written by %s ',$message['author_ref']);?> <?php echo $this->formatTime($message['created_at']['full'], Mage_Core_Model_Locale::FORMAT_TYPE_SHORT,true);?></strong><br/>
33
- <?php endif; ?>
34
- <?php echo $message['message']?>
35
- </fieldset>
36
-
37
- <?php endforeach; ?>
38
-
39
- </div>
40
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/document/view.phtml DELETED
@@ -1,102 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- $_document = $this->getDocument();
19
- $_helper = Mage::helper('textmaster');
20
- $_translations = $_document->getTranslations();
21
- ?>
22
- <div class="content-header">
23
- <table cellspacing="0">
24
- <tr>
25
- <td><h3 class="icon-head head-products"><?php echo $_document->getName(); ?></h3></td>
26
- <td class="form-buttons">
27
- <?php echo $this->getButtonsHtml() ?>
28
- </td>
29
- </tr>
30
- </table>
31
- </div>
32
- <div class="textmaster-introduction">
33
- <?php echo $this->getIntroHtml() ?>
34
- <?php echo $_helper->__("Text intro document view")?>
35
- </div>
36
- <div class="entry-edit">
37
- <div class="entry-edit-head"><h4 class="icon-head head-customer-view"><?php echo $_helper->__('File information') ?></h4></div>
38
- <fieldset>
39
- <table cellspacing="2" width="100%">
40
- <tr>
41
- <th width="20%"><?php echo $_helper->__('Elements'); ?></th>
42
- <th width="40%"><?php echo $_helper->__('Text source'); ?></th>
43
- <th width="40%"><?php echo $_helper->__('Translated text'); ?></th>
44
- </tr>
45
- <?php foreach($_document->getProject()->getAttributesFull() as $attribute) : ?>
46
- <tr>
47
- <td><?php $att = Mage::getModel('catalog/product')->getResource()->getAttribute($attribute->getAttributeCode());echo Mage::helper('catalog')->__($att->getFrontend()->getLabel()); ?></td>
48
- <td><?php echo $_document->getProduct()->getData($attribute->getAttributeCode()); ?></td>
49
- <td><?php echo isset($_translations[$attribute->getAttributeCode()])?$_translations[$attribute->getAttributeCode()]:'-'; ?></td>
50
- </tr>
51
- <?php endforeach; ?>
52
-
53
- </table>
54
- </fieldset>
55
- </div>
56
- <script type="text/javascript">// <![CDATA[
57
- var message_completed_document = '<?php echo addslashes($_helper->__('Your product description is being approved, this will take a few moments. You can use Magento in the meantime and then come back to your project to finish it.')); ?>';
58
- function showCompare(url) {
59
- winCompare = new Window({title:'<?php echo addslashes( $_helper->__('Message to author for revision')); ?>',width:820,height:160,minimizable:false,maximizable:false,showEffectOptions:{duration:0.4},hideEffectOptions:{duration:0.4}});
60
- winCompare.setZIndex(100);
61
- winCompare.getContent().update('<textarea class="textarea" id="messageRevision" style="width: 98%;height:100px;margin:10px 0px;" name="message"></textarea><button id="sendMessage" onclick="sendRevision();"><?php echo Mage::helper('textmaster')->__('Send'); ?></button>');
62
- winCompare.showCenter(true);
63
-
64
- }
65
- <?php
66
- $_project = $_document->getProject();
67
- $docs_all = $_project->getDocumentsSendToCompleted();
68
- $docs_notcomp = $_project->getDocumentsSendNotCompleted();
69
- $ndocc = count($docs_notcomp);
70
- $ndoc = count($docs_all);
71
-
72
- if($docs_all && $ndocc) :
73
- $nd = ($ndoc-$ndocc) / $ndoc;
74
- $r = round($nd,2)*100;
75
- ?>
76
- var jQueryCall = function($){
77
- html = '<?php echo $r; ?>%'+'<span class="progress-cadre"><span class="progress" style="width:'+<?php echo $r; ?>+'%"></span></span>';
78
- html += '<span class="message">'+message_completed_document+'</span>';
79
- $('#loading_mask_loader_message').html(html);
80
- $('#loading_mask_loader_message').show(0);
81
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
82
- jQuery('body > .wrapper > .header a').click(function(e){
83
- if(jQuery(this).attr('href')!='') {
84
- e.preventDefault();
85
- if(typeof ajax_request.transport!='undefined')
86
- ajax_request.transport.abort();
87
- window.location = jQuery(this).attr('href');
88
-
89
- }
90
- });
91
- iscomplete('<?php echo $this->getUrl('*/*/doccompleteready',array('id'=>$_project->getId())); ?>');
92
- };
93
- <?php endif; ?>
94
-
95
- function sendRevision (){
96
- url = '<?php echo $this->getUrl('*/*/revision',array('id'=>$this->getDocument()->getId()));?>message/'+$('messageRevision').getValue();
97
- //console.log(url);
98
- window.location=url;
99
- }
100
- // ]]></script>
101
- <?php
102
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/form/container.phtml DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <?php
19
- /**
20
- * @see Mage_Adminhtml_Block_Widget_Form_Container
21
- */
22
- ?>
23
- <?php echo $this->getFormInitScripts() ?>
24
- <div class="content-header">
25
- <?php echo $this->getHeaderHtml() ?>
26
- <p class="form-buttons"><?php echo $this->getButtonsHtml('header') ?></p>
27
- </div>
28
- <div class="textmaster-introduction">
29
- <?php echo $this->getIntroHtml() ?>
30
- Lorem ipsum dolor sit amet, labores alienum pri ex.
31
- No pri idque molestiae temporibus, eam quando detraxit at.
32
- Usu maiestatis sadipscing ad, sea te graece mnesarchum, nisl nemore denique ei his.
33
- Eu quo decore malorum omnesque, ne utroque lucilius vel. Mea solet pericula ut. Per ludus invenire te.
34
- </div>
35
- <?php echo $this->getFormHtml() ?>
36
- <?php if ($this->hasFooterButtons()): ?>
37
- <div class="content-footer">
38
- <p class="form-buttons"><?php echo $this->getButtonsHtml('footer') ?></p>
39
- </div>
40
- <?php endif; ?>
41
- <script type="text/javascript">
42
- editForm = new varienForm('edit_form', '<?php echo $this->getValidationUrl() ?>');
43
- </script>
44
- <?php echo $this->getFormScripts() ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/grid/container.phtml DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <div class="content-header">
19
- <table cellspacing="0">
20
- <tr>
21
- <td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml() ?></td>
22
- <td class="form-buttons"><?php echo $this->getButtonsHtml() ?></td>
23
- </tr>
24
- </table>
25
- </div>
26
- <div class="textmaster-introduction">
27
- <?php echo $this->getIntroHtml() ?>
28
- <?php echo Mage::helper('textmaster')->__('The list below shows all of your TextMaster translation and proofreading projects.'); ?>
29
- <br/>
30
- <?php echo Mage::helper('textmaster')->__("To see a project's details, click on ''View'' in the last column. To start a translation project or to proofread your product descriptions, click on the ''New Project'' button."); ?>
31
- </div>
32
- <div>
33
- <?php echo $this->getGridHtml() ?>
34
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/login.phtml DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <p>
19
- <?php
20
- echo Mage::helper('textmaster')->__('You need to be logged in to use this plugin.');
21
- ?>
22
- <br/>
23
- <a href="<?php echo Mage::helper("adminhtml")->getUrl('adminhtml/system_config/edit/section/textmaster'); ?>">
24
- <?php
25
- echo Mage::helper('textmaster')->__('Click here to log in or to create a TextMaster account.');
26
- ?>
27
- </a>
28
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/onglet.phtml DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- $step = (isset($step)) ? $step : 1;
19
-
20
- $selectedProducts = Mage::getSingleton('core/session')->getSelectedProducts();
21
-
22
- $steps = array(
23
- 1 => array("label" => Mage::helper('textmaster')->__("Select products")),
24
- 2 => array("label" => Mage::helper('textmaster')->__("Project Settings")),
25
- 3 => array("label" => Mage::helper('textmaster')->__("Project Summary"))
26
- );
27
- ?>
28
- <?php echo $this->getFormInitScripts() ?>
29
- <div class="content-header">
30
- <h3><?php echo Mage::helper("textmaster")->__('New Project')?></h3>
31
- <p class="form-buttons"><?php echo $this->getButtonsHtml('header') ?></p>
32
- </div>
33
- <div class="textmaster-introduction">
34
- <?php echo $this->getIntroHtml() ?>
35
- </div>
36
- <ol class="steps_project">
37
- <?php for($i = 1; $i <=3 ; $i++){
38
- $class = ($i == $step) ? "current" : (($i > $step) ? "disabled" : "");
39
- ?>
40
- <li class="step<?php echo $i;?> <?php echo $class; ?>">
41
- <span>
42
- <?php if($i < $step){?>
43
- <a href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/textmaster_project/edit" , array('step' => $i , '_query' => array('internal_products_id' => implode("," , $selectedProducts))));?>">
44
- <?php echo $steps[$i]["label"];?>
45
- </a>
46
- <?php } else {
47
- echo $steps[$i]["label"];
48
- }?>
49
- </span>
50
- </li>
51
- <?php } ?>
52
- </ol>
53
- <table width="100%">
54
- <tr>
55
- <td width="67%"><?php echo $this->getChildHtml('textmaster.step2'); ?></td>
56
- <td width="3%">&nbsp;</td>
57
- <td width="30%"><?php echo $this->getChildHtml('textmaster.summary'); ?></td>
58
- </tr>
59
- </table>
60
-
61
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/onglet/popinauthors.phtml DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <script type="text/javascript">// <![CDATA[
19
-
20
- function showAuthors(url) {
21
- winCompare = new Window({title:'<?php echo $_helper->__('Message to author for revision'); ?>',width:820,height:160,minimizable:false,maximizable:false,showEffectOptions:{duration:0.4},hideEffectOptions:{duration:0.4}});
22
- winCompare.setZIndex(100);
23
- //winCompare.getContent().update('<textarea class="textarea" id="messageRevision" style="width: 98%;height:100px;margin:10px 0px;" name="message"></textarea><button id="sendMessage" onclick="sendRevision();">Send</button>');
24
- winCompare.showCenter(true);
25
-
26
- }
27
- function sendRevision (){
28
- url = '<?php echo $this->getUrl('*/*/revision',array('id'=>$this->getDocument()->getId()));?>message/'+$('messageRevision').getValue();
29
- //console.log(url);
30
- window.location=url;
31
- }
32
- // ]]></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/page.phtml DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
19
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
20
- <head>
21
- <?php echo $this->getChildHtml('head') ?>
22
- </head>
23
-
24
- <body id="html-body"<?php echo $this->getBodyClass() ? ' class="' . $this->getBodyClass() . '"' : ''; ?>>
25
- <?php echo $this->getChildHtml('notification_window'); ?>
26
- <div class="wrapper">
27
- <?php echo $this->getChildHtml('global_notices') ?>
28
- <div class="header">
29
- <?php echo $this->getChildHtml('header') ?>
30
- <div class="clear"></div>
31
- <?php echo $this->getChildHtml('menu') ?>
32
- </div>
33
- <?php echo $this->getChildHtml('notifications'); ?>
34
- <div class="middle" id="anchor-content">
35
- <div id="page:main-container">
36
- <?php if($this->getChildHtml('left')): ?>
37
-
38
- <div class="columns <?php echo $this->getContainerCssClass() ?>">
39
- <div class="side-col" id="page:left">
40
- <?php echo $this->getChildHtml('left') ?>
41
- </div>
42
- <div class="main-col" id="content">
43
- <div class="main-col-inner">
44
- <div id="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
45
- <?php echo $this->getChildHtml('content') ?>
46
- </div>
47
- </div>
48
- </div>
49
-
50
- <?php else: ?>
51
- <div id="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
52
- <?php echo $this->getChildHtml('content') ?>
53
- <?php endif; ?>
54
- </div>
55
- </div>
56
- <div class="footer">
57
- <?php echo $this->getChildHtml('footer') ?>
58
- </div>
59
- </div>
60
- <?php echo $this->getChildHtml('js') ?>
61
- <?php echo $this->getChildHtml('profiler') ?>
62
- <div id="loading-mask" style="display:none">
63
- <p class="loader textmasterloading" id="loading_mask_loader"><img src="<?php echo $this->getSkinUrl('images/ajax-loader-tr.gif') ?>" alt="<?php echo Mage::helper('adminhtml')->__('Loading...') ?>"/><br/><span id="loading_mask_loader_message"><?php echo Mage::helper('adminhtml')->__('Please wait...') ?></span></p>
64
- </div>
65
- <?php echo $this->getChildHtml('before_body_end') ?>
66
-
67
- </body>
68
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/product/edit.phtml DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Addonline_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
- ?>
18
- <div class="content-header">
19
- <h3 class="icon-head head-products"><?php echo Mage::helper('textmaster')->__('Translations');?></h3>
20
- </div>
21
- <?php
22
- $user = Mage::helper('textmaster')->getApi()->getUserInfo();
23
- if(!isset($user['email'])) {
24
- ?>
25
- <?php echo Mage::helper('textmaster')->__('Veuillez configurer le module Textmaster afin de traduire votre produit');
26
- return; ?>
27
- <?php } ?>
28
- <?php
29
- if (!$this->getRequest()->getParam('store')) {
30
- ?>
31
- <ul class="messages" style="margin-bottom: 20px;"><li class="notice-msg"><?php echo $this->__('You are viewing default/website values. Please select a store view (from left) to see translation options.') ?></li></ul><?php
32
- return;
33
- }
34
- ?>
35
- <div style="margin-bottom: 30px;font-size:13px;"><a href="<?php echo Mage::helper("adminhtml")->getUrl('adminhtml/textmaster_project/createprojectfromproduct',array('id'=>Mage::app()->getRequest()->getParam('id'))); ?>"><?php echo Mage::helper('textmaster')->__('Translate product');?></a></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/textmaster/view.phtml DELETED
@@ -1,148 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2014 Textmaster
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * It is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Textmaster
12
- * @package Textmaster_Textmaster
13
- * @copyright Copyright (c) 2014 Textmaster
14
- * @author Addonline (http://www.addonline.fr)
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- $_project = $this->getProject();
19
- $_helper = Mage::helper('textmaster');
20
-
21
- ?>
22
- <div class="content-header">
23
- <table cellspacing="0">
24
- <tr>
25
- <td><h3 class="icon-head head-products"><?php echo $_project->getName(); ?></h3></td>
26
- <td class="form-buttons">
27
- <?php echo $this->getButtonsHtml() ?>
28
- </td>
29
- </tr>
30
- </table>
31
- </div>
32
- <div class="textmaster-introduction">
33
- <?php echo $this->getIntroHtml() ?>
34
- <?php echo Mage::helper('textmaster')->__('Vous pouvez suivre le statut de chaque fiche de votre projet. Si votre fiche est en cours de révision, cliquez sur "voir" pour consulter le texte soumis par l\'auteur. Vous avez en tout 7 jours pour valider une fiche ou demander une révision une fois celle-ci traitée par l\'auteur.');?>
35
- </div>
36
- <div class="entry-edit">
37
- <div class="entry-edit-head"><h4 class="icon-head head-customer-view"><?php echo $_helper->__('Project Information') ?></h4></div>
38
- <fieldset>
39
- <table cellspacing="2" class="box-left">
40
- <tr>
41
- <td width="200"><?php echo $_helper->__('Type of project:'); ?></td>
42
- <td><?php echo $_helper->__($_project->getCtype()); ?></td>
43
- </tr>
44
- <tr>
45
- <td><?php echo $_helper->__('Source language:'); ?></td>
46
- <td><?php echo $_project->getStoreNameOrigin(); ?></td>
47
- </tr>
48
- <tr>
49
- <td><?php echo $_helper->__('Word count:'); ?></td>
50
- <td><?php echo (int)$_project->getTotalWordCount(); ?></td>
51
- </tr>
52
- <?php if ($_helper->showProjectDiffWordCount($_project)): ?>
53
- <tr>
54
- <td><?php echo $_helper->__('Nb words that you saved:'); ?></td>
55
- <td><?php echo $_project->getDiffWordCount() ?></td>
56
- </tr>
57
- <?php endif ?>
58
- <tr>
59
- <td><?php echo $_helper->__('Level:'); ?></td>
60
- <td><?php echo $_project->getLanguageLevelTexte(); ?></td>
61
- </tr>
62
- <tr>
63
- <td><?php echo $_helper->__('Single author:'); ?></td>
64
- <td><?php echo $_project->getSameAuthorMustDoEntireProject()?$_helper->__('Yes'):$_helper->__('No'); ?></td>
65
- </tr>
66
- <tr>
67
- <td><?php echo $_helper->__('Briefing:'); ?></td>
68
- <td><?php echo $_project->getProjectBriefing(); ?></td>
69
- </tr>
70
- </table>
71
- <table cellspacing="2" class="box-right">
72
- <tr>
73
- <td width="200"><?php echo $_helper->__('Status:'); ?></td>
74
- <td><?php echo $_project->getStatusTexte(); ?></td>
75
- </tr>
76
-
77
- <tr>
78
- <td><?php echo $_helper->__('Target language:'); ?></td>
79
- <td><?php echo $_project->getStoreNameTranslation(); ?></td>
80
- </tr>
81
- <tr>
82
- <td><?php echo $_helper->__('Price:'); ?></td>
83
- <td><?php echo $_project->getPrice(); ?></td>
84
- </tr>
85
- <tr>
86
- <td><?php echo $_helper->__('Reference:'); ?></td>
87
- <td><?php echo $_project->getReference(); ?></td>
88
- </tr>
89
- <tr>
90
- <td><?php echo $_helper->__('Nombre de textmasters :'); ?></td>
91
- <td><?php echo count($_project->getTextmasters()); ?></td>
92
- </tr>
93
- <tr>
94
- <td><?php echo $_helper->__('Options:'); ?></td>
95
- <td>
96
- <?php echo $_project->getQuality()?Mage::helper( 'textmaster' )->__( 'Quality control' ).'<br/>':''; ?>
97
- <?php echo $_project->getPriority()?Mage::helper( 'textmaster' )->__( 'Priority order' ).'<br/>':''; ?>
98
- <?php echo $_project->getExpertise()?Mage::helper( 'textmaster' )->__( 'Expertise' ).'<br/>':''; ?>
99
- <?php echo $_project->getTranslationMemory()?Mage::helper( 'textmaster' )->__( 'Translation memory' ).'<br/>':''; ?>
100
- </td>
101
- </tr>
102
- </table>
103
-
104
- </fieldset>
105
- </div>
106
- <div class="content-header">
107
- <h3 class="icon-head head-products"><?php echo $_helper->__('Documents'); ?></h3>
108
- </div>
109
-
110
- <?php
111
- echo $this->getChildrenHtml('project.view.documents'); ?>
112
- <script type="text/javascript">// <![CDATA[
113
- var message_completed_document = '<?php echo addslashes($_helper->__('Your product descriptions are being approved. This will take a few minutes if you have many. You can use Magento in the meantime and then come back to your project to finish it.')); ?>';
114
-
115
- var jQueryCall = function($){
116
- <?php echo $this->getChild('project.view.documents')->getId().'_massactionJsObject'?>.setUseAjax(true);
117
- <?php
118
- $docs_all = $_project->getDocumentsSendToCompleted();
119
- $docs_notcomp = $_project->getDocumentsSendNotCompleted();
120
- $ndocc = count($docs_notcomp);
121
- $ndoc = count($docs_all);
122
-
123
- if($docs_all && $ndocc) :
124
- $nd = ($ndoc-$ndocc) / $ndoc;
125
- $r = round($nd,2)*100;
126
- ?>
127
- html = '<?php echo $r; ?>%'+'<span class="progress-cadre"><span class="progress" style="width:'+<?php echo $r; ?>+'%"></span></span>';
128
- html += '<span class="message">'+message_completed_document+'</span>';
129
- $('#loading_mask_loader_message').html(html);
130
- $('#loading_mask_loader_message').show(0);
131
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
132
- jQuery('body > .wrapper > .header a').click(function(e){
133
- if(jQuery(this).attr('href')!='') {
134
- e.preventDefault();
135
- if(typeof ajax_request.transport!='undefined')
136
- ajax_request.transport.abort();
137
- window.location = jQuery(this).attr('href');
138
-
139
- }
140
- });
141
- iscomplete('<?php echo $this->getUrl('*/*/doccompleteready',array('id'=>$_project->getId())); ?>');
142
- <?php endif; ?>
143
- };
144
- //]]></script>
145
- <?php
146
- //var_dump($this->getChild('project.view.documents')->debug());
147
- //foreach($this->getChild('project.view.documents')->getChild() as $child) var_dump($child->debug());
148
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Textmaster_Textmaster.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Textmaster_Textmaster>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </Textmaster_Textmaster>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/locale/en_US/Textmaster_Textmaster.csv DELETED
@@ -1,195 +0,0 @@
1
- My Projects,My Projects
2
- New Project,New Project
3
- Update file,Update file
4
- Put in revision,Ask for a revision
5
- Name,Name
6
- Reference,Reference
7
- Source language,Source language
8
- Langue de destination,Target language
9
- Level,Level
10
- Number of documents,Number of documents
11
- Total word count,Total word count
12
- Progression,Progress
13
- Status,Status
14
- Last change,Last change
15
- Actions,Actions
16
- Launch,Order
17
- Pause,Pause
18
- Resume,Resume
19
- Complete,Complete
20
- Complete file,Complete file
21
- Duplicate,Duplicate
22
- Continue,Continue
23
- Update product,Update product
24
- Type,Type
25
- Missing translation:,Missing translation:
26
- Traduction existante,Existing translation
27
- Project,Project
28
- Fields to translate,Fields to translate
29
- Product informations,Product information
30
- Select all,Select all
31
- Deselect all,Deselect all
32
- Nouveau message variable,Your project is being created. This will take a few minutes if you have many product descriptions. You can use Magento in the meantime and then come back to your project to finish it.
33
- Your product descriptions are being approved. This will take a few minutes if you have many. You can use Magento in the meantime and then come back to your project to finish it.,Your product descriptions are being approved. This will take a few minutes if you have many. You can use Magento in the meantime and then come back to your project to finish it.
34
- Languages,Languages
35
- Select a language,Select a language
36
- Pricing options,Pricing options
37
- Service level,Service level
38
- Regular (%s/word): native-speaking translator for word-for-word translations of short texts.,Basic (%s/word): native-speaking translator for literal translations of short texts.
39
- Premium (%s/word): experienced translator; suitable for business use.,Premium (%s/word): experienced translator; suitable for business use.
40
- Enterprise (%s/word): professional translator specialized in a specific field; suitable for technical or complex content.,Enterprise (%s/word): professional translator specialized in a specific field; suitable for technical or complex content.
41
- Quality Control (+%s/word),Quality Control (+%s/word)
42
- No,No
43
- Yes,Yes
44
- The translator's work will be proofread and corrected by TextMaster,The translator's work will be proofread and corrected by TextMaster.
45
- Priority Order (+%s/word),Priority Order (+%s/word)
46
- Your project will be assigned a higher priority status.,Your project will be assigned a higher priority status.
47
- Expertise (+%s/word),Expertise (+%s/word)
48
- We provide you with an expert in the selected category.,We provide you with an expert in the selected category.
49
- Instructions du projet,Project Instructions
50
- Briefing,Briefing
51
- Select a category,Select a category
52
- Category (optional),Category (optional)
53
- Single Author (Assign the entire project to a single TextMaster),Single Author (Assign the entire project to a single TextMaster)
54
- "Ensures better continuity, but longer turnaround time","Ensures better continuity, but longer turnaround time"
55
- Project Summary,Project Summary
56
- Type of project,Type of project
57
- Total word count,Total word count
58
- Total cost,Total cost
59
- Level and options,Level and options
60
- Project's name,Project name
61
- Favorite authors,Favorite authors
62
- Add credits to my TextMaster account,Add credits to my TextMaster account
63
- %s/word,%s/word
64
- Textmaster(s) chosen:,TextMaster(s) chosen:
65
- none,none
66
- My Textmasters,My TextMasters
67
- Choose your TextMasters,Choose your TextMasters
68
- Order Summary,Order Summary
69
- Project,Project
70
- Word count,Word count
71
- Level and options,Level and options
72
- Price,Price
73
- Choose your textmaster for the project,Choose your TextMasters for the project
74
- Action,Action
75
- Wrong login / password,Wrong login / password
76
- Could not get API key / secret,Could not get API key / secret
77
- Connected to textmaster,Connected to TextMaster
78
- Email invalid,Email invalid
79
- Password mandatory,Password mandatory
80
- Could not get access token,Could not get access token
81
- Your account has been successfully created.,Your account has been successfully created.
82
- "Select the list of products to translate or proofread. Use the filter in the last column to select the product descriptions that haven't been translated yet. If the product description has already been translated on TextMaster, a flag will appear beside each completed translation.","Select the list of products to translate or proofread. Use the filter in the last column to select the product descriptions that haven't been translated yet. If the product description has already been translated on TextMaster, a flag will appear beside each completed translation."
83
- "Fill out the project details and choose the service level and extra options. Give translator or proofreader special instructions (specific terms, layout guidelines, etc.)","Fill out the project details and choose the service level and extra options. Give the translator or proofreader special instructions (specific terms, layout guidelines, etc.)"
84
- "Verify your project setting before placing your order. If you do not have enough credits on TextMaster, click on the link below to add credits to your account on TextMaster.com","Verify your project settings before placing your order. If you do not have enough credits on TextMaster, click on the link below to add credits to your account on TextMaster.com"
85
- Project creation error,Error creating project
86
- No post,No post
87
- Regular,Basic
88
- Premium,Premium
89
- Not specified,Not specified
90
- Popular,Popular
91
- Technique,Technical
92
- Fictional,Fictional
93
- I,I
94
- You,You
95
- He,He
96
- She,She
97
- One,One
98
- We,We
99
- They,They
100
- Children under 14 years old,Children under 14 years old
101
- Teenagers > between 14 and 18 years old,Teenagers > between 14 and 18 years old
102
- Young adults > between 19 and 29 years old,Young adults > between 19 and 29 years old
103
- Adults > between 30 and 59 years old,Adults > between 30 and 59 years old
104
- Seniors > 60 years old and beyond,Seniors > 60 years old and beyond
105
- completed,Completed
106
- In creation,In creation
107
- Waiting assignment,Awaiting assignment
108
- In progress,In progress
109
- In review,In review
110
- Completed,Completed
111
- Incomplete,Incomplete
112
- Paused,Paused
113
- Cancelled,Canceled
114
- Copyscape,Copyscape
115
- Counting words,Counting words
116
- Quality control,Quality control
117
- Control Quality,Quality control
118
- Expertise,Expertise
119
- Priority,Priority
120
- launch,Order
121
- paused,paused
122
- resumed,resumed
123
- canceled,canceled
124
- word,word
125
- You need to be logged in to use this plugin.,You need to be logged in to use this plugin.
126
- Click here to log in or to create a TextMaster account.,Click here to log in or to create a TextMaster account.
127
- Project Information,Project Information
128
- Type of project:,Type of project:
129
- Source language:,Source language:
130
- Word count:,Word count:
131
- Level,Level
132
- Level:,Level:
133
- Single author::,Single author:
134
- Briefing :,Briefing:
135
- Status:,Status:
136
- Target language,Target language
137
- Target language:,Target language:
138
- Price:,Price:
139
- Reference:,Reference:
140
- Nombre de textmasters :,Number of TextMasters:
141
- Options:,Options:
142
- Quality control,Quality control
143
- Priority order,Priority order
144
- Expertise,Expertise
145
- Documents,Documents
146
- Support messages,Support messages
147
- Written by %s ,Written by %s
148
- Text intro document view,"You can view the file submitted by the translator/proofreader below. If you are satisfied with the content, click on \""Update file\"". Otherwise, you can ask for a revision by explaining what elements need to be changed."
149
- File information,File information
150
- Elements,Elements
151
- Text source,Source text
152
- Translated text,Translated text
153
- Message to author for revision,Message to author for revision
154
- Translations,Translations
155
- You are viewing default/website values. Please select a store view (from left) to see translation options.,You are viewing default/website values. Please select a store view (from left) to see translation options.
156
- Translate product,Translate product
157
- TextMaster Login,TextMaster Login
158
- Create your account,Create your account
159
- The list below shows all of your TextMaster translation and proofreading projects.,The list below shows all of your TextMaster translation and proofreading projects.
160
- "To see a project's details, click on ''View'' in the last column. To start a translation project or to proofread your product descriptions, click on the ''New Project'' button.","To see a project's details, click on ''View'' in the last column. To start a translation project or to proofread your product descriptions, click on the ''New Project'' button."
161
- Crédit disponible :,Available credits:
162
- Crédit manquant :,Missing credits:
163
- Credits:,Credits:
164
- Textmaster account,TextMaster account:
165
- word(s),word(s)
166
- translation,translation
167
- proofreading,proofreading
168
- Translation,Translation
169
- Proofreading,Proofreading
170
- Select products,Select Product
171
- Propriétés du projet,Project Settings
172
- Textmasters saved,TextMasters saved
173
- You do not have any authors in your Favorites list,You do not have anyone in your Favorite TextMasters list
174
- Project does not exist,Project does not exist
175
- Buy credits,Buy credits
176
- Manage Projects,Manage Projects
177
- Activities,Services
178
- Product Default Language,Product Default Language
179
- Briefing message for proofreading,Briefing message for proofreading
180
- Briefing message for translation,Briefing message for translation
181
- Category,Category
182
- Type of vocabulary,Type of vocabulary
183
- Target audience,Target audience
184
- Grammatical Person,Grammatical Person
185
- Default values,Default values
186
- Email,Email
187
- Password,Password
188
- Confirm password,Confirm password
189
- Phone,Phone
190
- Create your free account,Create your free account
191
- Connexion,Log in
192
- Login,Login
193
- Searching...,Searching...
194
- Logout,Logout
195
- "message_loader_tm","The translation memory is in progress. This will take a few minutes if you have many product descriptions. You can use Magento in the meantime and then come back to your project to finish it."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/fr_FR/Textmaster_Textmaster.csv DELETED
@@ -1,215 +0,0 @@
1
- My Projects,Mes projets
2
- New Project,Nouveau projet
3
- Update file,Mettre à jour la fiche
4
- Put in revision,Demander une révision
5
- Name,Nom
6
- Reference,Référence
7
- Source language,Langue source
8
- Langue de destination,Langue de destination
9
- Level,Level
10
- Number of documents,Nombre de fiches produit
11
- Total word count,Nombre de mots total
12
- Progression,Progression
13
- Status,Statut
14
- Last change,Dernière modification
15
- Actions,Actions
16
- Launch,Lancer
17
- Pause,Pause
18
- Resume,Resume
19
- Complete,Completer
20
- Complete file,Valider la fiche
21
- Duplicate,Dupliquer
22
- Continue,Continuer
23
- Update product,Mettre à jour la fiche produit
24
- Type,Type
25
- "Missing translation: ","Traduction manquante : "
26
- Traduction existante,Traduction existante
27
- Project,Projet
28
- Fields to translate,Champs à traduire
29
- Product informations,Product informations
30
- Select all,Sélectionner tout
31
- Deselect all,Déselectionner tout
32
- Nouveau message variable,Votre projet est en cours de création. Cela prendre quelques minutes s'il contient beaucoup de fiches produits. Vous pouvez continuer votre navigation dans Magento et revenir ensuite finaliser votre projet.
33
- Your product descriptions are being approved. This will take a few minutes if you have many. You can use Magento in the meantime and then come back to your project to finish it.,Vos fiches sont en cours de validation. Cela prendre quelques minutes s'il contient beaucoup de fiches produits. Vous pouvez continuer votre navigation dans Magento et revenir ensuite finaliser votre projet.
34
- Languages,Langues
35
- Select a language,Sélectionner une langue
36
- Pricing options,Options tarifaires
37
- Service level,Niveau de qualité
38
- Regular (%s/word): native-speaking translator for word-for-word translations of short texts.,"Regular (%s / mot) : traducteur natif, traduction litérale adaptée pour des textes très courts."
39
- Standard (%s/word): Qualified native-speaking translators - best for short and simple projects.,"Standard (%s / mot) : Traducteur natif qualifié - adapté pour les projets simples et peu volumineux."
40
- Enterprise (%s/word): Professional translators - best for complex projects or high volume catalogs.,"Enterprise (%s / mot) : Traducteur professionnel - recommandé pour les traductions de catalogue complets ou fiches produits complexes."
41
- Quality Control (+%s/word),Contrôle qualité (+%s / mot)
42
- No,Non
43
- Yes,Oui
44
- The translator's work will be proofread and corrected by TextMaster,Le travail de l'auteur sera relu et corrigé par TextMaster.
45
- Priority Order (+%s/word),Commande prioritaire (+%s / mot)
46
- Your project will be assigned a higher priority status.,Votre projet sera mis en avant et placé en haut de liste.
47
- Expertise (+%s/word),Expertise (+%s / mot)
48
- We provide you with an expert in the selected category.,Nous vous trouvons un expert dans le domaine de votre choix.
49
- Instructions du projet,Instructions du projet
50
- Briefing,Briefing
51
- Select a category,Sélectionner une catégorie
52
- Category (optional),Catégorie (optionnel)
53
- Single Author (Assign the entire project to a single TextMaster),Auteur unique (l'ensemble du projet sera traité par un seul auteur)
54
- "Ensures better continuity, but longer turnaround time",Meilleure homogénéité éditoriale mais temps de traitement plus long
55
- Project Summary,Récapitulatif du projet
56
- Type of project,Type de projet
57
- Total word count,Nombre total de mots
58
- Total cost,Coût total du projet
59
- Level and options,Niveau et options
60
- Project's name,Nom du projet
61
- Favorite authors,Auteurs favoris
62
- Add credits to my TextMaster account,Commander des crédits manquants
63
- %s/word,Soit %s / mot
64
- Textmaster(s) chosen:,Textmaster(s) choisie(s) :
65
- none,aucun
66
- My Textmasters,Mes Textmasters
67
- Choose your TextMasters,Sélectionner des TextMasters
68
- Order Summary,Récapitulatif de la commande
69
- Project,Projet
70
- Word count,Nombre de mots
71
- Level and options,Niveau et options
72
- Price,Prix
73
- Choose your textmaster for the project,Choisissez votre TextMaster pour le projet
74
- Action,Action
75
- Wrong login / password,Mauvais identifiant / mot de passe
76
- Could not get API key / secret,Impossible de récupérer votre clé API
77
- Connected to textmaster,Connecter à TextMaster
78
- Email invalid,Email invalide
79
- Password mandatory,Mot de passe obligatoire
80
- Could not get access token,Impossible de récupérer le token d'accès
81
- Your account has been successfully created.,Votre compte a été créé avec succès.
82
- "Select the list of products to translate or proofread. Use the filter in the last column to select the product descriptions that haven't been translated yet. If the product description has already been translated on TextMaster, a flag will appear beside each completed translation.","Sélectionnez la liste des produits à traduire ou à corriger. Utilisez le filtre dans la dernière colonne pour sélectionner les fiches produits qui n'ont pas encore été traduites. Si la fiche produit a déjà été traduite sur Textmaster, un drapeau apparaît pour chaque traduction effectuée."
83
- "Fill out the project details and choose the service level and extra options. Give translator or proofreader special instructions (specific terms, layout guidelines, etc.)","Définissez les propriétés de votre projet ainsi que le niveau de qualité souhaité et les options à la carte. Enfin, précisez vos instructions au traducteur ou au correcteur (termes spécifiques, instructions de mise en forme, etc.)."
84
- "Verify your project setting before placing your order. If you do not have enough credits on TextMaster, click on the link below to add credits to your account on TextMaster.com","Vérifiez les informations de votre projet avant de lancer votre commande. Si votre solde de crédit TextMaster est insuffisant, cliquez sur le lien ci-dessous pour créditer votre compte sur TextMaster.com"
85
- Project creation error,Erreur lors de la création du projet
86
- No post,Pas de post
87
- Regular,Regular
88
- Premium,Premium
89
- Not specified,Non spécifié
90
- Popular,Populaire
91
- Technique,Technique
92
- Fictional,Fictional
93
- I,Je
94
- You,Vous
95
- He,Il
96
- She,Elle
97
- One,Un
98
- We,Nous
99
- They,Ils
100
- Children under 14 years old,Enfants en dessous de 14 ans
101
- Teenagers > between 14 and 18 years old,Adolescents entre 14 et 18 ans
102
- Young adults > between 19 and 29 years old,Jeunes adultes de 19 à 29 ans
103
- Adults > between 30 and 59 years old,Adultes en 30 et 59 ans
104
- Seniors > 60 years old and beyond,Seniors au dessus de 60 ans
105
- completed,Terminé
106
- In creation,En création
107
- Waiting assignment,En attente d'attribution
108
- In progress,In progress
109
- In review,Revue en cours
110
- Completed,Terminé
111
- Incomplete,Incomplet
112
- Paused,En pause
113
- Cancelled,Annulé
114
- Copyscape,Copyscape
115
- Counting words,Comptage des mots
116
- Quality control,Contrôle qualité
117
- Control Quality,Contrôle qualité
118
- Expertise,Expertise
119
- Priority,Prioritaire
120
- launch,Lancer
121
- paused,En pause
122
- resumed,Reprendre
123
- canceled,Annulé
124
- worth,soit
125
- word,mot
126
- You need to be logged in to use this plugin.,Vous devez être connecté pour utiliser le module.
127
- Click here to log in or to create a TextMaster account.,Cliquer ici pour vous identifier ou créer un compte TextMaster
128
- Project Information,Informations sur le projet
129
- Type of project:,Type de projet :
130
- Source language:,Langue source :
131
- Word count:,Nombre de mots :
132
- Level,Niveau
133
- Level:,Niveau :
134
- Single author:,Auteur unique :
135
- Single author,Auteur unique
136
- Briefing :,Briefing :
137
- Status:,Statut :
138
- Target language,Langue de destination
139
- Target language:,Langue de destination :
140
- Price:,Prix :
141
- Reference:,Référence :
142
- Nombre de textmasters :,Nombre de textmasters :
143
- Options:,Options :
144
- Quality control,Contrôle qualité
145
- Priority order,Commande prioritaire
146
- Expertise,Expertise
147
- Documents,Documents
148
- Support messages,Support messages
149
- Written by %s ,Ecrit par %s le
150
- Text intro document view,"Vous pouvez consulter la fiche traitée par l'auteur ci-dessous. Si le contenu vous convient, cliquez sur Mettre à jour la fiche. Sinon vous pouvez demander une révision à l'auteur en précisant les élements à modifier ou adapter."""
151
- File information,Informations sur la fiche
152
- Elements,Eléments
153
- Text source,Texte source
154
- Translated text,Texte traduit
155
- Message to author for revision,Message pour l'auteur en vue d'une revision
156
- Translations,Traductions
157
- You are viewing default/website values. Please select a store view (from left) to see translation options.,Veuillez sélectionner la langue dans la liste “store view” sur la gauche pour démarrer la traduction de votre produit.
158
- Translate product,Traduire le produit
159
- TextMaster Login,Login TextMaster
160
- Create your account,Créer votre compte
161
- The list below shows all of your TextMaster translation and proofreading projects.,La liste ci-dessous rassemble tous vos projets de traduction ou de correction lancés sur TextMaster.
162
- "To see a project's details, click on ''View'' in the last column. To start a translation project or to proofread your product descriptions, click on the ''New Project'' button.","Pour entrer dans le détail d'un de vos projets, cliquez sur ''Voir'' dans la dernière colonne du tableau. Pour commencer à traduire ou faire corriger vos fiches produits, cliquer sur le bouton ''Nouveau projet''. "
163
- Available credits:,Crédits disponibles :
164
- Crédit manquant :,Crédits manquants :
165
- Credits:,Crédits :
166
- Textmaster account,Compte TextMaster :
167
- word(s),mot(s)
168
- translation,traduction
169
- proofreading,rédaction
170
- Translation,Traduction
171
- Translate,Traduction
172
- Proofreading,Rédaction
173
- Select products,Sélectioner les produits
174
- Propriétés du projet,Propriétés du projet
175
- Send,Envoyer
176
- you,vous
177
- Textmasters saved,TextMasters sauvegardés
178
- You do not have any authors in your Favorites list,Vous n'avez pas d'auteurs favoris.
179
- Project does not exist,Le projet n'existe pas
180
- "Your product description is being approved, this will take a few moments. You can use Magento in the meantime and then come back to your project to finish it.","Cette fiche est en cours de validation, cela prendra quelques instants. Vous pouvez continuer votre navigation dans Magento et revenir ensuite finaliser votre projet."
181
- Buy credits,Acheter des crédits
182
- Manage Projects,Gérer les projets
183
- Activities,Type de projet
184
- Product Default Language,Langages par défaut des produits
185
- Briefing message for proofreading,Briefing par défaut pour la rédaction
186
- Briefing message for translation,Briefing par défaut pour la traduction
187
- Category,Catégorie
188
- Type of vocabulary,Type de vocabulaire
189
- Target audience,Audience ciblé
190
- Grammatical Person,Personne grammaticale
191
- Default values,Valeurs par défaut
192
- Email,Email
193
- Password,Mot de passe
194
- Confirm password,Confirmer votre mot de passe
195
- Phone,Téléphone
196
- Create your free account,Créez votre compte gratuitement
197
- Connexion,Connexion
198
- Login,Identifiant
199
- Searching...,Searching...
200
- Logout,Déconnexion
201
- "message_loader_tm","La mémoire de traduction est en cours, cela prendre quelques minutes s'il contient beaucoup de fiches produits. Vous pouvez continuer votre navigation dans Magento et revenir ensuite finaliser votre projet."
202
- "Translation memory (+%s/word)","Mémoire de traduction (+%s / mot)"
203
- "Translation memory","Mémoire de traduction"
204
- "Total word count saved", "Nombre total de mots économisés"
205
- "Nb words that you saved:", "Nombre de mots économisés :"
206
- "Negotiated contract (%s/word)","Contract négocié (%s / mot)"
207
- "Negotiated contract","Contract négocié"
208
- "Negotiated contracts","Contracts négociés"
209
- "launched","Lancé"
210
- "We will analyze your project to find repetitions.","Votre projet sera analysé afin d'identifier et de déduire les répétitions."
211
- "Project Settings","Propriétés du projet"
212
- "Enable","Activé"
213
- "Disabled","Désactivé"
214
- "Visibility","Visibilité"
215
- "Add","Ajouter"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,25 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Textmaster_Textmaster</name>
4
- <version>1.0.10</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Get your product descriptions translated or corrected by professionals directly through Magento.</summary>
10
  <description>TextMaster makes it easy to translate (or proofread) your entire product catalog by professionals in over 15 languages. Open your doors to new markets in just a few clicks by using our intuitive extension to make your store multilingual.</description>
11
- <notes>Improved word count function</notes>
12
- <authors><author><name>Textmaster</name><user>Textmaster</user><email>elizaveta@textmaster.com</email></author></authors>
13
- <date>2016-11-17</date>
14
- <time>14:40:51</time>
15
- <contents><target name="magecommunity"><dir name="Textmaster"><dir name="Textmaster"><dir name="Block"><dir name="Adminhtml"><file name="Credit.php" hash="d6a923cfaf5279e4adf27986c87362b0"/><dir name="Document"><dir name="Renderer"><file name="Status.php" hash="f42270298a953c47ed05008dc17ffbe3"/></dir><file name="Supportmessage.php" hash="3de2c98e34072d8036fbb3baf51fc680"/><file name="View.php" hash="431c6abb59610f98030067f2c331619d"/></dir><dir name="Project"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Checkbox.php" hash="8f57ab35ad7704ef05012d219ca0323d"/><file name="Massaction.php" hash="62dadad96a7548df68e3f3c627e94589"/></dir></dir></dir><file name="Grid.php" hash="804588d40a72e1669e8862f34e17ab9c"/><dir name="Onglets"><file name="Form.php" hash="e686e8cfdac33fa21c86e26fe93a6a07"/><file name="Step1.php" hash="140bb02bff1976628e8b524d255a4718"/><file name="Step2.php" hash="79765936c9436c45b8c236a40e382905"/><dir name="Step3"><file name="Author.php" hash="7ec92925a374885bfff851d8abf24787"/><dir name="Form"><file name="Author.php" hash="b965e02d28139d9c7f6e58fbb15e8e1b"/></dir></dir><file name="Step3.php" hash="1578d3740af4aa133ac5f24076e0ba2f"/><file name="Summary.php" hash="7dd65b0110c72180bddd3c9eadfd1f59"/></dir><file name="Onglets.php" hash="309dd49d8d65bf1c71247ce0647ffe20"/><dir name="Renderer"><file name="Nbdocument.php" hash="244d668e3f8a01c21208fdd2a71d0080"/><file name="Price.php" hash="a21b198258a81bb9b411f638e6b5f5e7"/><file name="Progression.php" hash="2e7c43d38b5640b463963a30239225c9"/><file name="Status.php" hash="782007cbd27b4ccc4200e87e34789ee2"/><file name="Store.php" hash="d92ccafcec2ad102b85bcb6bd3131779"/><file name="Wordcount.php" hash="d4714582d744a718e20d5c1444393c8a"/></dir><dir name="View"><file name="Documents.php" hash="48ab17be73308883855cf5ec0d51ce2b"/><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Checkbox.php" hash="89c7d2afed7e6b031237b8d57194aae8"/><file name="Massaction.php" hash="e39a40293de5764fc41c49fa54964026"/></dir></dir></dir></dir><file name="View.php" hash="5843127fdc9d5277e3c35105724ff788"/></dir><file name="Project.php" hash="1919358b2d024822775ec1dbc9f92d2b"/><dir name="Renderer"><file name="Sourcelanguage.php" hash="61ade1d391fc882d3483b68612f1b784"/><file name="Targetlanguage.php" hash="2defedb3f9b57a2c34e05a30533074e1"/><file name="UpdatedAt.php" hash="2543e1ecaf1431966321031d09147c11"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Briefing.php" hash="f1ae93b9d2c02ca12aa93694e070232e"/><file name="Creation.php" hash="598f1f8c60edc5629a7633953c171878"/><file name="Islog.php" hash="9b9527584ab9a2255b293680c7084bb3"/><file name="Login.php" hash="b40da5f18483d89d49ff864a4356cb4b"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="65dbef01bc95a3f146243dd23a145302"/></dir><dir name="Model"><file name="Api.php" hash="1d2b1b60c9d3786b17f35ffab2637be2"/><file name="Document.php" hash="7ed359834dbcf4666e53e7fd5df52ee3"/><dir name="Mysql4"><dir name="Document"><file name="Collection.php" hash="6253cce06c8b2d65305770e4cc0faf34"/></dir><file name="Document.php" hash="b7c143dec4b9c9d131a25fe85e76c686"/><dir name="Project"><dir name="Attribute"><file name="Collection.php" hash="2873221c4cceef621c2920696ca9f937"/></dir><file name="Attribute.php" hash="f997d919bbc5bd47ad840d522ce1de15"/><file name="Collection.php" hash="e804775c9841041a40d03d9ecf9fea8b"/></dir><file name="Project.php" hash="c78db4c76e2ce2f6ebf1cf8a48c723ef"/></dir><file name="Observer.php" hash="2f5778ed0c4fb579ccfd1e3f5c5bcff0"/><dir name="Project"><file name="Attribute.php" hash="e824699895626069cae908b5a7894c4d"/></dir><file name="Project.php" hash="d07f22734da9364f663222e8fbee1ac5"/><dir name="Source"><dir name="Api"><file name="Audience.php" hash="d9bcdf66964436b1efbc96af0a2e2e40"/><file name="Author.php" hash="758fd2e35aa096eacd2995088da64267"/><file name="Category.php" hash="358defa5cf859af62c68f675809b47eb"/><file name="Grammatical.php" hash="dcb73d6ac8cd93f73b6af08ec3ffb057"/><file name="Lang.php" hash="2f7c65d8c9d2247364bab2b3a26cd638"/><file name="Type.php" hash="9cff2f1385ac6e5bafb8c986152c4c08"/><file name="Vocabulary.php" hash="494ed3154a1c8dbe492da5a32f2dbad7"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Textmaster"><file name="AjaxController.php" hash="c256bac1ed6321d433fd5000a31f1533"/><file name="ApiController.php" hash="71e21e3d6db66aecc10ee712d6f83664"/><file name="ProjectController.php" hash="7d4eac41a200aeb07fb1a821bc2f5a91"/></dir></dir><file name="CallbackController.php" hash="1cb0d55bb494fa3a354dda2df4124dc2"/><file name="IndexController.php" hash="7588d1f1a9918834837e0215569ab560"/></dir><dir name="etc"><file name="config.xml" hash="11e074798def55a6daf2c344c14531e9"/><file name="jstranslator.xml" hash="03f0fff44c0367e09fad50cc29134b46"/><file name="system.xml" hash="ebaaed4b063cef62fb7f6e10655e7adf"/></dir><dir name="sql"><dir name="textmaster_setup"><file name="mysql4-install-0.0.1.php" hash="162032e7872f14cc0049c73b79fdb7e7"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="d0e9ddeb6f62e36747e1f7df4fe99db1"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="8e3cad04b99df0c2a1e3369bd7c432ee"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="1d5f415b61fd5ef6b4c352cd9f2ba75e"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="791ca3e154ba7249478339b98c40eb94"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="865aac8301b8afe668590ec81b08877e"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="22238b586ef7acbfc8e72b60ad19eff2"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="57c692e4a1357794af92e884b7316047"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="e3e41fe7b951b71cc636ad6cc9ce4d2b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="textmaster"><file name="credit.phtml" hash="c89b6836429a831be59d7718c1b6600f"/><dir name="document"><file name="support_messages.phtml" hash="718d4b88147a88dd3a4a79ee937cfb0b"/><file name="view.phtml" hash="3c4164c1c0a8b651f8b799fafd869a00"/></dir><dir name="form"><file name="container.phtml" hash="a178289bb54908698de0423a04f925f3"/></dir><dir name="grid"><file name="container.phtml" hash="3a46640e22f5458ba1bb43abcd50fb31"/></dir><file name="login.phtml" hash="6d32209da30745ee73f9d89e18662792"/><dir name="onglet"><file name="popinauthors.phtml" hash="88755e5187349b78cace1b922a00d310"/></dir><file name="onglet.phtml" hash="8d5d029d870d40ae775d81bddc29549a"/><file name="page.phtml" hash="5dfa6347708268bf5108186a1145e530"/><dir name="product"><file name="edit.phtml" hash="2f2203f3c963fa240f5b47e5c53763a2"/></dir><file name="view.phtml" hash="dde0135f0549c45785974364abc5d842"/></dir></dir><dir name="layout"><file name="textmaster.xml" hash="07d95bbedeeb59386e624e2f78edbee6"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="textmaster"><file name="popin.css" hash="b9624ff6924adf24302b2a9ce73704fb"/><file name="styles.css" hash="61e33a529634ed22fd2e0f56d3647caf"/></dir></dir><dir name="images"><dir name="textmaster"><file name="ad.png" hash="4d3bfa60fb52ee8f9ce3c0f3934a0e08"/><file name="ae.png" hash="f3838d0ca01d7a76de74249ff2b514c7"/><file name="af.png" hash="a44bb210f25bafca92627b1187b0996d"/><file name="ag.png" hash="7b00bd7c2754618d57b78c407d6b542a"/><file name="al.png" hash="3f8b9ccd82877835192c5235e84ea543"/><file name="am.png" hash="f1f48cdf20af82bd4e708f40a844c08e"/><file name="ao.png" hash="13dd9ec64e95578da89ac092ea6bc49d"/><file name="ar.png" hash="e2a2372c9190c58e450d563c857cf932"/><file name="at.png" hash="0ed42d4df345bbe1a9eacc40a1ba9891"/><file name="au.png" hash="95609fc7efb05fab769b08c567dcafe3"/><file name="az.png" hash="82ee424e37625aa0bc6f0f2e2798ff33"/><file name="ba.png" hash="098a79c08cd07a7940affe818d8108d2"/><file name="bb.png" hash="237f1706a74e31a1f0f40080285af716"/><file name="bd.png" hash="5dd17c6db835d0e611b582a9aab36a69"/><file name="be.png" hash="140b16e73953d41b172e5a13106d96d7"/><file name="bf.png" hash="8bf9167bd4d4c8ab177590a03f18cb3a"/><file name="bg.png" hash="5f21946772326567c3bc2eb62693862d"/><file name="bh.png" hash="40acbad63f1ebb842cac8225198caa80"/><file name="bi.png" hash="ef7a1794da922df0876811e673795b40"/><file name="bj.png" hash="e776d8d30d79c46196bf63cf3698a005"/><file name="bn.png" hash="6f8378e8492e6d65297a878000d86cdd"/><file name="bo.png" hash="42addc49c770236532fb3425c39e855e"/><file name="br.png" hash="5820e89cdd217f41a8160611c2772450"/><file name="bs.png" hash="f10c1553ab9d8d3f50fa50789a0ec14d"/><file name="bt.png" hash="edced8a66c05b17cb3a66f4edab81537"/><file name="bw.png" hash="87ad8d31999e9f3dcf4af9b4002bd198"/><file name="by.png" hash="74271a2d533cf0f010f684527506a1b7"/><file name="bz.png" hash="3e6e3a59ea76dd361dd44c59e878cce1"/><file name="ca.png" hash="bde2e7c28a15fef7c21023d0d42e0af6"/><file name="cd.png" hash="43c7041408a403b5a5bff6ee5c486dcb"/><file name="cf.png" hash="8b0f9b4821681f89adc2a05cc9cb93f8"/><file name="cg.png" hash="69fc1655e73b91d5de5e526eb77a25dd"/><file name="ch.png" hash="4bd0882fe41076facbed622f45f5fe12"/><file name="ci.png" hash="33d6b8f53b17b291c82ba89268cc33c3"/><file name="cl.png" hash="97ac63f223ad9b8c9c89ede5a463fe16"/><file name="cm.png" hash="3a02cc8fd12eb3d46785b043eb1b4843"/><file name="cn.png" hash="7d8619cadee5b9bc776bee8c7c0d9bff"/><file name="co.png" hash="01799343910800de170f5bd2842f8610"/><file name="cr.png" hash="a261c45d21511884d98938746a88cda9"/><file name="cu.png" hash="6374430cbe6044d27a1e873982cb0e76"/><file name="cv.png" hash="ad5a8d21169eaa192fed00d022f3e970"/><file name="cy.png" hash="394575dc8ccea26e40ceb8059ed32140"/><file name="cz.png" hash="a25b0e8335083286931938e0b9203176"/><file name="de.png" hash="d5af4cc2395e7221e0fc625f892b44fb"/><file name="dj.png" hash="ad81ed92212c8118daf1227547fa672f"/><file name="dk.png" hash="d4a4b2d8804d713a687690e8d5d86b0d"/><file name="dm.png" hash="3d0dcb98ba84de45ba9f95f829530e75"/><file name="do.png" hash="579619d7a624dd7ee8d01ac1f2128a1e"/><file name="dz.png" hash="d798915a98660a226bb0418c6cf3ef4f"/><file name="ec.png" hash="84126d2520a0d9f993d3237725a7f907"/><file name="ee.png" hash="9d6bb07ed60ff800bb61f5bb0aaad99a"/><file name="eg.png" hash="984c617fe29427198dcbf7d41170e94b"/><file name="eh.png" hash="703d4e948c1f575016157e657d16b4f1"/><file name="en.png" hash="ffdfe557dee5d9f7ff9744708762bf67"/><file name="er.png" hash="847e75043e54c4aa95c219dd05605880"/><file name="es.png" hash="38970876b2bfb01c903419f91f026878"/><file name="et.png" hash="a7838af033c27a4d5d81e5e964dd45f5"/><file name="fi.png" hash="d64cea1ef1a5994aadcc6380bc3f33d6"/><file name="fj.png" hash="5f0f59be9e403329fa7059ab48609118"/><file name="flags-mini.zip" hash="7221658c2d26144a361403723d278205"/><file name="fm.png" hash="437654b1e67bbf1f90e971222fab6974"/><file name="fr.png" hash="6a705fd57e522b3644597d03606d3e17"/><file name="ga.png" hash="619b7bd8cbd79d04949f86b8fef80bc6"/><file name="gd.png" hash="722b7d1192b950ee6d93a02d2a5e4ba7"/><file name="ge.png" hash="930de4a6c9eab9cae548938903500d28"/><file name="gh.png" hash="ad81a6bdafb414b363d08180caf6a8e3"/><file name="gm.png" hash="f16737716084f29a9d9ba01501fb8732"/><file name="gn.png" hash="b36b8a91e876b1d9b11d020c81a2b806"/><file name="gq.png" hash="20bb217c3333a4a0a361581d84ca5326"/><file name="gr.png" hash="2841baa87ea947e5e3bc80278627d5da"/><file name="gt.png" hash="ef388b528291fd6f7742d3b4b0cd3800"/><file name="gw.png" hash="27e732fe984241041a09315ac235a923"/><file name="gy.png" hash="c2083c5428dec76473780cc97f7449a1"/><file name="hn.png" hash="b630fa10ad4fa8762215dc9e716c5466"/><file name="hr.png" hash="e8c7e75fa9eed2ae2b2ba34dd73e56e6"/><file name="ht.png" hash="d125e54a88ac04211b61d49a7fc0cc70"/><file name="hu.png" hash="96db67ede070c6a86a778660d80e7e26"/><file name="id.png" hash="63199df1f7136f80ca81d95190899db7"/><file name="ie.png" hash="d0088733cda1245823726ecf8018ab69"/><file name="il.png" hash="15b6e79abb6f553938b24d949fea1ffd"/><file name="in.png" hash="11addda3b86a7f8fc55abfd80a38f7a5"/><file name="iq.png" hash="35ee00f1ec3e5815ec3890ff397f2ba0"/><file name="ir.png" hash="a0db2ed68e2e29cc366e019e4c676262"/><file name="is.png" hash="1a39e1dec42eb5c8e5cc98bcb6e71c37"/><file name="it.png" hash="502d044737b407caa56138bc8235e55a"/><file name="jm.png" hash="fb67cd9833b430b1081b68d8bea97a4e"/><file name="jo.png" hash="ded495d673605aca3ddb9bd5cc6e2ca3"/><file name="jp.png" hash="64a5be7e6bdc94ba6866bab79b44eabc"/><file name="ke.png" hash="6f58b731e1f6dd7b13cb659e8ff04154"/><file name="kg.png" hash="229cf7889548451a8d467b85d06c212a"/><file name="kh.png" hash="1cd4d9aeaed32e129f54408cb2cda3d7"/><file name="ki.png" hash="b0596385cffbe421730b16f4a2e0d290"/><file name="km.png" hash="657977b976bcbf8c03bcac268814d020"/><file name="kn.png" hash="f89b4a2d2fd0b44e22b4281a7740e4c7"/><file name="kp.png" hash="fd794d0813a3da085113804070ec89e1"/><file name="kr.png" hash="cf0e98be60de5bf10f6dcff1ea224720"/><file name="ks.png" hash="9cb1c058d614957a6c3f04bb8384d672"/><file name="kw.png" hash="2f9130a5d176b54f632f7bb08860f28e"/><file name="kz.png" hash="288a3b09f8dd0b6b251c2a9759ff61e1"/><file name="la.png" hash="07f807a8c739bead3997a11ed6c741b1"/><file name="lb.png" hash="23b9b946942bc2c3ac2242e5675d810f"/><file name="lc.png" hash="2e7aba2fb74c757f79f500dea57fc69c"/><file name="li.png" hash="e826167750c88d94c5eb43c043ba3907"/><file name="lk.png" hash="4463604a10b4b7a3679bd45c76b56dd1"/><file name="lr.png" hash="2cb94086e7fcc2042435c7b69f1e6438"/><file name="ls.png" hash="86bc8c806555483bfa59cfc36d485f66"/><file name="lt.png" hash="35dfa78cf04b6571cc82e7a356641f1b"/><file name="lu.png" hash="329ad84226aacd1e22695cb72c2822cd"/><file name="lv.png" hash="ba99fb872543c7d4853b50f788e2fda0"/><file name="ly.png" hash="1d232daa96e0f7ca7e1ecdec5e6d8371"/><file name="ma.png" hash="006f06311e103a2efb9618f485685300"/><file name="mc.png" hash="6abe8119c30e760986c705c361211fc6"/><file name="md.png" hash="b5904d63976ccfe9985238b76e8b49e0"/><file name="me.png" hash="b7bf90515ff08512425929ff2734f5a5"/><file name="mg.png" hash="896adcfd3afa8f292e25ecaf5e57956e"/><file name="mh.png" hash="50165a2514b035e3482d6d2f4876d8ec"/><file name="mk.png" hash="1016d35de15d82434e06bffda64d421b"/><file name="ml.png" hash="9b3b0773ec50db0f0d775c9776e74c04"/><file name="mm.png" hash="cdafdf2162e5cb1c8b8e312b9f4cfec8"/><file name="mn.png" hash="faa28969f96cae1085cc6c8d9234dbe4"/><file name="mr.png" hash="d83fb1097bcb99133d9d224d06207d71"/><file name="mt.png" hash="ac23976d3a0d2873b7fb72c8503018bf"/><file name="mu.png" hash="bda1ed19036d5716a1aea8ddd23f5b24"/><file name="mv.png" hash="a5e4d4f9d846ba2df572f7855e5d153c"/><file name="mw.png" hash="73ce56eeac955942ab87f6714c2b2f1c"/><file name="mx.png" hash="515daf584560866ba82458a2841b2c5c"/><file name="my.png" hash="ec302b316857c5a655e9d0838a7299bf"/><file name="mz.png" hash="b1a305321450ff8cfacb7b51ef54702e"/><file name="na.png" hash="6b1782b56d5607651fd8467a3282becf"/><file name="ne.png" hash="fd7a4ac6a5b0bfcd11e19b59e4eb9491"/><file name="ng.png" hash="fbdc831cab445407014a8be0cd9d1f9b"/><file name="ni.png" hash="87be5b122aaafed59e42a1c94472f4ca"/><file name="nl.png" hash="b7d65809e5c02d8d36c01a08adc32ee4"/><file name="no.png" hash="87f804f26166303a42d85ceba925ff82"/><file name="np.png" hash="6e43bb94985c756a15b7ad47e1be25a9"/><file name="nr.png" hash="01771f576a6a73750637796ca4f9b1d1"/><file name="nz.png" hash="a37276b951a51d5b4cbf5169b3fbe899"/><file name="om.png" hash="2c13864af6fa36541fc66a6e8f3af91e"/><file name="pa.png" hash="b79104676e49981ca9937015349c63e0"/><file name="pe.png" hash="80a714541ee3a84286f79f31abef7232"/><file name="pg.png" hash="0fd60c1657cf591650ea7672ce1189af"/><file name="ph.png" hash="47942dfa29448f707cc8aea171d120bf"/><file name="pk.png" hash="047cccacc9290dd94a3d5febc0499cf8"/><file name="pl.png" hash="7b8a0298dac0a7f273d5e6b741f8038f"/><file name="pt.png" hash="3141bfbda3235bc2f950243981753a23"/><file name="pw.png" hash="6eaebbe7b69c3bf9c3c50f4c3cc9100f"/><file name="py.png" hash="948dc594390295dc43a22bb228ff8296"/><file name="qa.png" hash="237556d7031c9d09e86e8b806310eef3"/><file name="ro.png" hash="5508a42870fb98d3dc1281133e36908e"/><file name="rs.png" hash="e81f589284efdc070501b676cbf2440a"/><file name="ru.png" hash="46378f0d5a6e8339db251971fa05acc8"/><file name="rw.png" hash="4afb87332945b130e463fc5b7706caf8"/><file name="sa.png" hash="2cf7460d937ea6ac4aa80c84722ff127"/><file name="sb.png" hash="ec4690d32d683027cab5475fbc6817eb"/><file name="sc.png" hash="6b232689798b91d278928c5f8db684b6"/><file name="sd.png" hash="3ec6b86188d06cc95af59a4401fa51c1"/><file name="se.png" hash="34ca8036ec0d98e5b8f0972e7c3b690c"/><file name="sg.png" hash="0df385a93794a40b8927d9b6fe8c8ab4"/><file name="si.png" hash="7c0304b3da174716cb637e559ba30462"/><file name="sk.png" hash="f1192c4beac2189817b990302d6023c0"/><file name="sl.png" hash="dded38a2eedec2575e7200753a8d2c0c"/><file name="sm.png" hash="fce953adb78a308692ae504f8bc68a03"/><file name="sn.png" hash="dee77d596acc5a7045db7c0eca9996e6"/><file name="so.png" hash="a88729fc16aa813315a7edc1374e34e5"/><file name="sr.png" hash="6cd104e7e702c0f17a80be2da797b2c2"/><file name="st.png" hash="ac34029ffd9ab8b0f14669295f838a92"/><file name="sv.png" hash="87de653ebd702dc2c1908bdad6b5e07d"/><file name="sy.png" hash="2c0f028a239914970be87e691bcd3907"/><file name="sz.png" hash="06cf5b39e7ade92fa9d29619f69fa0e6"/><file name="td.png" hash="323ae3550138d0054343f3d75367bfb1"/><file name="tg.png" hash="bf0360afe91efa96d766bc9de7b4726d"/><file name="th.png" hash="7c7f53c225be44fc2897dd007549245b"/><file name="tj.png" hash="472b4679950b9562d3618b9c9ef518d5"/><file name="tl.png" hash="7197fb1849ba9c8c7f9b1e240e37b85b"/><file name="tm.png" hash="177489fdf6e6380131c2f989a1467b24"/><file name="tn.png" hash="162105faa75e6ceb9f0e5b982343a07c"/><file name="to.png" hash="a96505c14820af79abb3567056abca39"/><file name="tr.png" hash="8307e3e68476fe75f0a396b8e96761d3"/><file name="tt.png" hash="304a6848ef200b4d3cde0b1d5cc5523e"/><file name="tv.png" hash="ed5ffe4560b8b651b0d321bc6f6875c7"/><file name="tw.png" hash="56d7df67199ebcce42d70cea202b8a36"/><file name="tz.png" hash="1675509852611fabc2d11966274f5617"/><file name="ua.png" hash="dc3eb73822683ea9980711d34cc01d68"/><file name="ug.png" hash="e7ef297a425c8ac105b5e52c2e338794"/><file name="us.png" hash="1fac8f33d3c11a92fc7913f27df16339"/><file name="uy.png" hash="e00ba3948043a99ab07db91db8dd94f3"/><file name="uz.png" hash="2cb5bc704b35ef438b92824dd1cb7c83"/><file name="va.png" hash="4e3061c712414e91d312ca5a587ea24c"/><file name="vc.png" hash="0ee195323c3613d5e5d635a445c922df"/><file name="ve.png" hash="019c86c82fe6a1ad59ec5d800db3a66f"/><file name="vn.png" hash="d33f6ad2504d1559b10e0f6f084cbe59"/><file name="vu.png" hash="fe3acbd24eb0e11f45cdc3cd6b2a22ea"/><file name="ws.png" hash="bd859467d80a0740bb5ab950def621f2"/><file name="ye.png" hash="47036485a58d485f9cbbc8c661daf8d3"/><file name="za.png" hash="6d0a8ef2e6bdd3325e86b2fe9ec74cf9"/><file name="zm.png" hash="cc14e520271994baccd073ffb852d144"/><file name="zw.png" hash="16b7534269b89084bbdab36c8da5da2e"/></dir></dir><dir name="js"><dir name="textmaster"><file name="script-tmp.js" hash="410cf36e97a8d08bde34b3cc732b5779"/><file name="script.js" hash="c4012a5e2d54fc85cb0086791627cff6"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Textmaster_Textmaster.xml" hash="c7189ff759aac7e98638198ba1b59e96"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Textmaster_Textmaster.csv" hash="44cccc414659951b1142952170613cf5"/></dir><dir name="en_US"><file name="Textmaster_Textmaster.csv" hash="b6cdff51fc40aa657dcd7931d7c87e8f"/></dir></target></contents>
 
 
 
 
 
 
 
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.2</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Textmaster_Textmaster</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Get your product descriptions translated or corrected by professionals directly through Magento.</summary>
10
  <description>TextMaster makes it easy to translate (or proofread) your entire product catalog by professionals in over 15 languages. Open your doors to new markets in just a few clicks by using our intuitive extension to make your store multilingual.</description>
11
+ <notes>Projects Grid Fixes.&#xD;
12
+ &#xD;
13
+ if you have any trouble with our extension, be sure to let us know at contact@textmaster.com&#xD;
14
+ &#xD;
15
+ ------------&#xD;
16
+ &#xD;
17
+ Textmaster extension uses Callbacks to update project informations, your environment need to be reachable by our server.&#xD;
18
+ For more information: contact@textmaster.com</notes>
19
+ <authors><author><name>Textmaster</name><user>Textmaster</user><email>contact@textmaster.com</email></author></authors>
20
+ <date>2017-07-20</date>
21
+ <time>08:51:18</time>
22
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="textmaster.xml" hash=""/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Textmaster_Textmaster.xml" hash=""/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Textmaster_Textmaster.csv" hash=""/></dir><dir name="en_US"><file name="Textmaster_Textmaster.csv" hash=""/></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.3.2</min><max>6.0.0</max></php></required></dependencies>
25
  </package>
skin/adminhtml/default/default/css/textmaster/popin.css DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * Copyright (c) 2014 Textmaster
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Open Software License (OSL 3.0)
7
- * It is available through the world-wide-web at this URL:
8
- * http://opensource.org/licenses/osl-3.0.php
9
- *
10
- * @category Addonline
11
- * @package Addonline_Textmaster
12
- * @copyright Copyright (c) 2014 Textmaster
13
- * @author Addonline (http://www.addonline.fr)
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- */
16
- .wrapper {
17
- min-width: 460px !important;
18
- }
19
- .middle {
20
- min-height: initial !important;
21
- __height:100%;
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/adminhtml/default/default/css/textmaster/styles.css DELETED
@@ -1,176 +0,0 @@
1
- /**
2
- * Copyright (c) 2014 Textmaster
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Open Software License (OSL 3.0)
7
- * It is available through the world-wide-web at this URL:
8
- * http://opensource.org/licenses/osl-3.0.php
9
- *
10
- * @category Addonline
11
- * @package Addonline_Textmaster
12
- * @copyright Copyright (c) 2014 Textmaster
13
- * @author Addonline (http://www.addonline.fr)
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- */
16
- ol.steps_project {
17
- list-style: none;
18
- margin: 0 0 20px;
19
- padding: 0;
20
- overflow: hidden;
21
- font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'DejaVu Sans', 'Bitstream Vera Sans', 'Liberation Sans', Verdana, 'Verdana Ref', sans-serif;
22
- font-size: 13px;
23
- line-height: 20px;
24
- font-weight: bold;
25
- counter-reset: li;
26
- }
27
-
28
- ol.steps_project > li {
29
- float: left;
30
- list-style-image: none;
31
- list-style-type: none;
32
- margin-left: 0;
33
- text-align: center;
34
- color: #3a3a3a;
35
- background: #FAFAFA;
36
- position: relative;
37
- margin-left: 43px;
38
- }
39
-
40
- ol.steps_project > li.disabled{
41
- color : #AAA;
42
- }
43
-
44
- ol.steps_project > li:after {
45
- position: absolute;
46
- top: 50%;
47
- left: 100%;
48
- content: " ";
49
- height: 0;
50
- width: 0;
51
- pointer-events: none;
52
- border: solid transparent;
53
- border-left-color: #FAFAFA;
54
- border-width: 19px;
55
- margin-top: -19px;
56
- }
57
-
58
- ol.steps_project > li:first-child {
59
- margin-left: 0;
60
- }
61
-
62
- ol.steps_project > li:first-child span {
63
- padding: 9px;
64
- }
65
-
66
-
67
- ol.steps_project > li:first-child span:after {
68
- border: none;
69
- }
70
-
71
- ol.steps_project > li:last-child:after {
72
- border-width: 0;
73
- }
74
-
75
-
76
- ol.steps_project > li span {
77
- display: block;
78
- padding: 9px 28px 9px 9px;
79
- }
80
-
81
-
82
- ol.steps_project > li span:after {
83
- position: absolute;
84
- top: 50%;
85
- right: 100%;
86
- content: " ";
87
- height: 0;
88
- width: 0;
89
- pointer-events: none;
90
- border: solid #FAFAFA;
91
- border-left-color: transparent;
92
- border-width: 19px;
93
- margin-top: -19px;
94
- }
95
-
96
- ol.steps_project > li span::before {
97
- content: counter(li) ") ";
98
- counter-increment: li;
99
- }
100
-
101
- ol.steps_project > li.current {
102
- color: #fff;
103
- background: #6F8992;
104
- }
105
-
106
-
107
- ol.steps_project > li.current:after {
108
- border-left-color: #6F8992;
109
- }
110
-
111
- ol.steps_project > li.current span:after {
112
- border-color: #6F8992;
113
- border-left-color: transparent;
114
- }
115
-
116
-
117
- li.step1 {
118
- z-index: 3;
119
- }
120
- li.step2 {
121
- z-index: 2;
122
- }
123
- li.step3 {
124
- z-index: 1;
125
- }
126
- .textmaster-info{
127
- background:#F6F6F6;
128
- border:1px solid #EFEFEF;
129
- padding: 5px 17px 5px 17px;
130
- margin-bottom: 10px;
131
- font-weight:bold;
132
- }
133
- .textmaster-info .textmaster-credit{
134
- display:block;
135
- float:right;
136
- }
137
- .textmaster-introduction{
138
- margin-bottom:16px;
139
- }
140
- .progress-cadre{
141
- display:block;
142
- width:240px;
143
- height:20px;
144
- border:1px solid #f1af73;
145
- }
146
- .progress{
147
- width:0;
148
- display:block;
149
- height:20px;
150
- line-height:20px;
151
- background: #ffac47 url("../../images/btn_bg.gif") repeat-x scroll 0 100% ;
152
- }
153
- #loading-mask .textmasterloading{
154
- margin-left: -145px;
155
- width:250px;
156
- }
157
- #loading-mask .textmasterloading .message{
158
- display:block;
159
- padding:10px 0 0 0;
160
- font-size: 0.85em;
161
- line-height:1.1em;
162
- font-weight: normal;
163
- }
164
- tr.text-disable{
165
- cursor: not-allowed !important;
166
- }
167
- tr.text-disable td{
168
- /*background:#DDD;*/
169
- color:#CCC;
170
- font-style:italic;
171
-
172
-
173
- }
174
- tr.text-disable td a {
175
- display:none;
176
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/adminhtml/default/default/images/textmaster/ad.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ae.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/af.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ag.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/al.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/am.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ao.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ar.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/at.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/au.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/az.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ba.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bb.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bd.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/be.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bf.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bh.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bi.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bj.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bo.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/br.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bs.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bt.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/by.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/bz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ca.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cd.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cf.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ch.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ci.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cl.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/co.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cu.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cv.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cy.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/cz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/de.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/dj.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/dk.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/dm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/do.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/dz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ec.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ee.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/eg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/eh.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/en.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/er.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/es.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/et.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/fi.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/fj.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/flags-mini.zip DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/fm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/fr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ga.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gd.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ge.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gh.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gq.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gt.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/gy.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/hn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/hr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ht.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/hu.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/id.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ie.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/il.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/in.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/iq.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ir.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/is.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/it.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/jm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/jo.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/jp.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ke.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kh.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ki.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/km.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kp.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ks.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/kz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/la.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lb.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lc.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/li.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lk.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ls.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lt.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lu.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/lv.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ly.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ma.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mc.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/md.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/me.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mh.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mk.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ml.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mt.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mu.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mv.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mx.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/my.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/mz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/na.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ne.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ng.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ni.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/nl.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/no.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/np.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/nr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/nz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/om.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pa.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pe.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ph.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pk.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pl.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pt.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/pw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/py.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/qa.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ro.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/rs.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ru.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/rw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sa.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sb.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sc.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sd.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/se.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/si.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sk.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sl.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/so.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/st.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sv.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sy.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/sz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/td.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tg.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/th.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tj.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tl.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/to.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tr.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tt.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tv.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tw.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/tz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ua.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ug.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/us.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/uy.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/uz.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/va.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/vc.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ve.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/vn.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/vu.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ws.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/ye.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/za.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/zm.png DELETED
Binary file
skin/adminhtml/default/default/images/textmaster/zw.png DELETED
Binary file
skin/adminhtml/default/default/js/textmaster/script-tmp.js DELETED
@@ -1,535 +0,0 @@
1
- /**
2
- * Copyright (c) 2014 Textmaster
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Open Software License (OSL 3.0)
7
- * It is available through the world-wide-web at this URL:
8
- * http://opensource.org/licenses/osl-3.0.php
9
- *
10
- * @category Addonline
11
- * @package Addonline_Textmaster
12
- * @copyright Copyright (c) 2014 Textmaster
13
- * @author Addonline (http://www.addonline.fr)
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- */
16
- var stop_ajax = false;
17
- var stoped_ajax = false;
18
- var ajax_request = false;
19
-
20
- window.onload = function() {
21
- if ( (typeof jQuery === 'undefined') && !window.jQuery ) {
22
- //alert('TOTO');
23
- var head = document.getElementsByTagName('head')[0];
24
- url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js';
25
- var headTag = document.getElementsByTagName("head")[0];
26
-
27
- var jqTag = document.createElement('script');
28
- jqTag.type = 'text/javascript';
29
- jqTag.src = url;
30
- jqTag.onload = url;
31
- jqTag.onload = function(){
32
- jQuery.noConflict();
33
- jQueryOnLoad(jQuery);
34
- if(typeof jQueryCall != 'undefined'){
35
-
36
- jQueryCall(jQuery);
37
- }
38
- };
39
- headTag.appendChild(jqTag);
40
-
41
- } else {
42
- jQuery.noConflict();
43
- jQueryOnLoad(jQuery);
44
- if(typeof jQueryCall != 'undefined'){
45
- jQueryCall(jQuery);
46
- }
47
- }
48
- }
49
- jQueryOnLoad = function($){
50
- if($('#config_edit_form').length) {
51
- $('#login,#password' ).keypress(function( event ) {
52
- if ( event.which == 13 ) {
53
- loginAjaxAction();
54
- }
55
- });
56
-
57
- var current_label_translation = $('label[for=textmaster_defaultvalue_briefing_message_translation]').html();
58
- var changeStoreDefault_translation = function(){
59
- current_locale = $('#textmaster_defaultvalue_default_language').val();
60
- all_textarea = $('textarea[id^=briefing_message_translation]').hide();
61
- all_textarea.hide(0);
62
- $('#briefing_message_translation_'+current_locale).show();
63
- label_html = current_label_translation+' ('+$('#briefing_message_translation_'+current_locale).attr('data-label')+')';
64
- $('label[for=textmaster_defaultvalue_briefing_message_translation]').html(label_html);
65
- };
66
-
67
- var current_label_proofreading = $('label[for=textmaster_defaultvalue_briefing_message_proofreading]').html();
68
- var changeStoreDefault_proofreading = function(){
69
- current_locale = $('#textmaster_defaultvalue_default_language').val();
70
- all_textarea = $('textarea[id^=briefing_message_proofreading]');
71
- all_textarea.hide(0);
72
- $('#briefing_message_proofreading_'+current_locale).show();
73
- label_html = current_label_proofreading+' ('+$('#briefing_message_proofreading_'+current_locale).attr('data-label')+')';
74
- $('label[for=textmaster_defaultvalue_briefing_message_proofreading]').html(label_html);
75
- };
76
-
77
-
78
- changeStoreDefault = function(){
79
- changeStoreDefault_proofreading();
80
- changeStoreDefault_translation();
81
- }
82
- $('#textmaster_defaultvalue_default_language').change(changeStoreDefault);
83
- changeStoreDefault();
84
- var changeType = function (){
85
- type = $('#textmaster_defaultvalue_default_type').val();
86
- if(type=='translate') type = 'translation';
87
- $('tr[id^=row_textmaster_defaultvalue_briefing_message]').hide();
88
- $('#row_textmaster_defaultvalue_briefing_message_'+type).show();
89
-
90
- }
91
- $('#textmaster_defaultvalue_default_type').change(changeType);
92
- changeType();
93
-
94
- if(!textmaster_is_log) {
95
- $('#textmaster_defaultvalue').parent().hide();
96
- $('#row_textmaster_textmaster_api_key').hide();
97
- $('#row_textmaster_textmaster_api_secret').hide();
98
- } else {
99
- $('#textmaster_defaultvalue').parent().show();
100
- $('#row_textmaster_textmaster_creation').hide();
101
- $('#row_textmaster_textmaster_api_key').hide();
102
- $('#row_textmaster_textmaster_api_secret').hide();
103
- }
104
- }
105
- if($('#edit_form').length){
106
-
107
-
108
- editForm = new varienForm('edit_form', '');
109
- qualities = $('#quality option');
110
- service_levels = $('#language_level option');
111
- expertises = $('#expertise option');
112
- priorities = $('#priority option');
113
- translation_memories = $('#translation_memory option');
114
-
115
- label_expertises = new Array();
116
- label_priorities = new Array();
117
- label_qualities = new Array();
118
- label_service_levels = new Array();
119
- label_translation_memories = new Array();
120
-
121
- $.each(service_levels,function(index,value){
122
- label_service_levels[index] = $(value).text();
123
- });
124
- $.each(qualities,function(index,value){
125
- label_qualities[index] = $(value).text();
126
- });
127
- $.each(expertises,function(index,value){
128
- label_expertises[index] = $(value).text();
129
- });
130
- $.each(priorities,function(index,value){
131
- label_priorities[index] = $(value).text();
132
- });
133
- $.each(translation_memories,function(index,value){
134
- label_translation_memories[index] = $(value).text();
135
- });
136
-
137
- updateDisplay = function(){
138
- ctype = $('#ctype').val();
139
- //specific_attachment = $('#specific_attachment').val();
140
- priority = $('#priority').val();
141
- quality = $('#quality').val();
142
- expertise = $('#expertise').val();
143
- service_level = $('#language_level').val();
144
- translation_memory = $('#translation_memory').val();
145
-
146
- $('#textmaster_projet').html($('#ctype option[value='+ctype+']').html());
147
-
148
-
149
- if(typeof service_level =='undefined'){
150
- service_level = 'regular';
151
- }
152
- if(ctype=='translation' && (service_level=='premium' || service_level=='enterprise')){
153
- $('#quality').removeAttr('disabled');
154
- } else {
155
- $('#quality').val(0);
156
- $('#quality').attr('disabled','disabled');
157
- quality = $('#quality').val();
158
- }
159
- if(ctype=='translation' && service_level=='enterprise'){
160
- $('#translation_memory').removeAttr('disabled');
161
- }else {
162
- $('#translation_memory').val(0);
163
- $('#translation_memory').attr('disabled','disabled');
164
- }
165
- $.each(service_levels,function(i,v){
166
- $(v).text(label_service_levels[i]);
167
- });
168
-
169
-
170
- html_option = $('#language_level option[value='+service_level+']').html()+'<br/>';
171
-
172
- base_price = parseFloat(textmaster_pricing['types'][ctype][service_level]);
173
- service_level_price = base_price;
174
-
175
- quality_price = parseFloat(textmaster_pricing['types'][ctype]['quality']);
176
- if(quality=='1'){
177
- html_option += Translator.translate('Control Quality')+'<br/>';
178
- base_price += quality_price;
179
- }
180
- priority_price = parseFloat(textmaster_pricing['types'][ctype]['priority']);
181
- if(priority=='1'){
182
- html_option += Translator.translate('Priority')+'<br/>';
183
- base_price += priority_price;
184
- }
185
- expertise_price = parseFloat(textmaster_pricing['types'][ctype]['expertise']);
186
- if(expertise=='1'){
187
- html_option += Translator.translate('Expertise')+'<br/>';
188
- base_price += expertise_price;
189
- }
190
- translation_memory_price = parseFloat(textmaster_pricing['types'][ctype]['translation_memory']);
191
- if(translation_memory=='1'){
192
- html_option += Translator.translate('Translation memory')+'<br/>';
193
- base_price += translation_memory_price;
194
- }
195
- /*if(specific_attachment=='1'){
196
- html_option += 'Specific attachment<br/>';
197
- base_price += parseFloat(textmaster_pricing['types'][ctype]['specific_attachment']);
198
- }*/
199
- $('#textmaster_options').html(html_option);
200
- word_count = 0;
201
- lang = $('#store_id_origin').val();
202
- $('input[id^=attribute_]').each(function(index,value){
203
- if($(this).is(':checked') && lang!=0){
204
- code = $(this).val();
205
- word_count += parseInt(attribute_word_count[lang][code]);
206
- }
207
- });
208
- price = Math.round(word_count*base_price*100)/100;
209
- priceFormat = {};
210
- priceFormat.requiredPrecision = 2;
211
- priceFormat.pattern = '%s';
212
- $('#textmaster_nbmot').html(word_count);
213
- $('#textmaster_total_price').html(formatCurrency(price,priceFormat)+' '+currency_symbol+'<br/>'+Translator.translate('worth')+' '+formatCurrency(base_price,priceFormat)+' '+currency_symbol+' / '+Translator.translate('mot'));
214
-
215
- language_from = $('#store_id_origin').val();
216
- language_to = $('#store_id_translation').val();
217
-
218
- $.each(service_levels,function(i,v){
219
- if($(v).attr('value')=='premium'){
220
- price = service_level_price*word_count;
221
- $(v).text(label_service_levels[i]);
222
- }
223
- });
224
- $.each(qualities,function(i,v){
225
- if($(v).attr('value')!='0'){
226
- price = quality_price*word_count;
227
- $(v).text(label_qualities[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
228
- }
229
- });
230
- $.each(priorities,function(i,v){
231
- if($(v).attr('value')!='0'){
232
- price = priority_price*word_count;
233
- $(v).text(label_priorities[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
234
- }
235
- });
236
- $.each(expertises,function(i,v){
237
- if($(v).attr('value')!='0'){
238
- price = expertise_price*word_count;
239
- $(v).text(label_expertises[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
240
- }
241
- });
242
- $.each(translation_memories,function(i,v){
243
- if($(v).attr('value')!='0'){
244
- price = translation_memory_price*word_count;
245
- $(v).text(label_translation_memories[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
246
- }
247
- });
248
- /*dataAuthor = {
249
- ctype : ctype,
250
- word_count : word_count,
251
- language_from : language_from,
252
- language_to : language_to,
253
- language_level : service_level,
254
- quality : quality,
255
- priority : priority,
256
- expertise : expertise,
257
- specific_attachment : specific_attachment,
258
- form_key : $('input[name=form_key]').val()
259
- };
260
- $.ajax({
261
- url : authorurl,
262
- method:'post',
263
- type:'post',
264
- dataType : 'json',
265
- data:dataAuthor,
266
- success: function(data){
267
- if(typeof data.authors != 'undefined'){
268
- $("#mytextmaster option").remove();
269
- for(i=0;i<data.authors.length;i++){
270
- option = '<option value="'+data.authors[i].id+'">'+data.authors[i].ident+'</option>';
271
- $("#mytextmaster").append(option);
272
- }
273
- }
274
- }
275
-
276
- });*/
277
-
278
- }
279
-
280
- //updateDisplay();
281
-
282
- $('input[id^=attribute_],#ctype,#specific_attachment,#priority,#quality,#expertise,#language_level,#store_id_translation').change(function(){
283
- updateDisplay();
284
- });
285
- store_id = $('#store_id_origin').val();
286
- var old_locale = store_langue_correspondance[store_id];
287
- var old_type = $('#ctype').val();
288
- $('#ctype,#store_id_origin').change(function(){
289
- store_id = $('#store_id_origin').val();
290
- locale = store_langue_correspondance[store_id];
291
- if(old_type=='translation'){
292
- briefing_translation[old_locale] = $('#project_briefing').val();
293
- } else {
294
- briefing_proofreading[old_locale] = $('#project_briefing').val();
295
- }
296
- if($('#ctype').val()=='translation') {
297
- $('#project_briefing').val(briefing_translation[locale]);
298
-
299
- } else {
300
- $('#project_briefing').val(briefing_proofreading[locale]);
301
- }
302
- old_locale = locale;
303
- old_type = $('#ctype').val();
304
- });
305
-
306
- $('#store_id_origin').change(function(){
307
- lang = $(this).val();
308
- $('#store_id_translation option').removeAttr('disabled');
309
- if(lang!=0){
310
- $('#store_id_translation option[value='+lang+']').attr('disabled','disabled')
311
- $.each(attribute_word_count[$(this).val()],function(index,value){
312
- $('label[for=attribute_'+index+'] span.tprice').text(value);
313
- });
314
- val = $('#store_id_translation').val();
315
- if(lang==val){
316
- $('#store_id_translation').val(0);
317
- $('#store_id_translation option').removeAttr('selected');
318
- }
319
- }
320
- updateDisplay();
321
- });
322
-
323
-
324
- $('#all-attributes').click(function(e){
325
- e.preventDefault();
326
- $('input[id^=attribute_]').attr('checked','checked');
327
- updateDisplay();
328
- });
329
- $('#notall-attributes').click(function(e){
330
- e.preventDefault();
331
- $('input[id^=attribute_]').removeAttr('checked');
332
- updateDisplay();
333
- });
334
- $('#store_id_origin').change();
335
-
336
- }
337
- if($('#summary_form').length){
338
- editForm = new varienForm('summary_form', '');
339
- }
340
- if(typeof must_display_loader !='undefined' && must_display_loader){
341
- $('#loading-mask').show();
342
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
343
- html = pourcent_avance+'%<span class="progress-cadre"><span class="progress" style="width:'+pourcent_avance+'%"></span></span>';
344
- html += '<span class="message">'+nouveau_message_loader+'</span>';
345
- jQuery('#loading_mask_loader_message').html(html);
346
- jQuery('body > .wrapper > .header a').click(function(e){
347
- if(jQuery(this).attr('href')!='') {
348
- e.preventDefault();
349
- if(typeof ajax_request.transport!='undefined')
350
- ajax_request.transport.abort();
351
- window.location = jQuery(this).attr('href');
352
- }
353
-
354
- });
355
- documentSend(textmasterurl_count);
356
- }
357
- $('button[onclick*="massactionJsObject"]').click(function(e){
358
- //e.preventDefault();
359
- checked = false;
360
- $('input[name=document_id]:checked').each(function() {
361
- checked = true;
362
- });
363
- if(checked) {
364
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
365
- html += '<span class="message">'+message_completed_document+'</span>';
366
- $('#loading_mask_loader_message').html(html);
367
- $('#loading-mask').show();
368
- }
369
- });
370
-
371
- };
372
-
373
- function valideStep2() {
374
-
375
- if(editForm.validator && editForm.validator.validate()){
376
-
377
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
378
- html += '<span class="message">'+nouveau_message_loader+'</span>';
379
- $('loading_mask_loader_message').update(html);
380
- $('loading-mask').show();
381
-
382
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
383
- jQuery('body > .wrapper > .header a').click(function(e){
384
- if(jQuery(this).attr('href')!='') {
385
- e.preventDefault();
386
- if(typeof ajax_request.transport!='undefined')
387
- ajax_request.transport.abort();
388
- window.location = jQuery(this).attr('href');
389
-
390
- }
391
- });
392
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
393
- html += '<span class="message">'+nouveau_message_loader+'</span>';
394
-
395
-
396
- new Ajax.Request(
397
- $('edit_form').action,
398
- {
399
- method: 'post',
400
- parameters: Form.serialize("edit_form"),
401
- onSuccess: function(oXHR) {
402
- json = oXHR.responseText.evalJSON();
403
- if(typeof json.counturl != 'undefined'){
404
- counturl = json.counturl;
405
- documentSend(counturl);
406
-
407
- } else if(typeof json.url != 'undefined'){
408
- window.location = json.url;
409
- $('loading-mask').hide();
410
- } else {
411
- alert('erreur de creation du projet');
412
- $('loading-mask').hide();
413
- }
414
- }
415
- }
416
- );
417
-
418
- }
419
- }
420
- function documentSend (url){
421
- ajax_request = new Ajax.Request(
422
- url,
423
- {
424
- method: 'get',
425
- onSuccess: function(oXHR) {
426
- if(oXHR.responseText.substr(0,4) != 'http'){
427
- if(oXHR.responseText == 'in_progress'){
428
- html = '100% <span class="progress-cadre"><span class="progress" style="width:100%"></span></span>';
429
- html += '<span class="message">'+message_loader_tm+'</span>';
430
- }else{
431
- html = oXHR.responseText+'%'+'<span class="progress-cadre"><span class="progress" style="width:'+oXHR.responseText+'%"></span></span>';
432
- html += '<span class="message">'+nouveau_message_loader+'</span>';
433
- }
434
- $('loading_mask_loader_message').update(html);
435
- if(!stop_ajax)
436
- documentSend(url);
437
- else
438
- stoped_ajax = true;
439
- } else {
440
- $('loading-mask').hide();
441
- window.location = oXHR.responseText;
442
- }
443
- }
444
- }
445
- );
446
- }
447
-
448
- function showAuthors(url,title) {
449
- winCompare = new Window({url:url,title:title,width:680,minimizable:false,maximizable:false,showEffectOptions:{duration:0.4},hideEffectOptions:{duration:0.4}});
450
- winCompare.setZIndex(100);
451
- winCompare.showCenter(true);
452
-
453
- }
454
- function completeDocuments(grid,massactiongrid,transport) {
455
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
456
- html += '<span class="message">'+message_completed_document+'</span>';
457
- $('loading_mask_loader_message').update(html);
458
- $('loading-mask').show();
459
- url = transport.responseJSON.url;
460
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
461
- jQuery('body > .wrapper > .header a').click(function(e){
462
- if(jQuery(this).attr('href')!='') {
463
- e.preventDefault();
464
- if(typeof ajax_request.transport!='undefined')
465
- ajax_request.transport.abort();
466
- window.location = jQuery(this).attr('href');
467
-
468
- }
469
- });
470
- iscomplete(url);
471
-
472
- return;
473
- }
474
- function completeDocument(url,id) {
475
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
476
- html += '<span class="message">'+message_completed_document+'</span>';
477
- $('loading_mask_loader_message').update(html);
478
- $('loading-mask').show();
479
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
480
- jQuery('body > .wrapper > .header a').click(function(e){
481
- if(jQuery(this).attr('href')!='') {
482
- e.preventDefault();
483
- if(typeof ajax_request.transport!='undefined')
484
- ajax_request.transport.abort();
485
- window.location = jQuery(this).attr('href');
486
-
487
- }
488
- });
489
- new Ajax.Request(
490
- url,
491
- {
492
- method: 'get',
493
- onSuccess:function(oXHR) {
494
- json = oXHR.responseText.evalJSON();
495
- if(typeof json.counturl != 'undefined'){
496
- counturl = json.counturl;
497
- iscomplete(counturl);
498
-
499
- } else if(typeof json.url != 'undefined'){
500
- window.location = json.url;
501
-
502
- $('loading-mask').hide();
503
- } else {
504
- alert('erreur lors de la validation du document');
505
- $('loading-mask').hide();
506
- }
507
- }
508
- }
509
- );
510
- }
511
- function iscomplete (url){
512
- new Ajax.Request(
513
- url,
514
- {
515
- method: 'get',
516
- onSuccess:function(oXHR) {
517
- if(oXHR.responseText.substr(0,4) != 'http'){
518
- html = oXHR.responseText+'%'+'<span class="progress-cadre"><span class="progress" style="width:'+oXHR.responseText+'%"></span></span>';
519
- html += '<span class="message">'+message_completed_document+'</span>';
520
- $('loading_mask_loader_message').update(html);
521
- if(!stop_ajax)
522
- iscomplete(url);
523
- else
524
- stoped_ajax = true;
525
- } else {
526
- html = '100%'+'<span class="progress-cadre"><span class="progress" style="width:100%"></span></span>';
527
- html += '<span class="message">'+message_completed_document+'</span>';
528
- $('loading_mask_loader_message').update(html);
529
- $('loading-mask').hide();
530
- window.location = window.location;
531
- }
532
- }
533
- }
534
- );
535
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/adminhtml/default/default/js/textmaster/script.js DELETED
@@ -1,541 +0,0 @@
1
- /**
2
- * Copyright (c) 2014 Textmaster
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Open Software License (OSL 3.0)
7
- * It is available through the world-wide-web at this URL:
8
- * http://opensource.org/licenses/osl-3.0.php
9
- *
10
- * @category Addonline
11
- * @package Addonline_Textmaster
12
- * @copyright Copyright (c) 2014 Textmaster
13
- * @author Addonline (http://www.addonline.fr)
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- */
16
- var stop_ajax = false;
17
- var stoped_ajax = false;
18
- var ajax_request = false;
19
-
20
- window.onload = function() {
21
- if ( (typeof jQuery === 'undefined') && !window.jQuery ) {
22
- //alert('TOTO');
23
- var head = document.getElementsByTagName('head')[0];
24
- url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js';
25
- var headTag = document.getElementsByTagName("head")[0];
26
-
27
- var jqTag = document.createElement('script');
28
- jqTag.type = 'text/javascript';
29
- jqTag.src = url;
30
- jqTag.onload = url;
31
- jqTag.onload = function(){
32
- jQuery.noConflict();
33
- jQueryOnLoad(jQuery);
34
- if(typeof jQueryCall != 'undefined'){
35
-
36
- jQueryCall(jQuery);
37
- }
38
- };
39
- headTag.appendChild(jqTag);
40
-
41
- } else {
42
- jQuery.noConflict();
43
- jQueryOnLoad(jQuery);
44
- if(typeof jQueryCall != 'undefined'){
45
- jQueryCall(jQuery);
46
- }
47
- }
48
- }
49
- jQueryOnLoad = function($){
50
- if($('#config_edit_form').length) {
51
- $('#login,#password' ).keypress(function( event ) {
52
- if ( event.which == 13 ) {
53
- loginAjaxAction();
54
- }
55
- });
56
-
57
- var current_label_translation = $('label[for=textmaster_defaultvalue_briefing_message_translation]').html();
58
- var changeStoreDefault_translation = function(){
59
- current_locale = $('#textmaster_defaultvalue_default_language').val();
60
- all_textarea = $('textarea[id^=briefing_message_translation]').hide();
61
- all_textarea.hide(0);
62
- $('#briefing_message_translation_'+current_locale).show();
63
- label_html = current_label_translation+' ('+$('#briefing_message_translation_'+current_locale).attr('data-label')+')';
64
- $('label[for=textmaster_defaultvalue_briefing_message_translation]').html(label_html);
65
- };
66
-
67
- var current_label_proofreading = $('label[for=textmaster_defaultvalue_briefing_message_proofreading]').html();
68
- var changeStoreDefault_proofreading = function(){
69
- current_locale = $('#textmaster_defaultvalue_default_language').val();
70
- all_textarea = $('textarea[id^=briefing_message_proofreading]');
71
- all_textarea.hide(0);
72
- $('#briefing_message_proofreading_'+current_locale).show();
73
- label_html = current_label_proofreading+' ('+$('#briefing_message_proofreading_'+current_locale).attr('data-label')+')';
74
- $('label[for=textmaster_defaultvalue_briefing_message_proofreading]').html(label_html);
75
- };
76
-
77
-
78
- changeStoreDefault = function(){
79
- changeStoreDefault_proofreading();
80
- changeStoreDefault_translation();
81
- }
82
- $('#textmaster_defaultvalue_default_language').change(changeStoreDefault);
83
- changeStoreDefault();
84
- var changeType = function (){
85
- type = $('#textmaster_defaultvalue_default_type').val();
86
- if(type=='translate') type = 'translation';
87
- $('tr[id^=row_textmaster_defaultvalue_briefing_message]').hide();
88
- $('#row_textmaster_defaultvalue_briefing_message_'+type).show();
89
-
90
- }
91
- $('#textmaster_defaultvalue_default_type').change(changeType);
92
- changeType();
93
-
94
- if(!textmaster_is_log) {
95
- $('#textmaster_defaultvalue').parent().hide();
96
- $('#row_textmaster_textmaster_api_key').hide();
97
- $('#row_textmaster_textmaster_api_secret').hide();
98
- } else {
99
- $('#textmaster_defaultvalue').parent().show();
100
- $('#row_textmaster_textmaster_creation').hide();
101
- $('#row_textmaster_textmaster_api_key').hide();
102
- $('#row_textmaster_textmaster_api_secret').hide();
103
- }
104
- }
105
- if($('#edit_form').length){
106
-
107
-
108
- editForm = new varienForm('edit_form', '');
109
- qualities = $('#quality option');
110
- service_levels = $('#language_level option');
111
- expertises = $('#expertise option');
112
- priorities = $('#priority option');
113
- translation_memories = $('#translation_memory option');
114
-
115
- label_expertises = new Array();
116
- label_priorities = new Array();
117
- label_qualities = new Array();
118
- label_service_levels = new Array();
119
- label_translation_memories = new Array();
120
-
121
- $.each(service_levels,function(index,value){
122
- label_service_levels[index] = $(value).text();
123
- });
124
- $.each(qualities,function(index,value){
125
- label_qualities[index] = $(value).text();
126
- });
127
- $.each(expertises,function(index,value){
128
- label_expertises[index] = $(value).text();
129
- });
130
- $.each(priorities,function(index,value){
131
- label_priorities[index] = $(value).text();
132
- });
133
- $.each(translation_memories,function(index,value){
134
- label_translation_memories[index] = $(value).text();
135
- });
136
-
137
- updateDisplay = function(){
138
- ctype = $('#ctype').val();
139
- //specific_attachment = $('#specific_attachment').val();
140
- priority = $('#priority').val();
141
- quality = $('#quality').val();
142
- expertise = $('#expertise').val();
143
- service_level = $('#language_level').val();
144
- translation_memory = $('#translation_memory').val();
145
- negotiated_contract = $('#negotiated_contract').val();
146
-
147
- $('#textmaster_projet').html($('#ctype option[value='+ctype+']').html());
148
-
149
-
150
- if(typeof service_level =='undefined'){
151
- service_level = 'regular';
152
- }
153
- if(ctype=='translation' && (service_level=='premium' || service_level=='enterprise')){
154
- $('#quality').removeAttr('disabled');
155
- } else {
156
- $('#quality').val(0);
157
- $('#quality').attr('disabled','disabled');
158
- quality = $('#quality').val();
159
- }
160
- if(ctype=='translation' && service_level=='enterprise'){
161
- $('#translation_memory').removeAttr('disabled');
162
- }else {
163
- $('#translation_memory').val(0);
164
- $('#translation_memory').attr('disabled','disabled');
165
- }
166
- $.each(service_levels,function(i,v){
167
- $(v).text(label_service_levels[i]);
168
- });
169
-
170
-
171
- html_option = $('#language_level option[value='+service_level+']').html()+'<br/>';
172
-
173
- base_price = parseFloat(textmaster_pricing['types'][ctype][service_level]);
174
- service_level_price = base_price;
175
-
176
- quality_price = parseFloat(textmaster_pricing['types'][ctype]['quality']);
177
- if(quality=='1'){
178
- html_option += Translator.translate('Control Quality')+'<br/>';
179
- base_price += quality_price;
180
- }
181
- priority_price = parseFloat(textmaster_pricing['types'][ctype]['priority']);
182
- if(priority=='1'){
183
- html_option += Translator.translate('Priority')+'<br/>';
184
- base_price += priority_price;
185
- }
186
- expertise_price = parseFloat(textmaster_pricing['types'][ctype]['expertise']);
187
- if(expertise=='1'){
188
- html_option += Translator.translate('Expertise')+'<br/>';
189
- base_price += expertise_price;
190
- }
191
- translation_memory_price = parseFloat(textmaster_pricing['types'][ctype]['translation_memory']);
192
- if(translation_memory=='1'){
193
- html_option += Translator.translate('Translation memory')+'<br/>';
194
- base_price += translation_memory_price;
195
- }
196
- negotiated_contract_price = parseFloat(textmaster_negotiated_contract_prices[negotiated_contract]);
197
- if(negotiated_contract != undefined && negotiated_contract != ''){
198
- html_option += Translator.translate('Negotiated contract')+'<br/>';
199
- base_price += negotiated_contract_price;
200
- }
201
- /*if(specific_attachment=='1'){
202
- html_option += 'Specific attachment<br/>';
203
- base_price += parseFloat(textmaster_pricing['types'][ctype]['specific_attachment']);
204
- }*/
205
- $('#textmaster_options').html(html_option);
206
- word_count = 0;
207
- lang = $('#store_id_origin').val();
208
- $('input[id^=attribute_]').each(function(index,value){
209
- if($(this).is(':checked') && lang!=0){
210
- code = $(this).val();
211
- word_count += parseInt(attribute_word_count[lang][code]);
212
- }
213
- });
214
- price = Math.round(word_count*base_price*100)/100;
215
- priceFormat = {};
216
- priceFormat.requiredPrecision = 2;
217
- priceFormat.pattern = '%s';
218
- $('#textmaster_nbmot').html(word_count);
219
- $('#textmaster_total_price').html(formatCurrency(price,priceFormat)+' '+currency_symbol+'<br/>'+Translator.translate('worth')+' '+formatCurrency(base_price,priceFormat)+' '+currency_symbol+' / '+Translator.translate('word'));
220
-
221
- language_from = $('#store_id_origin').val();
222
- language_to = $('#store_id_translation').val();
223
-
224
- $.each(service_levels,function(i,v){
225
- if($(v).attr('value')=='premium'){
226
- price = service_level_price*word_count;
227
- $(v).text(label_service_levels[i]);
228
- }
229
- });
230
- $.each(qualities,function(i,v){
231
- if($(v).attr('value')!='0'){
232
- price = quality_price*word_count;
233
- $(v).text(label_qualities[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
234
- }
235
- });
236
- $.each(priorities,function(i,v){
237
- if($(v).attr('value')!='0'){
238
- price = priority_price*word_count;
239
- $(v).text(label_priorities[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
240
- }
241
- });
242
- $.each(expertises,function(i,v){
243
- if($(v).attr('value')!='0'){
244
- price = expertise_price*word_count;
245
- $(v).text(label_expertises[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
246
- }
247
- });
248
- $.each(translation_memories,function(i,v){
249
- if($(v).attr('value')!='0'){
250
- price = translation_memory_price*word_count;
251
- $(v).text(label_translation_memories[i]+' +'+formatCurrency(price,priceFormat)+''+currency_symbol+'');
252
- }
253
- });
254
- /*dataAuthor = {
255
- ctype : ctype,
256
- word_count : word_count,
257
- language_from : language_from,
258
- language_to : language_to,
259
- language_level : service_level,
260
- quality : quality,
261
- priority : priority,
262
- expertise : expertise,
263
- specific_attachment : specific_attachment,
264
- form_key : $('input[name=form_key]').val()
265
- };
266
- $.ajax({
267
- url : authorurl,
268
- method:'post',
269
- type:'post',
270
- dataType : 'json',
271
- data:dataAuthor,
272
- success: function(data){
273
- if(typeof data.authors != 'undefined'){
274
- $("#mytextmaster option").remove();
275
- for(i=0;i<data.authors.length;i++){
276
- option = '<option value="'+data.authors[i].id+'">'+data.authors[i].ident+'</option>';
277
- $("#mytextmaster").append(option);
278
- }
279
- }
280
- }
281
-
282
- });*/
283
-
284
- }
285
-
286
- //updateDisplay();
287
-
288
- $('input[id^=attribute_],#ctype,#specific_attachment,#priority,#quality,#expertise,#language_level,#store_id_translation,#translation_memory,#negotiated_contract').change(function(){
289
- updateDisplay();
290
- });
291
- store_id = $('#store_id_origin').val();
292
- var old_locale = store_langue_correspondance[store_id];
293
- var old_type = $('#ctype').val();
294
- $('#ctype,#store_id_origin').change(function(){
295
- store_id = $('#store_id_origin').val();
296
- locale = store_langue_correspondance[store_id];
297
- if(old_type=='translation'){
298
- briefing_translation[old_locale] = $('#project_briefing').val();
299
- } else {
300
- briefing_proofreading[old_locale] = $('#project_briefing').val();
301
- }
302
- if($('#ctype').val()=='translation') {
303
- $('#project_briefing').val(briefing_translation[locale]);
304
-
305
- } else {
306
- $('#project_briefing').val(briefing_proofreading[locale]);
307
- }
308
- old_locale = locale;
309
- old_type = $('#ctype').val();
310
- });
311
-
312
- $('#store_id_origin').change(function(){
313
- lang = $(this).val();
314
- $('#store_id_translation option').removeAttr('disabled');
315
- if(lang!=0){
316
- $('#store_id_translation option[value='+lang+']').attr('disabled','disabled')
317
- $.each(attribute_word_count[$(this).val()],function(index,value){
318
- $('label[for=attribute_'+index+'] span.tprice').text(value);
319
- });
320
- val = $('#store_id_translation').val();
321
- if(lang==val){
322
- $('#store_id_translation').val(0);
323
- $('#store_id_translation option').removeAttr('selected');
324
- }
325
- }
326
- updateDisplay();
327
- });
328
-
329
-
330
- $('#all-attributes').click(function(e){
331
- e.preventDefault();
332
- $('input[id^=attribute_]').attr('checked','checked');
333
- updateDisplay();
334
- });
335
- $('#notall-attributes').click(function(e){
336
- e.preventDefault();
337
- $('input[id^=attribute_]').removeAttr('checked');
338
- updateDisplay();
339
- });
340
- $('#store_id_origin').change();
341
-
342
- }
343
- if($('#summary_form').length){
344
- editForm = new varienForm('summary_form', '');
345
- }
346
- if(typeof must_display_loader !='undefined' && must_display_loader){
347
- $('#loading-mask').show();
348
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
349
- html = pourcent_avance+'%<span class="progress-cadre"><span class="progress" style="width:'+pourcent_avance+'%"></span></span>';
350
- html += '<span class="message">'+nouveau_message_loader+'</span>';
351
- jQuery('#loading_mask_loader_message').html(html);
352
- jQuery('body > .wrapper > .header a').click(function(e){
353
- if(jQuery(this).attr('href')!='') {
354
- e.preventDefault();
355
- if(typeof ajax_request.transport!='undefined')
356
- ajax_request.transport.abort();
357
- window.location = jQuery(this).attr('href');
358
- }
359
-
360
- });
361
- documentSend(textmasterurl_count);
362
- }
363
- $('button[onclick*="massactionJsObject"]').click(function(e){
364
- //e.preventDefault();
365
- checked = false;
366
- $('input[name=document_id]:checked').each(function() {
367
- checked = true;
368
- });
369
- if(checked) {
370
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
371
- html += '<span class="message">'+message_completed_document+'</span>';
372
- $('#loading_mask_loader_message').html(html);
373
- $('#loading-mask').show();
374
- }
375
- });
376
-
377
- };
378
-
379
- function valideStep2() {
380
-
381
- if(editForm.validator && editForm.validator.validate()){
382
-
383
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
384
- html += '<span class="message">'+nouveau_message_loader+'</span>';
385
- $('loading_mask_loader_message').update(html);
386
- $('loading-mask').show();
387
-
388
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
389
- jQuery('body > .wrapper > .header a').click(function(e){
390
- if(jQuery(this).attr('href')!='') {
391
- e.preventDefault();
392
- if(typeof ajax_request.transport!='undefined')
393
- ajax_request.transport.abort();
394
- window.location = jQuery(this).attr('href');
395
-
396
- }
397
- });
398
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
399
- html += '<span class="message">'+nouveau_message_loader+'</span>';
400
-
401
-
402
- new Ajax.Request(
403
- $('edit_form').action,
404
- {
405
- method: 'post',
406
- parameters: Form.serialize("edit_form"),
407
- onSuccess: function(oXHR) {
408
- json = oXHR.responseText.evalJSON();
409
- if(typeof json.counturl != 'undefined'){
410
- counturl = json.counturl;
411
- documentSend(counturl);
412
-
413
- } else if(typeof json.url != 'undefined'){
414
- window.location = json.url;
415
- $('loading-mask').hide();
416
- } else {
417
- alert('erreur de creation du projet');
418
- $('loading-mask').hide();
419
- }
420
- }
421
- }
422
- );
423
-
424
- }
425
- }
426
- function documentSend (url){
427
- ajax_request = new Ajax.Request(
428
- url,
429
- {
430
- method: 'get',
431
- onSuccess: function(oXHR) {
432
- if(oXHR.responseText.substr(0,4) != 'http'){
433
- if(oXHR.responseText == 'in_progress'){
434
- html = '100% <span class="progress-cadre"><span class="progress" style="width:100%"></span></span>';
435
- html += '<span class="message">'+message_loader_tm+'</span>';
436
- }else{
437
- html = oXHR.responseText+'%'+'<span class="progress-cadre"><span class="progress" style="width:'+oXHR.responseText+'%"></span></span>';
438
- html += '<span class="message">'+nouveau_message_loader+'</span>';
439
- }
440
- $('loading_mask_loader_message').update(html);
441
- if(!stop_ajax)
442
- documentSend(url);
443
- else
444
- stoped_ajax = true;
445
- } else {
446
- $('loading-mask').hide();
447
- window.location = oXHR.responseText;
448
- }
449
- }
450
- }
451
- );
452
- }
453
-
454
- function showAuthors(url,title) {
455
- winCompare = new Window({url:url,title:title,width:680,minimizable:false,maximizable:false,showEffectOptions:{duration:0.4},hideEffectOptions:{duration:0.4}});
456
- winCompare.setZIndex(100);
457
- winCompare.showCenter(true);
458
-
459
- }
460
- function completeDocuments(grid,massactiongrid,transport) {
461
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
462
- html += '<span class="message">'+message_completed_document+'</span>';
463
- $('loading_mask_loader_message').update(html);
464
- $('loading-mask').show();
465
- url = transport.responseJSON.url;
466
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
467
- jQuery('body > .wrapper > .header a').click(function(e){
468
- if(jQuery(this).attr('href')!='') {
469
- e.preventDefault();
470
- if(typeof ajax_request.transport!='undefined')
471
- ajax_request.transport.abort();
472
- window.location = jQuery(this).attr('href');
473
-
474
- }
475
- });
476
- iscomplete(url);
477
-
478
- return;
479
- }
480
- function completeDocument(url,id) {
481
- html = '0%'+'<span class="progress-cadre"><span class="progress" style="width:0%"></span></span>';
482
- html += '<span class="message">'+message_completed_document+'</span>';
483
- $('loading_mask_loader_message').update(html);
484
- $('loading-mask').show();
485
- jQuery('body > .wrapper > .header').css({position:'relative',zIndex:600});
486
- jQuery('body > .wrapper > .header a').click(function(e){
487
- if(jQuery(this).attr('href')!='') {
488
- e.preventDefault();
489
- if(typeof ajax_request.transport!='undefined')
490
- ajax_request.transport.abort();
491
- window.location = jQuery(this).attr('href');
492
-
493
- }
494
- });
495
- new Ajax.Request(
496
- url,
497
- {
498
- method: 'get',
499
- onSuccess:function(oXHR) {
500
- json = oXHR.responseText.evalJSON();
501
- if(typeof json.counturl != 'undefined'){
502
- counturl = json.counturl;
503
- iscomplete(counturl);
504
-
505
- } else if(typeof json.url != 'undefined'){
506
- window.location = json.url;
507
-
508
- $('loading-mask').hide();
509
- } else {
510
- alert('erreur lors de la validation du document');
511
- $('loading-mask').hide();
512
- }
513
- }
514
- }
515
- );
516
- }
517
- function iscomplete (url){
518
- new Ajax.Request(
519
- url,
520
- {
521
- method: 'get',
522
- onSuccess:function(oXHR) {
523
- if(oXHR.responseText.substr(0,4) != 'http'){
524
- html = oXHR.responseText+'%'+'<span class="progress-cadre"><span class="progress" style="width:'+oXHR.responseText+'%"></span></span>';
525
- html += '<span class="message">'+message_completed_document+'</span>';
526
- $('loading_mask_loader_message').update(html);
527
- if(!stop_ajax)
528
- iscomplete(url);
529
- else
530
- stoped_ajax = true;
531
- } else {
532
- html = '100%'+'<span class="progress-cadre"><span class="progress" style="width:100%"></span></span>';
533
- html += '<span class="message">'+message_completed_document+'</span>';
534
- $('loading_mask_loader_message').update(html);
535
- $('loading-mask').hide();
536
- window.location = window.location;
537
- }
538
- }
539
- }
540
- );
541
- }