]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Tasks/vardefs.php
Release 6.1.4
[Github/sugarcrm.git] / modules / Tasks / vardefs.php
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
38 $dictionary['Task'] = array('table' => 'tasks',
39         'unified_search' => true,
40                                'fields' => array (
41   'name' =>
42   array (
43     'name' => 'name',
44     'vname' => 'LBL_SUBJECT',
45     'dbType' => 'varchar',
46     'type' => 'name',
47     'len' => '50',
48         'unified_search' => true,
49     'importable' => 'required',
50     'required' => 'true',
51   ),
52   'status' =>
53   array (
54     'name' => 'status',
55     'vname' => 'LBL_STATUS',
56     'type' => 'enum',
57     'options' => 'task_status_dom',
58     'len' => 100,
59     'required' => 'true',
60   ),
61   'date_due_flag' =>
62   array (
63     'name' => 'date_due_flag',
64     'vname' => 'LBL_DATE_DUE_FLAG',
65     'type' =>'bool',
66     'default'=>0,
67     'group'=>'date_due',
68   ),
69   'date_due' =>
70   array (
71     'name' => 'date_due',
72     'vname' => 'LBL_DUE_DATE',
73     'type' => 'datetimecombo',
74     'dbType' => 'datetime',
75     'group'=>'date_due',
76     'studio' => array('required' => true, 'no_duplicate' => true),
77     ),
78   'time_due' =>
79   array (
80     'name' => 'time_due',
81     'vname' => 'LBL_DUE_TIME',
82     'type' => 'datetime',
83     //'db_concat_fields'=> array(0=>'date_due'),
84     'source' => 'non-db',
85     'importable' => 'false',
86     'massupdate' => false,
87     ),
88   'date_start_flag' =>
89   array (
90     'name' => 'date_start_flag',
91     'vname' => 'LBL_DATE_START_FLAG',
92     'type' =>'bool',
93     'group'=>'date_start',
94     'default'=>0,
95   ),
96   'date_start' =>
97   array (
98     'name' => 'date_start',
99     'vname' => 'LBL_START_DATE',
100     'type' => 'datetimecombo',
101     'dbType' => 'datetime',
102     'group'=>'date_start',
103     'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
104     'studio' => array('required' => true, 'no_duplicate' => true),
105     ),
106  'parent_type'=>
107   array(
108         'name'=>'parent_type',
109         'vname'=>'LBL_PARENT_NAME',
110     'type' => 'parent_type',
111     'dbType'=>'varchar',
112          'group'=>'parent_name',
113         'required'=>false,
114         'len'=>'255',
115     'comment' => 'The Sugar object to which the call is related'
116   ),
117
118   'parent_name'=>
119   array(
120         'name'=> 'parent_name',
121         'parent_type'=>'record_type_display' ,
122         'type_name'=>'parent_type',
123         'id_name'=>'parent_id',
124     'vname'=>'LBL_LIST_RELATED_TO',
125         'type'=>'parent',
126         'group'=>'parent_name',
127         'source'=>'non-db',
128         'options'=> 'parent_type_display',
129   ),
130
131   'parent_id' =>
132   array (
133     'name' => 'parent_id',
134     'type' => 'id',
135     'group'=>'parent_name',
136     'reportable'=>false,
137     'vname'=>'LBL_PARENT_ID',
138   ),
139   'contact_id' =>
140   array (
141     'name' => 'contact_id',
142     'type' => 'id',
143     'group'=>'contact_name',
144     'reportable'=>false,
145     'vname'=>'LBL_CONTACT_ID',
146   ),
147
148   'contact_name' =>
149   array (
150     'name' => 'contact_name',
151     'rname'=>'last_name',
152     'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
153     'source' => 'non-db',
154     'len' => '510',
155     'group'=>'contact_name',
156     'vname' => 'LBL_CONTACT_NAME',
157     'reportable'=>false,
158     'id_name' => 'contact_id',
159     'join_name' => 'contacts',
160     'type' => 'relate',
161     'module' => 'Contacts',
162     'link'=>'contacts',
163     'table'=>'contacts',
164   ),
165
166   'contact_phone'=>
167     array(
168         'name'=>'contact_phone',
169         'type'=>'phone',
170         'source'=>'non-db',
171         'vname'=>'LBL_CONTACT_PHONE',
172     ),
173
174  'contact_email'=>
175     array(
176         'name'=>'contact_email',
177         'type'=>'varchar',
178                 'vname' => 'LBL_EMAIL_ADDRESS',
179                 'source' => 'non-db',
180     ),
181
182   'priority' =>
183   array (
184     'name' => 'priority',
185     'vname' => 'LBL_PRIORITY',
186     'type' => 'enum',
187     'options' => 'task_priority_dom',
188     'len' => 100,
189     'required' => 'true',
190   ),
191         'contacts'=>    array(
192                 'name' => 'contacts',
193                 'type' => 'link',
194                 'relationship' => 'contact_tasks',
195                 'source'=>'non-db',
196                 'side'=>'right',
197                 'vname'=>'LBL_CONTACT',
198         ),
199   'accounts' =>
200   array (
201         'name' => 'accounts',
202     'type' => 'link',
203     'relationship' => 'account_tasks',
204     'source'=>'non-db',
205                 'vname'=>'LBL_ACCOUNT',
206   ),
207   'opportunities' =>
208   array (
209     'name' => 'opportunities',
210     'type' => 'link',
211     'relationship' => 'opportunity_tasks',
212     'source'=>'non-db',
213     'vname'=>'LBL_OPPORTUNITY',
214   ),
215   'cases' =>
216   array (
217     'name' => 'cases',
218     'type' => 'link',
219     'relationship' => 'case_tasks',
220     'source'=>'non-db',
221     'vname'=>'LBL_CASE',
222   ),
223   'bugs' =>
224   array (
225     'name' => 'bugs',
226     'type' => 'link',
227     'relationship' => 'bug_tasks',
228     'source'=>'non-db',
229     'vname'=>'LBL_BUGS',
230   ),
231   'leads' =>
232   array (
233     'name' => 'leads',
234     'type' => 'link',
235     'relationship' => 'lead_tasks',
236     'source'=>'non-db',
237     'vname'=>'LBL_LEADS',
238   ),
239   'projects' =>
240     array (
241     'name' => 'projects',
242     'type' => 'link',
243     'relationship' => 'projects_tasks',
244     'source'=>'non-db',
245     'vname'=>'LBL_PROJECTS',
246   ),
247   'project_tasks' =>
248     array (
249     'name' => 'project_tasks',
250     'type' => 'link',
251     'relationship' => 'project_tasks_tasks',
252     'source'=>'non-db',
253     'vname'=>'LBL_PROJECT_TASKS',
254   ),
255         'contact_parent'=>
256                 array (
257                         'name' => 'contact_parent',
258                         'type' => 'link',
259                         'relationship' => 'contact_tasks_parent',
260                         'source' => 'non-db',
261         ),
262 )
263 ,
264  'relationships' => array (
265
266   'tasks_assigned_user' =>
267    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
268    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
269    'relationship_type'=>'one-to-many')
270
271    ,'tasks_modified_user' =>
272    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
273    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
274    'relationship_type'=>'one-to-many')
275
276    ,'tasks_created_by' =>
277    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
278    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
279    'relationship_type'=>'one-to-many')
280 )
281                                                       , 'indices' => array (
282        array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
283        array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
284        array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
285        array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
286              )
287
288         //This enables optimistic locking for Saves From EditView
289         ,'optimistic_locking'=>true,
290                             );
291 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',
292 ));
293 ?>