2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM 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',
63 'name' => 'date_due_flag',
64 'vname' => 'LBL_DATE_DUE_FLAG',
72 'vname' => 'LBL_DUE_DATE',
73 'type' => 'datetimecombo',
74 'dbType' => 'datetime',
76 'studio' => array('required' => true, 'no_duplicate' => true),
81 'vname' => 'LBL_DUE_TIME',
83 //'db_concat_fields'=> array(0=>'date_due'),
85 'importable' => 'false',
86 'massupdate' => false,
90 'name' => 'date_start_flag',
91 'vname' => 'LBL_DATE_START_FLAG',
93 'group'=>'date_start',
98 'name' => 'date_start',
99 'vname' => 'LBL_START_DATE',
100 'type' => 'datetimecombo',
101 'dbType' => 'datetime',
102 'group'=>'date_start',
103 'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
104 'studio' => array('required' => true, 'no_duplicate' => true),
108 'name'=>'parent_type',
109 'vname'=>'LBL_PARENT_NAME',
110 'type' => 'parent_type',
112 'group'=>'parent_name',
115 'comment' => 'The Sugar object to which the call is related'
120 'name'=> 'parent_name',
121 'parent_type'=>'record_type_display' ,
122 'type_name'=>'parent_type',
123 'id_name'=>'parent_id',
124 'vname'=>'LBL_LIST_RELATED_TO',
126 'group'=>'parent_name',
128 'options'=> 'parent_type_display',
133 'name' => 'parent_id',
135 'group'=>'parent_name',
137 'vname'=>'LBL_PARENT_ID',
141 'name' => 'contact_id',
143 'group'=>'contact_name',
145 'vname'=>'LBL_CONTACT_ID',
150 'name' => 'contact_name',
151 'rname'=>'last_name',
152 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
153 'source' => 'non-db',
155 'group'=>'contact_name',
156 'vname' => 'LBL_CONTACT_NAME',
158 'id_name' => 'contact_id',
159 'join_name' => 'contacts',
161 'module' => 'Contacts',
168 'name'=>'contact_phone',
171 'vname'=>'LBL_CONTACT_PHONE',
176 'name'=>'contact_email',
178 'vname' => 'LBL_EMAIL_ADDRESS',
179 'source' => 'non-db',
184 'name' => 'priority',
185 'vname' => 'LBL_PRIORITY',
187 'options' => 'task_priority_dom',
189 'required' => 'true',
192 'name' => 'contacts',
194 'relationship' => 'contact_tasks',
197 'vname'=>'LBL_CONTACT',
201 'name' => 'accounts',
203 'relationship' => 'account_tasks',
205 'vname'=>'LBL_ACCOUNT',
209 'name' => 'opportunities',
211 'relationship' => 'opportunity_tasks',
213 'vname'=>'LBL_OPPORTUNITY',
219 'relationship' => 'case_tasks',
227 'relationship' => 'bug_tasks',
235 'relationship' => 'lead_tasks',
237 'vname'=>'LBL_LEADS',
241 'name' => 'projects',
243 'relationship' => 'projects_tasks',
245 'vname'=>'LBL_PROJECTS',
249 'name' => 'project_tasks',
251 'relationship' => 'project_tasks_tasks',
253 'vname'=>'LBL_PROJECT_TASKS',
257 'name' => 'contact_parent',
259 'relationship' => 'contact_tasks_parent',
260 'source' => 'non-db',
264 'relationships' => array (
266 'tasks_assigned_user' =>
267 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
268 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
269 'relationship_type'=>'one-to-many')
271 ,'tasks_modified_user' =>
272 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
273 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
274 'relationship_type'=>'one-to-many')
276 ,'tasks_created_by' =>
277 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
278 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
279 'relationship_type'=>'one-to-many')
281 , 'indices' => array (
282 array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
283 array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
284 array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
285 array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
288 //This enables optimistic locking for Saves From EditView
289 ,'optimistic_locking'=>true,
291 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',