PageRenderTime 58ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/include/SugarObjects/templates/person/vardefs.php

https://github.com/xno/sugarcrm_dev
PHP | 458 lines | 417 code | 5 blank | 36 comment | 0 complexity | 7b94cb921900c82ccc34e8252cde6d4f MD5 | raw file
  1. <?php
  2. /*********************************************************************************
  3. * SugarCRM Community Edition is a customer relationship management program developed by
  4. * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it under
  7. * the terms of the GNU Affero General Public License version 3 as published by the
  8. * Free Software Foundation with the addition of the following permission added
  9. * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
  10. * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
  11. * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
  12. *
  13. * This program is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License along with
  19. * this program; if not, see http://www.gnu.org/licenses or write to the Free
  20. * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  21. * 02110-1301 USA.
  22. *
  23. * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
  24. * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
  25. *
  26. * The interactive user interfaces in modified source and object code versions
  27. * of this program must display Appropriate Legal Notices, as required under
  28. * Section 5 of the GNU Affero General Public License version 3.
  29. *
  30. * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
  31. * these Appropriate Legal Notices must retain the display of the "Powered by
  32. * SugarCRM" logo. If the display of the logo is not reasonably feasible for
  33. * technical reasons, the Appropriate Legal Notices must display the words
  34. * "Powered by SugarCRM".
  35. ********************************************************************************/
  36. $vardefs =array(
  37. 'fields'=> array(
  38. 'salutation' =>
  39. array (
  40. 'name' => 'salutation',
  41. 'vname' => 'LBL_SALUTATION',
  42. 'type' => 'enum',
  43. 'options' => 'salutation_dom',
  44. 'massupdate' => false,
  45. 'len' => '255',
  46. 'comment' => 'Contact salutation (e.g., Mr, Ms)'
  47. ),
  48. 'first_name' =>
  49. array (
  50. 'name' => 'first_name',
  51. 'vname' => 'LBL_FIRST_NAME',
  52. 'type' => 'varchar',
  53. 'len' => '100',
  54. 'unified_search' => true,
  55. 'full_text_search' => array('boost' => 3),
  56. 'comment' => 'First name of the contact',
  57. 'merge_filter' => 'selected',
  58. ),
  59. 'last_name' =>
  60. array (
  61. 'name' => 'last_name',
  62. 'vname' => 'LBL_LAST_NAME',
  63. 'type' => 'varchar',
  64. 'len' => '100',
  65. 'unified_search' => true,
  66. 'full_text_search' => array('boost' => 3),
  67. 'comment' => 'Last name of the contact',
  68. 'merge_filter' => 'selected',
  69. 'required'=>true,
  70. 'importable' => 'required',
  71. ),
  72. 'name' =>
  73. array (
  74. 'name' => 'name',
  75. 'rname' => 'name',
  76. 'vname' => 'LBL_NAME',
  77. 'type' => 'name',
  78. 'link' => true, // bug 39288
  79. 'fields' => array('first_name', 'last_name'),
  80. 'sort_on' => 'last_name',
  81. 'source' => 'non-db',
  82. 'group'=>'last_name',
  83. 'len' => '255',
  84. 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
  85. 'importable' => 'false',
  86. ),
  87. 'full_name' =>
  88. array (
  89. 'name' => 'full_name',
  90. 'rname' => 'full_name',
  91. 'vname' => 'LBL_NAME',
  92. 'type' => 'fullname',
  93. 'fields' => array('first_name', 'last_name'),
  94. 'sort_on' => 'last_name',
  95. 'source' => 'non-db',
  96. 'group'=>'last_name',
  97. 'len' => '510',
  98. 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
  99. 'studio' => array('listview' => false),
  100. ),
  101. 'title' =>
  102. array (
  103. 'name' => 'title',
  104. 'vname' => 'LBL_TITLE',
  105. 'type' => 'varchar',
  106. 'len' => '100',
  107. 'comment' => 'The title of the contact'
  108. ),
  109. 'department' =>
  110. array (
  111. 'name' => 'department',
  112. 'vname' => 'LBL_DEPARTMENT',
  113. 'type' => 'varchar',
  114. 'len' => '255',
  115. 'comment' => 'The department of the contact',
  116. 'merge_filter' => 'enabled',
  117. ),
  118. 'do_not_call' =>
  119. array (
  120. 'name' => 'do_not_call',
  121. 'vname' => 'LBL_DO_NOT_CALL',
  122. 'type' => 'bool',
  123. 'default' => '0',
  124. 'audited'=>true,
  125. 'comment' => 'An indicator of whether contact can be called'
  126. ),
  127. 'phone_home' =>
  128. array (
  129. 'name' => 'phone_home',
  130. 'vname' => 'LBL_HOME_PHONE',
  131. 'type' => 'phone',
  132. 'dbType' => 'varchar',
  133. 'len' => 100,
  134. 'unified_search' => true,
  135. 'full_text_search' => array('boost' => 1),
  136. 'comment' => 'Home phone number of the contact',
  137. 'merge_filter' => 'enabled',
  138. ),
  139. //bug 42902
  140. 'email'=> array(
  141. 'name' => 'email',
  142. 'type' => 'email',
  143. 'query_type' => 'default',
  144. 'source' => 'non-db',
  145. 'operator' => 'subquery',
  146. 'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE',
  147. 'db_field' => array(
  148. 'id',
  149. ),
  150. 'vname' =>'LBL_ANY_EMAIL',
  151. 'studio' => array('visible'=>false, 'searchview'=>true),
  152. ),
  153. 'phone_mobile' =>
  154. array (
  155. 'name' => 'phone_mobile',
  156. 'vname' => 'LBL_MOBILE_PHONE',
  157. 'type' => 'phone',
  158. 'dbType' => 'varchar',
  159. 'len' => 100,
  160. 'unified_search' => true,
  161. 'full_text_search' => array('boost' => 1),
  162. 'comment' => 'Mobile phone number of the contact',
  163. 'merge_filter' => 'enabled',
  164. ),
  165. 'phone_work' =>
  166. array (
  167. 'name' => 'phone_work',
  168. 'vname' => 'LBL_OFFICE_PHONE',
  169. 'type' => 'phone',
  170. 'dbType' => 'varchar',
  171. 'len' => 100,
  172. 'audited'=>true,
  173. 'unified_search' => true,
  174. 'full_text_search' => array('boost' => 1),
  175. 'comment' => 'Work phone number of the contact',
  176. 'merge_filter' => 'enabled',
  177. ),
  178. 'phone_other' =>
  179. array (
  180. 'name' => 'phone_other',
  181. 'vname' => 'LBL_OTHER_PHONE',
  182. 'type' => 'phone',
  183. 'dbType' => 'varchar',
  184. 'len' => 100,
  185. 'unified_search' => true,
  186. 'full_text_search' => array('boost' => 1),
  187. 'comment' => 'Other phone number for the contact',
  188. 'merge_filter' => 'enabled',
  189. ),
  190. 'phone_fax' =>
  191. array (
  192. 'name' => 'phone_fax',
  193. 'vname' => 'LBL_FAX_PHONE',
  194. 'type' => 'phone',
  195. 'dbType' => 'varchar',
  196. 'len' => 100,
  197. 'unified_search' => true,
  198. 'full_text_search' => array('boost' => 1),
  199. 'comment' => 'Contact fax number',
  200. 'merge_filter' => 'enabled',
  201. ),
  202. 'email1' =>
  203. array(
  204. 'name' => 'email1',
  205. 'vname' => 'LBL_EMAIL_ADDRESS',
  206. 'type' => 'varchar',
  207. 'function' => array(
  208. 'name' => 'getEmailAddressWidget',
  209. 'returns' => 'html'),
  210. 'source' => 'non-db',
  211. 'group'=>'email1',
  212. 'merge_filter' => 'enabled',
  213. 'studio' => array('editview' => true, 'editField' => true, 'searchview' => false, 'popupsearch' => false), // bug 46859
  214. 'full_text_search' => array('boost' => 3, 'analyzer' => 'whitespace'), //bug 54567
  215. ),
  216. 'email2' =>
  217. array(
  218. 'name' => 'email2',
  219. 'vname' => 'LBL_OTHER_EMAIL_ADDRESS',
  220. 'type' => 'varchar',
  221. 'function' => array(
  222. 'name' => 'getEmailAddressWidget',
  223. 'returns' => 'html'),
  224. 'source' => 'non-db',
  225. 'group'=>'email2',
  226. 'merge_filter' => 'enabled',
  227. 'studio' => 'false',
  228. ),
  229. 'invalid_email' =>
  230. array(
  231. 'name' => 'invalid_email',
  232. 'vname' => 'LBL_INVALID_EMAIL',
  233. 'source' => 'non-db',
  234. 'type' => 'bool',
  235. 'massupdate' => false,
  236. 'studio' => 'false',
  237. ),
  238. 'email_opt_out' =>
  239. array(
  240. 'name' => 'email_opt_out',
  241. 'vname' => 'LBL_EMAIL_OPT_OUT',
  242. 'source' => 'non-db',
  243. 'type' => 'bool',
  244. 'massupdate' => false,
  245. 'studio'=>'false',
  246. ),
  247. 'primary_address_street' =>
  248. array (
  249. 'name' => 'primary_address_street',
  250. 'vname' => 'LBL_PRIMARY_ADDRESS_STREET',
  251. 'type' => 'varchar',
  252. 'len' => '150',
  253. 'group'=>'primary_address',
  254. 'comment' => 'Street address for primary address',
  255. 'merge_filter' => 'enabled',
  256. ),
  257. 'primary_address_street_2' =>
  258. array (
  259. 'name' => 'primary_address_street_2',
  260. 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_2',
  261. 'type' => 'varchar',
  262. 'len' => '150',
  263. 'source' => 'non-db',
  264. ),
  265. 'primary_address_street_3' =>
  266. array (
  267. 'name' => 'primary_address_street_3',
  268. 'vname' => 'LBL_PRIMARY_ADDRESS_STREET_3',
  269. 'type' => 'varchar',
  270. 'len' => '150',
  271. 'source' => 'non-db',
  272. ),
  273. 'primary_address_city' =>
  274. array (
  275. 'name' => 'primary_address_city',
  276. 'vname' => 'LBL_PRIMARY_ADDRESS_CITY',
  277. 'type' => 'varchar',
  278. 'len' => '100',
  279. 'group'=>'primary_address',
  280. 'comment' => 'City for primary address',
  281. 'merge_filter' => 'enabled',
  282. ),
  283. 'primary_address_state' =>
  284. array (
  285. 'name' => 'primary_address_state',
  286. 'vname' => 'LBL_PRIMARY_ADDRESS_STATE',
  287. 'type' => 'varchar',
  288. 'len' => '100',
  289. 'group'=>'primary_address',
  290. 'comment' => 'State for primary address',
  291. 'merge_filter' => 'enabled',
  292. ),
  293. 'primary_address_postalcode' =>
  294. array (
  295. 'name' => 'primary_address_postalcode',
  296. 'vname' => 'LBL_PRIMARY_ADDRESS_POSTALCODE',
  297. 'type' => 'varchar',
  298. 'len' => '20',
  299. 'group'=>'primary_address',
  300. 'comment' => 'Postal code for primary address',
  301. 'merge_filter' => 'enabled',
  302. ),
  303. 'primary_address_country' =>
  304. array (
  305. 'name' => 'primary_address_country',
  306. 'vname' => 'LBL_PRIMARY_ADDRESS_COUNTRY',
  307. 'type' => 'varchar',
  308. 'group'=>'primary_address',
  309. 'comment' => 'Country for primary address',
  310. 'merge_filter' => 'enabled',
  311. ),
  312. 'alt_address_street' =>
  313. array (
  314. 'name' => 'alt_address_street',
  315. 'vname' => 'LBL_ALT_ADDRESS_STREET',
  316. 'type' => 'varchar',
  317. 'len' => '150',
  318. 'group'=>'alt_address',
  319. 'comment' => 'Street address for alternate address',
  320. 'merge_filter' => 'enabled',
  321. ),
  322. 'alt_address_street_2' =>
  323. array (
  324. 'name' => 'alt_address_street_2',
  325. 'vname' => 'LBL_ALT_ADDRESS_STREET_2',
  326. 'type' => 'varchar',
  327. 'len' => '150',
  328. 'source' => 'non-db',
  329. ),
  330. 'alt_address_street_3' =>
  331. array (
  332. 'name' => 'alt_address_street_3',
  333. 'vname' => 'LBL_ALT_ADDRESS_STREET_3',
  334. 'type' => 'varchar',
  335. 'len' => '150',
  336. 'source' => 'non-db',
  337. ),
  338. 'alt_address_city' =>
  339. array (
  340. 'name' => 'alt_address_city',
  341. 'vname' => 'LBL_ALT_ADDRESS_CITY',
  342. 'type' => 'varchar',
  343. 'len' => '100',
  344. 'group'=>'alt_address',
  345. 'comment' => 'City for alternate address',
  346. 'merge_filter' => 'enabled',
  347. ),
  348. 'alt_address_state' =>
  349. array (
  350. 'name' => 'alt_address_state',
  351. 'vname' => 'LBL_ALT_ADDRESS_STATE',
  352. 'type' => 'varchar',
  353. 'len' => '100',
  354. 'group'=>'alt_address',
  355. 'comment' => 'State for alternate address',
  356. 'merge_filter' => 'enabled',
  357. ),
  358. 'alt_address_postalcode' =>
  359. array (
  360. 'name' => 'alt_address_postalcode',
  361. 'vname' => 'LBL_ALT_ADDRESS_POSTALCODE',
  362. 'type' => 'varchar',
  363. 'len' => '20',
  364. 'group'=>'alt_address',
  365. 'comment' => 'Postal code for alternate address',
  366. 'merge_filter' => 'enabled',
  367. ),
  368. 'alt_address_country' =>
  369. array (
  370. 'name' => 'alt_address_country',
  371. 'vname' => 'LBL_ALT_ADDRESS_COUNTRY',
  372. 'type' => 'varchar',
  373. 'group'=>'alt_address',
  374. 'comment' => 'Country for alternate address',
  375. 'merge_filter' => 'enabled',
  376. ),
  377. 'assistant' =>
  378. array (
  379. 'name' => 'assistant',
  380. 'vname' => 'LBL_ASSISTANT',
  381. 'type' => 'varchar',
  382. 'len' => '75',
  383. 'unified_search' => true,
  384. 'full_text_search' => array('boost' => 2),
  385. 'comment' => 'Name of the assistant of the contact',
  386. 'merge_filter' => 'enabled',
  387. ),
  388. 'assistant_phone' =>
  389. array (
  390. 'name' => 'assistant_phone',
  391. 'vname' => 'LBL_ASSISTANT_PHONE',
  392. 'type' => 'phone',
  393. 'dbType' => 'varchar',
  394. 'len' => 100,
  395. 'group'=>'assistant',
  396. 'unified_search' => true,
  397. 'full_text_search' => array('boost' => 1),
  398. 'comment' => 'Phone number of the assistant of the contact',
  399. 'merge_filter' => 'enabled',
  400. ),
  401. 'email_addresses_primary' =>
  402. array (
  403. 'name' => 'email_addresses_primary',
  404. 'type' => 'link',
  405. 'relationship' => strtolower($object_name).'_email_addresses_primary',
  406. 'source' => 'non-db',
  407. 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
  408. 'duplicate_merge' => 'disabled',
  409. ),
  410. 'email_addresses' =>
  411. array (
  412. 'name' => 'email_addresses',
  413. 'type' => 'link',
  414. 'relationship' => strtolower($object_name).'_email_addresses',
  415. 'source' => 'non-db',
  416. 'vname' => 'LBL_EMAIL_ADDRESSES',
  417. 'reportable'=>false,
  418. 'unified_search' => true,
  419. 'rel_fields' => array('primary_address' => array('type'=>'bool')),
  420. ),
  421. // Used for non-primary mail import
  422. 'email_addresses_non_primary'=>
  423. array(
  424. 'name' => 'email_addresses_non_primary',
  425. 'type' => 'email',
  426. 'source' => 'non-db',
  427. 'vname' =>'LBL_EMAIL_NON_PRIMARY',
  428. 'studio' => false,
  429. 'reportable'=>false,
  430. 'massupdate' => false,
  431. ),
  432. ),
  433. 'relationships'=>array(
  434. strtolower($module).'_email_addresses' =>
  435. array(
  436. 'lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
  437. 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
  438. 'relationship_type'=>'many-to-many',
  439. 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
  440. 'relationship_role_column'=>'bean_module',
  441. 'relationship_role_column_value'=>$module
  442. ),
  443. strtolower($module).'_email_addresses_primary' =>
  444. array('lhs_module'=> $module, 'lhs_table'=> strtolower($module), 'lhs_key' => 'id',
  445. 'rhs_module'=> 'EmailAddresses', 'rhs_table'=> 'email_addresses', 'rhs_key' => 'id',
  446. 'relationship_type'=>'many-to-many',
  447. 'join_table'=> 'email_addr_bean_rel', 'join_key_lhs'=>'bean_id', 'join_key_rhs'=>'email_address_id',
  448. 'relationship_role_column'=>'primary_address',
  449. 'relationship_role_column_value'=>'1'
  450. ),
  451. )
  452. );
  453. ?>