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.
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',
122 'comment' => 'The Sugar object to which the call is related'
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',
133 'group'=>'parent_name',
135 'options'=> 'parent_type_display',
140 'name' => 'parent_id',
142 'group'=>'parent_name',
144 'vname'=>'LBL_PARENT_ID',
148 'name' => 'contact_id',
150 'group'=>'contact_name',
152 'vname'=>'LBL_CONTACT_ID',
157 'name' => 'contact_name',
158 'rname'=>'last_name',
159 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
160 'source' => 'non-db',
162 'group'=>'contact_name',
163 'vname' => 'LBL_CONTACT_NAME',
165 'id_name' => 'contact_id',
166 'join_name' => 'contacts',
168 'module' => 'Contacts',
175 'name'=>'contact_phone',
178 'vname'=>'LBL_CONTACT_PHONE',
179 'studio'=>array('listview' => true)
184 'name'=>'contact_email',
186 'vname' => 'LBL_EMAIL_ADDRESS',
187 'source' => 'non-db',
193 'name' => 'priority',
194 'vname' => 'LBL_PRIORITY',
196 'options' => 'task_priority_dom',
198 'required' => 'true',
201 'name' => 'contacts',
203 'relationship' => 'contact_tasks',
206 'vname'=>'LBL_CONTACT',
210 'name' => 'accounts',
212 'relationship' => 'account_tasks',
214 'vname'=>'LBL_ACCOUNT',
218 'name' => 'opportunities',
220 'relationship' => 'opportunity_tasks',
222 'vname'=>'LBL_OPPORTUNITY',
228 'relationship' => 'case_tasks',
236 'relationship' => 'bug_tasks',
244 'relationship' => 'lead_tasks',
246 'vname'=>'LBL_LEADS',
250 'name' => 'projects',
252 'relationship' => 'projects_tasks',
254 'vname'=>'LBL_PROJECTS',
258 'name' => 'project_tasks',
260 'relationship' => 'project_tasks_tasks',
262 'vname'=>'LBL_PROJECT_TASKS',
268 'relationship' => 'tasks_notes',
272 'vname'=>'LBL_NOTES',
277 'name' => 'contact_parent',
279 'relationship' => 'contact_tasks_parent',
280 'source' => 'non-db',
284 'relationships' => array (
285 'tasks_notes' => array(
286 'lhs_module' => 'Tasks',
287 'lhs_table' => 'tasks',
289 'rhs_module' => 'Notes',
290 'rhs_table' => 'notes',
291 'rhs_key' => 'parent_id',
292 'relationship_type' => 'one-to-many',
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')
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')
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')
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')),
317 //This enables optimistic locking for Saves From EditView
318 ,'optimistic_locking'=>true,
320 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',