PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/Documents/vardefs.php

https://github.com/faouzia/sugarcrm_dev
PHP | 358 lines | 298 code | 23 blank | 37 comment | 2 complexity | 4c78b3da6ffa6272694ad1584b4507d9 MD5 | raw file
  1. <?php
  2. if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
  3. /*********************************************************************************
  4. * SugarCRM is a customer relationship management program developed by
  5. * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it under
  8. * the terms of the GNU Affero General Public License version 3 as published by the
  9. * Free Software Foundation with the addition of the following permission added
  10. * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
  11. * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
  12. * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  17. * details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License along with
  20. * this program; if not, see http://www.gnu.org/licenses or write to the Free
  21. * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22. * 02110-1301 USA.
  23. *
  24. * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
  25. * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
  26. *
  27. * The interactive user interfaces in modified source and object code versions
  28. * of this program must display Appropriate Legal Notices, as required under
  29. * Section 5 of the GNU Affero General Public License version 3.
  30. *
  31. * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
  32. * these Appropriate Legal Notices must retain the display of the "Powered by
  33. * SugarCRM" logo. If the display of the logo is not reasonably feasible for
  34. * technical reasons, the Appropriate Legal Notices must display the words
  35. * "Powered by SugarCRM".
  36. ********************************************************************************/
  37. $dictionary['Document'] = array('table' => 'documents'
  38. ,'fields' => array (
  39. 'document_name' =>
  40. array (
  41. 'name' => 'document_name',
  42. 'vname' => 'LBL_NAME',
  43. 'type' => 'varchar',
  44. 'len' => '255',
  45. 'required'=>true,
  46. 'importable' => 'required',
  47. ),
  48. 'name'=>
  49. array('name'=>'name', 'vname' => 'LBL_NAME', 'source'=>'non-db', 'type'=>'varchar'),
  50. 'filename' =>
  51. array (
  52. 'name' => 'filename',
  53. 'vname' => 'LBL_FILENAME',
  54. 'type' => 'file',
  55. 'source' => 'non-db',
  56. 'comment' => 'The filename of the document attachment',
  57. 'required' => true,
  58. ),
  59. 'uploadfile' =>
  60. array (
  61. 'name'=>'uploadfile',
  62. 'required' => true,
  63. 'vname' => 'LBL_FILE_UPLOAD',
  64. 'type' => 'file',
  65. 'source' => 'non-db',
  66. ),
  67. 'active_date' =>
  68. array (
  69. 'name' => 'active_date',
  70. 'vname' => 'LBL_DOC_ACTIVE_DATE',
  71. 'type' => 'date',
  72. 'importable' => 'required',
  73. 'required' => true,
  74. ),
  75. 'exp_date' =>
  76. array (
  77. 'name' => 'exp_date',
  78. 'vname' => 'LBL_DOC_EXP_DATE',
  79. 'type' => 'date',
  80. ),
  81. 'category_id' =>
  82. array (
  83. 'name' => 'category_id',
  84. 'vname' => 'LBL_SF_CATEGORY',
  85. 'type' => 'enum',
  86. 'len' => 100,
  87. 'options' => 'document_category_dom',
  88. 'reportable'=>false,
  89. ),
  90. 'subcategory_id' =>
  91. array (
  92. 'name' => 'subcategory_id',
  93. 'vname' => 'LBL_SF_SUBCATEGORY',
  94. 'type' => 'enum',
  95. 'len' => 100,
  96. 'options' => 'document_subcategory_dom',
  97. 'reportable'=>false,
  98. ),
  99. 'status_id' =>
  100. array (
  101. 'name' => 'status_id',
  102. 'vname' => 'LBL_DOC_STATUS',
  103. 'type' => 'enum',
  104. 'len' => 100,
  105. 'options' => 'document_status_dom',
  106. 'reportable'=>false,
  107. ),
  108. 'status' =>
  109. array (
  110. 'name' => 'status',
  111. 'vname' => 'LBL_DOC_STATUS',
  112. 'type' => 'varchar',
  113. 'source' => 'non-db',
  114. 'comment' => 'Document status for Meta-Data framework',
  115. ),
  116. 'document_revision_id'=>
  117. array (
  118. 'name' => 'document_revision_id',
  119. 'vname' => 'LBL_LATEST_REVISION',
  120. 'type' => 'varchar',
  121. 'len' => '36',
  122. 'reportable'=>false,
  123. ),
  124. 'revisions' =>
  125. array (
  126. 'name' => 'revisions',
  127. 'type' => 'link',
  128. 'relationship' => 'document_revisions',
  129. 'source'=>'non-db',
  130. 'vname'=>'LBL_REVISIONS',
  131. ),
  132. 'revision' =>
  133. array (
  134. 'name' => 'revision',
  135. 'vname' => 'LBL_DOC_VERSION',
  136. 'type' => 'varchar',
  137. 'reportable'=>false,
  138. 'required' => true,
  139. 'source'=>'non-db',
  140. 'importable' => 'required',
  141. 'required' => true,
  142. ),
  143. 'last_rev_created_name' =>
  144. array (
  145. 'name' => 'last_rev_created_name',
  146. 'vname' => 'LBL_LAST_REV_CREATOR',
  147. 'type' => 'varchar',
  148. 'reportable'=>false,
  149. 'source'=>'non-db'
  150. ),
  151. 'last_rev_mime_type' =>
  152. array (
  153. 'name' => 'last_rev_mime_type',
  154. 'vname' => 'LBL_LAST_REV_MIME_TYPE',
  155. 'type' => 'varchar',
  156. 'reportable'=>false,
  157. 'studio' => 'false',
  158. 'source'=>'non-db'
  159. ),
  160. 'latest_revision' =>
  161. array (
  162. 'name' => 'latest_revision',
  163. 'vname' => 'LBL_LATEST_REVISION',
  164. 'type' => 'varchar',
  165. 'reportable'=>false,
  166. 'source'=>'non-db'
  167. ),
  168. 'last_rev_create_date' =>
  169. array (
  170. 'name' => 'last_rev_create_date',
  171. 'type' => 'date',
  172. 'table' => 'document_revisions',
  173. 'link' => 'revisions',
  174. 'join_name' => 'document_revisions',
  175. 'vname'=>'LBL_LAST_REV_CREATE_DATE',
  176. 'rname'=> 'date_entered',
  177. 'reportable'=>false,
  178. 'source'=>'non-db'
  179. ),
  180. 'contracts' => array (
  181. 'name' => 'contracts',
  182. 'type' => 'link',
  183. 'relationship' => 'contracts_documents',
  184. 'source' => 'non-db',
  185. 'vname' => 'LBL_CONTRACTS',
  186. ),
  187. //todo remove
  188. 'leads' => array (
  189. 'name' => 'leads',
  190. 'type' => 'link',
  191. 'relationship' => 'leads_documents',
  192. 'source' => 'non-db',
  193. 'vname' => 'LBL_LEADS',
  194. ),
  195. 'related_doc_id' =>
  196. array (
  197. 'name' => 'related_doc_id',
  198. 'vname' => 'LBL_RELATED_DOCUMENT_ID',
  199. 'reportable'=>false,
  200. 'dbType' => 'id',
  201. 'type' => 'varchar',
  202. 'len' => '36',
  203. ),
  204. 'related_doc_name' =>
  205. array (
  206. 'name' => 'related_doc_name',
  207. 'vname' => 'LBL_DET_RELATED_DOCUMENT',
  208. 'type' => 'relate',
  209. 'table' => 'documents',
  210. 'id_name' => 'related_doc_id',
  211. 'module' => 'Documents',
  212. 'source' => 'non-db',
  213. 'comment' => 'The related document name for Meta-Data framework',
  214. ),
  215. 'related_doc_rev_id' =>
  216. array (
  217. 'name' => 'related_doc_rev_id',
  218. 'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
  219. 'reportable'=>false,
  220. 'dbType' => 'id',
  221. 'type' => 'varchar',
  222. 'len' => '36',
  223. ),
  224. 'related_doc_rev_number' =>
  225. array (
  226. 'name' => 'related_doc_rev_number',
  227. 'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
  228. 'type' => 'varchar',
  229. 'source' => 'non-db',
  230. 'comment' => 'The related document version number for Meta-Data framework',
  231. ),
  232. 'is_template' =>
  233. array (
  234. 'name' => 'is_template',
  235. 'vname' => 'LBL_IS_TEMPLATE',
  236. 'type' => 'bool',
  237. 'default'=> 0,
  238. 'reportable'=>false,
  239. ),
  240. 'template_type' =>
  241. array (
  242. 'name' => 'template_type',
  243. 'vname' => 'LBL_TEMPLATE_TYPE',
  244. 'type' => 'enum',
  245. 'len' => 100,
  246. 'options' => 'document_template_type_dom',
  247. 'reportable'=>false,
  248. ),
  249. //BEGIN field used for contract document subpanel.
  250. 'latest_revision_name' =>
  251. array (
  252. 'name' => 'latest_revision_name',
  253. 'vname' => 'LBL_LASTEST_REVISION_NAME',
  254. 'type' => 'varchar',
  255. 'reportable'=>false,
  256. 'source'=>'non-db'
  257. ),
  258. 'selected_revision_name' =>
  259. array (
  260. 'name' => 'selected_revision_name',
  261. 'vname' => 'LBL_SELECTED_REVISION_NAME',
  262. 'type' => 'varchar',
  263. 'reportable'=>false,
  264. 'source'=>'non-db'
  265. ),
  266. 'contract_status' =>
  267. array (
  268. 'name' => 'contract_status',
  269. 'vname' => 'LBL_CONTRACT_STATUS',
  270. 'type' => 'varchar',
  271. 'reportable'=>false,
  272. 'source'=>'non-db'
  273. ),
  274. 'contract_name'=>
  275. array (
  276. 'name' => 'contract_name',
  277. 'vname' => 'LBL_CONTRACT_NAME',
  278. 'type' => 'varchar',
  279. 'reportable'=>false,
  280. 'source'=>'non-db'
  281. ),
  282. 'linked_id'=>
  283. array (
  284. 'name' => 'linked_id',
  285. 'vname' => 'LBL_LINKED_ID',
  286. 'type' => 'varchar',
  287. 'reportable'=>false,
  288. 'source'=>'non-db'
  289. ),
  290. 'selected_revision_id'=>
  291. array (
  292. 'name' => 'selected_revision_id',
  293. 'vname' => 'LBL_SELECTED_REVISION_ID',
  294. 'type' => 'varchar',
  295. 'reportable'=>false,
  296. 'source'=>'non-db'
  297. ),
  298. 'latest_revision_id'=>
  299. array (
  300. 'name' => 'latest_revision_id',
  301. 'vname' => 'LBL_LATEST_REVISION_ID',
  302. 'type' => 'varchar',
  303. 'reportable'=>false,
  304. 'source'=>'non-db'
  305. ),
  306. 'selected_revision_filename'=>
  307. array (
  308. 'name' => 'selected_revision_filename',
  309. 'vname' => 'LBL_SELECTED_REVISION_FILENAME',
  310. 'type' => 'varchar',
  311. 'reportable'=>false,
  312. 'source'=>'non-db'
  313. ),
  314. //END fields used for contract documents subpanel.
  315. ),
  316. 'indices' => array (
  317. array('name' =>'idx_doc_cat', 'type' =>'index', 'fields'=>array('category_id', 'subcategory_id')),
  318. ),
  319. 'relationships' => array (
  320. 'document_revisions' => array('lhs_module'=> 'Documents', 'lhs_table'=> 'documents', 'lhs_key' => 'id',
  321. 'rhs_module'=> 'Documents', 'rhs_table'=> 'document_revisions', 'rhs_key' => 'document_id',
  322. 'relationship_type'=>'one-to-many')
  323. ,'documents_modified_user' =>
  324. array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
  325. 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'modified_user_id',
  326. 'relationship_type'=>'one-to-many')
  327. ,'documents_created_by' =>
  328. array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
  329. 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'created_by',
  330. 'relationship_type'=>'one-to-many')
  331. ),
  332. );
  333. VardefManager::createVardef('Documents','Document', array('default',
  334. ));
  335. ?>