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,
40 'full_text_search' => true,
45 'vname' => 'LBL_SUBJECT',
46 'dbType' => 'varchar',
49 'unified_search' => true,
50 'full_text_search' => array('boost' => 3),
51 'importable' => 'required',
57 'vname' => 'LBL_STATUS',
59 'options' => 'task_status_dom',
62 'default' => 'Not Started',
66 'name' => 'date_due_flag',
67 'vname' => 'LBL_DATE_DUE_FLAG',
76 'vname' => 'LBL_DUE_DATE',
77 'type' => 'datetimecombo',
78 'dbType' => 'datetime',
80 'studio' => array('required' => true, 'no_duplicate' => true),
81 'enable_range_search' => true,
82 'options' => 'date_range_search_dom',
87 'vname' => 'LBL_DUE_TIME',
89 //'db_concat_fields'=> array(0=>'date_due'),
91 'importable' => 'false',
92 'massupdate' => false,
96 'name' => 'date_start_flag',
97 'vname' => 'LBL_DATE_START_FLAG',
99 'group'=>'date_start',
105 'name' => 'date_start',
106 'vname' => 'LBL_START_DATE',
107 'type' => 'datetimecombo',
108 'dbType' => 'datetime',
109 'group'=>'date_start',
110 'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
111 'studio' => array('required' => true, 'no_duplicate' => true),
112 'enable_range_search' => true,
113 'options' => 'date_range_search_dom',
117 'name'=>'parent_type',
118 'vname'=>'LBL_PARENT_NAME',
119 'type' => 'parent_type',
121 'group'=>'parent_name',
122 'options'=> 'parent_type_display',
125 'comment' => 'The Sugar object to which the call is related',
126 'options' => 'parent_type_display',
131 'name'=> 'parent_name',
132 'parent_type'=>'record_type_display' ,
133 'type_name'=>'parent_type',
134 'id_name'=>'parent_id',
135 'vname'=>'LBL_LIST_RELATED_TO',
137 'group'=>'parent_name',
139 'options'=> 'parent_type_display',
144 'name' => 'parent_id',
146 'group'=>'parent_name',
148 'vname'=>'LBL_PARENT_ID',
152 'name' => 'contact_id',
154 'group'=>'contact_name',
156 'vname'=>'LBL_CONTACT_ID',
161 'name' => 'contact_name',
162 'rname'=>'last_name',
163 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
164 'source' => 'non-db',
166 'group'=>'contact_name',
167 'vname' => 'LBL_CONTACT_NAME',
169 'id_name' => 'contact_id',
170 'join_name' => 'contacts',
172 'module' => 'Contacts',
179 'name'=>'contact_phone',
182 'vname'=>'LBL_CONTACT_PHONE',
183 'studio'=>array('listview' => true)
188 'name'=>'contact_email',
190 'vname' => 'LBL_EMAIL_ADDRESS',
191 'source' => 'non-db',
197 'name' => 'priority',
198 'vname' => 'LBL_PRIORITY',
200 'options' => 'task_priority_dom',
202 'required' => 'true',
205 'name' => 'contacts',
207 'relationship' => 'contact_tasks',
210 'vname'=>'LBL_CONTACT',
214 'name' => 'accounts',
216 'relationship' => 'account_tasks',
218 'vname'=>'LBL_ACCOUNT',
222 'name' => 'opportunities',
224 'relationship' => 'opportunity_tasks',
226 'vname'=>'LBL_OPPORTUNITY',
232 'relationship' => 'case_tasks',
240 'relationship' => 'bug_tasks',
248 'relationship' => 'lead_tasks',
250 'vname'=>'LBL_LEADS',
254 'name' => 'projects',
256 'relationship' => 'projects_tasks',
258 'vname'=>'LBL_PROJECTS',
262 'name' => 'project_tasks',
264 'relationship' => 'project_tasks_tasks',
266 'vname'=>'LBL_PROJECT_TASKS',
272 'relationship' => 'tasks_notes',
276 'vname'=>'LBL_NOTES',
281 'name' => 'contact_parent',
283 'relationship' => 'contact_tasks_parent',
284 'source' => 'non-db',
285 'reportable' => false
289 'relationships' => array (
290 'tasks_notes' => array(
291 'lhs_module' => 'Tasks',
292 'lhs_table' => 'tasks',
294 'rhs_module' => 'Notes',
295 'rhs_table' => 'notes',
296 'rhs_key' => 'parent_id',
297 'relationship_type' => 'one-to-many',
300 'tasks_assigned_user' =>
301 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
302 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
303 'relationship_type'=>'one-to-many')
305 ,'tasks_modified_user' =>
306 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
307 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
308 'relationship_type'=>'one-to-many')
310 ,'tasks_created_by' =>
311 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
312 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
313 'relationship_type'=>'one-to-many')
315 , 'indices' => array (
316 array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
317 array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
318 array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
319 array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
320 array('name' =>'idx_task_status', 'type'=>'index', 'fields'=>array('status')),
323 //This enables optimistic locking for Saves From EditView
324 ,'optimistic_locking'=>true,
326 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',