]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Tasks/vardefs.php
Release 6.2.4
[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     'options' => 'parent_type_display',
124 ),
125
126   'parent_name'=>
127   array(
128         'name'=> 'parent_name',
129         'parent_type'=>'record_type_display' ,
130         'type_name'=>'parent_type',
131         'id_name'=>'parent_id',
132     'vname'=>'LBL_LIST_RELATED_TO',
133         'type'=>'parent',
134         'group'=>'parent_name',
135         'source'=>'non-db',
136         'options'=> 'parent_type_display',
137   ),
138
139   'parent_id' =>
140   array (
141     'name' => 'parent_id',
142     'type' => 'id',
143     'group'=>'parent_name',
144     'reportable'=>false,
145     'vname'=>'LBL_PARENT_ID',
146   ),
147   'contact_id' =>
148   array (
149     'name' => 'contact_id',
150     'type' => 'id',
151     'group'=>'contact_name',
152     'reportable'=>false,
153     'vname'=>'LBL_CONTACT_ID',
154   ),
155
156   'contact_name' =>
157   array (
158     'name' => 'contact_name',
159     'rname'=>'last_name',
160     'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
161     'source' => 'non-db',
162     'len' => '510',
163     'group'=>'contact_name',
164     'vname' => 'LBL_CONTACT_NAME',
165     'reportable'=>false,
166     'id_name' => 'contact_id',
167     'join_name' => 'contacts',
168     'type' => 'relate',
169     'module' => 'Contacts',
170     'link'=>'contacts',
171     'table'=>'contacts',
172   ),
173
174   'contact_phone'=>
175     array(
176         'name'=>'contact_phone',
177         'type'=>'phone',
178         'source'=>'non-db',
179         'vname'=>'LBL_CONTACT_PHONE',
180         'studio'=>array('listview' => true)
181     ),
182
183  'contact_email'=>
184     array(
185         'name'=>'contact_email',
186         'type'=>'varchar',
187                 'vname' => 'LBL_EMAIL_ADDRESS',
188                 'source' => 'non-db',
189         'studio' => 'hidden'
190     ),
191
192   'priority' =>
193   array (
194     'name' => 'priority',
195     'vname' => 'LBL_PRIORITY',
196     'type' => 'enum',
197     'options' => 'task_priority_dom',
198     'len' => 100,
199     'required' => 'true',
200   ),
201         'contacts'=>    array(
202                 'name' => 'contacts',
203                 'type' => 'link',
204                 'relationship' => 'contact_tasks',
205                 'source'=>'non-db',
206                 'side'=>'right',
207                 'vname'=>'LBL_CONTACT',
208         ),
209   'accounts' =>
210   array (
211         'name' => 'accounts',
212     'type' => 'link',
213     'relationship' => 'account_tasks',
214     'source'=>'non-db',
215                 'vname'=>'LBL_ACCOUNT',
216   ),
217   'opportunities' =>
218   array (
219     'name' => 'opportunities',
220     'type' => 'link',
221     'relationship' => 'opportunity_tasks',
222     'source'=>'non-db',
223     'vname'=>'LBL_OPPORTUNITY',
224   ),
225   'cases' =>
226   array (
227     'name' => 'cases',
228     'type' => 'link',
229     'relationship' => 'case_tasks',
230     'source'=>'non-db',
231     'vname'=>'LBL_CASE',
232   ),
233   'bugs' =>
234   array (
235     'name' => 'bugs',
236     'type' => 'link',
237     'relationship' => 'bug_tasks',
238     'source'=>'non-db',
239     'vname'=>'LBL_BUGS',
240   ),
241   'leads' =>
242   array (
243     'name' => 'leads',
244     'type' => 'link',
245     'relationship' => 'lead_tasks',
246     'source'=>'non-db',
247     'vname'=>'LBL_LEADS',
248   ),
249   'projects' =>
250     array (
251     'name' => 'projects',
252     'type' => 'link',
253     'relationship' => 'projects_tasks',
254     'source'=>'non-db',
255     'vname'=>'LBL_PROJECTS',
256   ),
257   'project_tasks' =>
258     array (
259     'name' => 'project_tasks',
260     'type' => 'link',
261     'relationship' => 'project_tasks_tasks',
262     'source'=>'non-db',
263     'vname'=>'LBL_PROJECT_TASKS',
264   ),
265     'notes' =>
266   array (
267         'name' => 'notes',
268     'type' => 'link',
269     'relationship' => 'tasks_notes',
270     'module'=>'Notes',
271     'bean_name'=>'Note',
272     'source'=>'non-db',
273                 'vname'=>'LBL_NOTES',
274   ),
275   
276         'contact_parent'=>
277                 array (
278                         'name' => 'contact_parent',
279                         'type' => 'link',
280                         'relationship' => 'contact_tasks_parent',
281                         'source' => 'non-db',
282         ),
283 )
284 ,
285  'relationships' => array (
286                 'tasks_notes' => array(
287                         'lhs_module'            => 'Tasks',
288                         'lhs_table'                     => 'tasks',
289                         'lhs_key'                       => 'id',
290                         'rhs_module'            => 'Notes',
291                         'rhs_table'                     => 'notes',
292                         'rhs_key'                       => 'parent_id',
293                         'relationship_type'     => 'one-to-many',
294                 ),
295
296   'tasks_assigned_user' =>
297    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
298    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
299    'relationship_type'=>'one-to-many')
300
301    ,'tasks_modified_user' =>
302    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
303    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
304    'relationship_type'=>'one-to-many')
305
306    ,'tasks_created_by' =>
307    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
308    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
309    'relationship_type'=>'one-to-many')
310 )
311                                                       , 'indices' => array (
312        array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
313        array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
314        array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
315        array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
316              )
317
318         //This enables optimistic locking for Saves From EditView
319         ,'optimistic_locking'=>true,
320                             );
321 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',
322 ));
323 ?>