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',
73 'vname' => 'LBL_DUE_DATE',
74 'type' => 'datetimecombo',
75 'dbType' => 'datetime',
77 'studio' => array('required' => true, 'no_duplicate' => true),
82 'vname' => 'LBL_DUE_TIME',
84 //'db_concat_fields'=> array(0=>'date_due'),
86 'importable' => 'false',
87 'massupdate' => false,
91 'name' => 'date_start_flag',
92 'vname' => 'LBL_DATE_START_FLAG',
94 'group'=>'date_start',
100 'name' => 'date_start',
101 'vname' => 'LBL_START_DATE',
102 'type' => 'datetimecombo',
103 'dbType' => 'datetime',
104 'group'=>'date_start',
105 'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
106 'studio' => array('required' => true, 'no_duplicate' => true),
110 'name'=>'parent_type',
111 'vname'=>'LBL_PARENT_NAME',
112 'type' => 'parent_type',
114 'group'=>'parent_name',
117 'comment' => 'The Sugar object to which the call is related'
122 'name'=> 'parent_name',
123 'parent_type'=>'record_type_display' ,
124 'type_name'=>'parent_type',
125 'id_name'=>'parent_id',
126 'vname'=>'LBL_LIST_RELATED_TO',
128 'group'=>'parent_name',
130 'options'=> 'parent_type_display',
135 'name' => 'parent_id',
137 'group'=>'parent_name',
139 'vname'=>'LBL_PARENT_ID',
143 'name' => 'contact_id',
145 'group'=>'contact_name',
147 'vname'=>'LBL_CONTACT_ID',
152 'name' => 'contact_name',
153 'rname'=>'last_name',
154 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
155 'source' => 'non-db',
157 'group'=>'contact_name',
158 'vname' => 'LBL_CONTACT_NAME',
160 'id_name' => 'contact_id',
161 'join_name' => 'contacts',
163 'module' => 'Contacts',
170 'name'=>'contact_phone',
173 'vname'=>'LBL_CONTACT_PHONE',
178 'name'=>'contact_email',
180 'vname' => 'LBL_EMAIL_ADDRESS',
181 'source' => 'non-db',
186 'name' => 'priority',
187 'vname' => 'LBL_PRIORITY',
189 'options' => 'task_priority_dom',
191 'required' => 'true',
194 'name' => 'contacts',
196 'relationship' => 'contact_tasks',
199 'vname'=>'LBL_CONTACT',
203 'name' => 'accounts',
205 'relationship' => 'account_tasks',
207 'vname'=>'LBL_ACCOUNT',
211 'name' => 'opportunities',
213 'relationship' => 'opportunity_tasks',
215 'vname'=>'LBL_OPPORTUNITY',
221 'relationship' => 'case_tasks',
229 'relationship' => 'bug_tasks',
237 'relationship' => 'lead_tasks',
239 'vname'=>'LBL_LEADS',
243 'name' => 'projects',
245 'relationship' => 'projects_tasks',
247 'vname'=>'LBL_PROJECTS',
251 'name' => 'project_tasks',
253 'relationship' => 'project_tasks_tasks',
255 'vname'=>'LBL_PROJECT_TASKS',
259 'name' => 'contact_parent',
261 'relationship' => 'contact_tasks_parent',
262 'source' => 'non-db',
266 'relationships' => array (
268 'tasks_assigned_user' =>
269 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
270 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
271 'relationship_type'=>'one-to-many')
273 ,'tasks_modified_user' =>
274 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
275 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
276 'relationship_type'=>'one-to-many')
278 ,'tasks_created_by' =>
279 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
280 'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
281 'relationship_type'=>'one-to-many')
283 , 'indices' => array (
284 array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
285 array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
286 array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
287 array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
290 //This enables optimistic locking for Saves From EditView
291 ,'optimistic_locking'=>true,
293 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',