/include/SugarObjects/templates/basic/vardefs.php

https://github.com/joac/sugarcrm_dev · PHP · 196 lines · 156 code · 5 blank · 35 comment · 0 complexity · 5c3029d1b35fcbf96eb7e90fb7c25251 MD5 · raw file

  1. <?php
  2. /*********************************************************************************
  3. * SugarCRM Community Edition is a customer relationship management program developed by
  4. * SugarCRM, Inc. Copyright (C) 2004-2011 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. 'id' =>
  39. array (
  40. 'name' => 'id',
  41. 'vname' => 'LBL_ID',
  42. 'type' => 'id',
  43. 'required'=>true,
  44. 'reportable'=>true,
  45. 'comment' => 'Unique identifier'
  46. ),
  47. 'name'=>
  48. array(
  49. 'name'=>'name',
  50. 'vname'=> 'LBL_NAME',
  51. 'type'=>'name',
  52. 'link' => true, // bug 39288
  53. 'dbType' => 'varchar',
  54. 'len'=>255,
  55. 'unified_search' => true,
  56. 'required'=>true,
  57. 'importable' => 'required',
  58. ),
  59. 'date_entered' =>
  60. array (
  61. 'name' => 'date_entered',
  62. 'vname' => 'LBL_DATE_ENTERED',
  63. 'type' => 'datetime',
  64. 'group'=>'created_by_name',
  65. 'comment' => 'Date record created',
  66. 'enable_range_search' => true,
  67. 'options' => 'date_range_search_dom',
  68. ),
  69. 'date_modified' =>
  70. array (
  71. 'name' => 'date_modified',
  72. 'vname' => 'LBL_DATE_MODIFIED',
  73. 'type' => 'datetime',
  74. 'group'=>'modified_by_name',
  75. 'comment' => 'Date record last modified',
  76. 'enable_range_search' => true,
  77. 'options' => 'date_range_search_dom',
  78. ),
  79. 'modified_user_id' =>
  80. array (
  81. 'name' => 'modified_user_id',
  82. 'rname' => 'user_name',
  83. 'id_name' => 'modified_user_id',
  84. 'vname' => 'LBL_MODIFIED',
  85. 'type' => 'assigned_user_name',
  86. 'table' => 'users',
  87. 'isnull' => 'false',
  88. 'group'=>'modified_by_name',
  89. 'dbType' => 'id',
  90. 'reportable'=>true,
  91. 'comment' => 'User who last modified record',
  92. ),
  93. 'modified_by_name' =>
  94. array (
  95. 'name' => 'modified_by_name',
  96. 'vname' => 'LBL_MODIFIED_NAME',
  97. 'type' => 'relate',
  98. 'reportable'=>false,
  99. 'source'=>'non-db',
  100. 'rname'=>'user_name',
  101. 'table' => 'users',
  102. 'id_name' => 'modified_user_id',
  103. 'module'=>'Users',
  104. 'link'=>'modified_user_link',
  105. 'duplicate_merge'=>'disabled'
  106. ),
  107. 'created_by' =>
  108. array (
  109. 'name' => 'created_by',
  110. 'rname' => 'user_name',
  111. 'id_name' => 'modified_user_id',
  112. 'vname' => 'LBL_CREATED',
  113. 'type' => 'assigned_user_name',
  114. 'table' => 'users',
  115. 'isnull' => 'false',
  116. 'dbType' => 'id',
  117. 'group'=>'created_by_name',
  118. 'comment' => 'User who created record',
  119. ),
  120. 'created_by_name' =>
  121. array (
  122. 'name' => 'created_by_name',
  123. 'vname' => 'LBL_CREATED',
  124. 'type' => 'relate',
  125. 'reportable'=>false,
  126. 'link' => 'created_by_link',
  127. 'rname' => 'user_name',
  128. 'source'=>'non-db',
  129. 'table' => 'users',
  130. 'id_name' => 'created_by',
  131. 'module'=>'Users',
  132. 'duplicate_merge'=>'disabled',
  133. 'importable' => 'false',
  134. ),
  135. 'description' =>
  136. array (
  137. 'name' => 'description',
  138. 'vname' => 'LBL_DESCRIPTION',
  139. 'type' => 'text',
  140. 'comment' => 'Full text of the note',
  141. 'rows' => 6,
  142. 'cols' => 80,
  143. ),
  144. 'deleted' =>
  145. array (
  146. 'name' => 'deleted',
  147. 'vname' => 'LBL_DELETED',
  148. 'type' => 'bool',
  149. 'default' => '0',
  150. 'reportable'=>false,
  151. 'comment' => 'Record deletion indicator'
  152. ),
  153. /////////////////RELATIONSHIP LINKS////////////////////////////
  154. 'created_by_link' =>
  155. array (
  156. 'name' => 'created_by_link',
  157. 'type' => 'link',
  158. 'relationship' => strtolower($module) . '_created_by',
  159. 'vname' => 'LBL_CREATED_USER',
  160. 'link_type' => 'one',
  161. 'module'=>'Users',
  162. 'bean_name'=>'User',
  163. 'source'=>'non-db',
  164. ),
  165. 'modified_user_link' =>
  166. array (
  167. 'name' => 'modified_user_link',
  168. 'type' => 'link',
  169. 'relationship' => strtolower($module). '_modified_user',
  170. 'vname' => 'LBL_MODIFIED_USER',
  171. 'link_type' => 'one',
  172. 'module'=>'Users',
  173. 'bean_name'=>'User',
  174. 'source'=>'non-db',
  175. ),
  176. ),
  177. 'indices' => array (
  178. 'id'=>array('name' =>strtolower($module).'pk', 'type' =>'primary', 'fields'=>array('id')),
  179. ),
  180. 'relationships'=>array(
  181. strtolower($module).'_modified_user' =>
  182. array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
  183. 'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'modified_user_id',
  184. 'relationship_type'=>'one-to-many')
  185. ,strtolower($module).'_created_by' =>
  186. array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
  187. 'rhs_module'=> $module, 'rhs_table'=> strtolower($module), 'rhs_key' => 'created_by',
  188. 'relationship_type'=>'one-to-many')
  189. ),
  190. );
  191. ?>