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-2012 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
38 $dictionary['Task'] = array('table' => 'tasks',
39 'unified_search' => true,
44 'vname' => 'LBL_SUBJECT',
45 'dbType' => 'varchar',
48 'unified_search' => true,
49 'importable' => 'required',
55 'vname' => 'LBL_STATUS',
57 'options' => 'task_status_dom',
60 'default' => 'Not Started',
64 'name' => 'date_due_flag',
65 'vname' => 'LBL_DATE_DUE_FLAG',
74 'vname' => 'LBL_DUE_DATE',
75 'type' => 'datetimecombo',
76 'dbType' => 'datetime',
78 'studio' => array('required' => true, 'no_duplicate' => true),
79 'enable_range_search' => true,
80 'options' => 'date_range_search_dom',
85 'vname' => 'LBL_DUE_TIME',
87 //'db_concat_fields'=> array(0=>'date_due'),
89 'importable' => 'false',
90 'massupdate' => false,
94 'name' => 'date_start_flag',
95 'vname' => 'LBL_DATE_START_FLAG',
97 'group'=>'date_start',
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',
115 'name'=>'parent_type',
116 'vname'=>'LBL_PARENT_NAME',
117 'type' => 'parent_type',
119 'group'=>'parent_name',
120 'options'=> 'parent_type_display',
123 'comment' => 'The Sugar object to which the call is related',
124 'options' => 'parent_type_display',
129 'name'=> 'parent_name',
130 'parent_type'=>'record_type_display' ,
131 'type_name'=>'parent_type',
132 'id_name'=>'parent_id',
133 'vname'=>'LBL_LIST_RELATED_TO',
135 'group'=>'parent_name',
137 'options'=> 'parent_type_display',
142 'name' => 'parent_id',
144 'group'=>'parent_name',
146 'vname'=>'LBL_PARENT_ID',
150 'name' => 'contact_id',
152 'group'=>'contact_name',
154 'vname'=>'LBL_CONTACT_ID',
159 'name' => 'contact_name',
160 'rname'=>'last_name',
161 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
162 'source' => 'non-db',
164 'group'=>'contact_name',
165 'vname' => 'LBL_CONTACT_NAME',
167 'id_name' => 'contact_id',
168 'join_name' => 'contacts',
170 'module' => 'Contacts',
177 'name'=>'contact_phone',
180 'vname'=>'LBL_CONTACT_PHONE',
181 'studio'=>array('listview' => true)
186 'name'=>'contact_email',
188 'vname' => 'LBL_EMAIL_ADDRESS',
189 'source' => 'non-db',
195 'name' => 'priority',
196 'vname' => 'LBL_PRIORITY',
198 'options' => 'task_priority_dom',
200 'required' => 'true',
203 'name' => 'contacts',
205 'relationship' => 'contact_tasks',
208 'vname'=>'LBL_CONTACT',
212 'name' => 'accounts',
214 'relationship' => 'account_tasks',
216 'vname'=>'LBL_ACCOUNT',
220 'name' => 'opportunities',
222 'relationship' => 'opportunity_tasks',
224 'vname'=>'LBL_OPPORTUNITY',
230 'relationship' => 'case_tasks',
238 'relationship' => 'bug_tasks',
246 'relationship' => 'lead_tasks',
248 'vname'=>'LBL_LEADS',
252 'name' => 'projects',
254 'relationship' => 'projects_tasks',
256 'vname'=>'LBL_PROJECTS',
260 'name' => 'project_tasks',
262 'relationship' => 'project_tasks_tasks',
264 'vname'=>'LBL_PROJECT_TASKS',
270 'relationship' => 'tasks_notes',
274 'vname'=>'LBL_NOTES',
279 'name' => 'contact_parent',
281 'relationship' => 'contact_tasks_parent',
282 'source' => 'non-db',
283 'reportable' => false
287 'relationships' => array (
288 'tasks_notes' => array(
289 'lhs_module' => 'Tasks',
290 'lhs_table' => 'tasks',
292 'rhs_module' => 'Notes',
293 'rhs_table' => 'notes',
294 'rhs_key' => 'parent_id',
295 'relationship_type' => 'one-to-many',
298 'tasks_assigned_user' =>
299 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
300 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
301 'relationship_type'=>'one-to-many')
303 ,'tasks_modified_user' =>
304 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
305 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
306 'relationship_type'=>'one-to-many')
308 ,'tasks_created_by' =>
309 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
310 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
311 'relationship_type'=>'one-to-many')
313 , 'indices' => array (
314 array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
315 array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
316 array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
317 array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
318 array('name' =>'idx_task_status', 'type'=>'index', 'fields'=>array('status')),
321 //This enables optimistic locking for Saves From EditView
322 ,'optimistic_locking'=>true,
324 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',