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