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['Note'] = array(
41 'unified_search' => true, 'full_text_search' => true, 'unified_search_default_enabled' => true,
43 'comment' => 'Notes and Attachments'
52 'comment' => 'Unique identifier'
56 'name' => 'date_entered',
57 'vname' => 'LBL_DATE_ENTERED',
59 'comment' => 'Date record created',
60 'enable_range_search' => true,
61 'options' => 'date_range_search_dom',
65 'name' => 'date_modified',
66 'vname' => 'LBL_DATE_MODIFIED',
68 'comment' => 'Date record last modified',
69 'enable_range_search' => true,
73 'name' => 'modified_user_id',
74 'rname' => 'user_name',
75 'id_name' => 'modified_user_id',
76 'vname' => 'LBL_MODIFIED',
77 'type' => 'assigned_user_name',
80 'group'=>'modified_by_name',
83 'comment' => 'User who last modified record',
87 'name' => 'modified_by_name',
88 'vname' => 'LBL_MODIFIED_BY',
94 'id_name' => 'modified_user_id',
96 'link'=>'modified_user_link',
97 'duplicate_merge'=>'disabled'
101 'name' => 'created_by',
102 'rname' => 'user_name',
103 'id_name' => 'modified_user_id',
104 'vname' => 'LBL_CREATED_BY',
105 'type' => 'assigned_user_name',
109 'comment' => 'User who created record'
113 'name' => 'created_by_name',
114 'vname' => 'LBL_CREATED_BY',
117 'link' => 'created_by_link',
118 'rname' => 'user_name',
121 'id_name' => 'created_by',
123 'duplicate_merge'=>'disabled',
124 'importable' => 'false',
129 'vname' => 'LBL_NOTE_SUBJECT',
130 'dbType' => 'varchar',
133 'unified_search' => true,
134 'full_text_search' => array('boost' => 3),
135 'comment' => 'Name of the note',
136 'importable' => 'required',
141 'name' => 'file_mime_type',
142 'vname' => 'LBL_FILE_MIME_TYPE',
145 'comment' => 'Attachment MIME type',
146 'importable' => false,
151 'vname' => 'LBL_FILE_URL',
153 'function_class'=>'UploadFile',
154 'function_name'=>'get_upload_url',
155 'function_params'=> array('$this'),
156 'source'=>'function',
158 'comment' => 'Path to file (can be URL)',
159 'importable' => false,
163 'name' => 'filename',
164 'vname' => 'LBL_FILENAME',
166 'dbType' => 'varchar',
169 'comment' => 'File name associated with the note (attachment)',
170 'importable' => false,
174 'name'=>'parent_type',
175 'vname'=>'LBL_PARENT_TYPE',
176 'type' =>'parent_type',
177 'dbType' => 'varchar',
178 'group'=>'parent_name',
180 'comment' => 'Sugar module the Note is associated with'
185 'vname'=>'LBL_PARENT_ID',
189 'comment' => 'The ID of the Sugar item specified in parent_type'
193 'name'=>'contact_id',
194 'vname'=>'LBL_CONTACT_ID',
198 'comment' => 'Contact ID note is associated with'
202 'name' => 'portal_flag',
203 'vname' => 'LBL_PORTAL_FLAG',
206 'comment' => 'Portal flag indicator determines if note created via portal'
210 'name' => 'embed_flag',
211 'vname' => 'LBL_EMBED_FLAG',
214 'comment' => 'Embed flag indicator determines if note embedded in email'
218 'name' => 'description',
219 'vname' => 'LBL_NOTE_STATUS',
221 'comment' => 'Full text of the note'
226 'vname' => 'LBL_DELETED',
231 'comment' => 'Record deletion indicator'
238 'name'=> 'parent_name',
239 'parent_type'=>'record_type_display' ,
240 'type_name'=>'parent_type',
241 'id_name'=>'parent_id', 'vname'=>'LBL_RELATED_TO',
244 'options'=> 'record_type_display_notes',
249 'name'=>'contact_name',
251 'id_name'=>'contact_id',
252 'vname'=>'LBL_CONTACT_NAME',
256 'join_name'=>'contacts',
257 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
259 'module'=>'Contacts',
265 'name'=>'contact_phone',
266 'vname' => 'LBL_PHONE',
268 'vname' => 'LBL_PHONE',
274 'name'=>'contact_email',
276 'vname' => 'LBL_EMAIL_ADDRESS',
277 'source' => 'non-db',
283 'name' => 'account_id',
284 'vname' => 'LBL_ACCOUNT_ID',
291 'name' => 'opportunity_id',
292 'vname' => 'LBL_OPPORTUNITY_ID',
299 'name' => 'acase_id',
300 'vname' => 'LBL_CASE_ID',
308 'vname' => 'LBL_LEAD_ID',
316 'name' => 'created_by_link',
318 'relationship' => 'notes_created_by',
319 'vname' => 'LBL_CREATED_BY_USER',
320 'link_type' => 'one',
325 'modified_user_link' =>
327 'name' => 'modified_user_link',
329 'relationship' => 'notes_modified_user',
330 'vname' => 'LBL_MODIFIED_BY_USER',
331 'link_type' => 'one',
341 'relationship' => 'contact_notes',
342 'vname' => 'LBL_LIST_CONTACT_NAME',
349 'relationship' => 'case_notes',
350 'vname' => 'LBL_CASES',
355 'name' => 'accounts',
357 'relationship' => 'account_notes',
359 'vname'=>'LBL_ACCOUNTS',
363 'name' => 'opportunities',
365 'relationship' => 'opportunity_notes',
367 'vname'=>'LBL_OPPORTUNITIES',
373 'relationship' => 'lead_notes',
375 'vname'=>'LBL_LEADS',
381 'relationship' => 'bug_notes',
388 'vname'=> 'LBL_EMAILS',
390 'relationship'=> 'emails_notes_rel',
395 'name' => 'projects',
397 'relationship' => 'projects_notes',
399 'vname'=>'LBL_PROJECTS',
403 'name' => 'project_tasks',
405 'relationship' => 'project_tasks_notes',
407 'vname'=>'LBL_PROJECT_TASKS',
411 'name' => 'meetings',
413 'relationship' => 'meetings_notes',
415 'vname'=>'LBL_MEETINGS',
421 'relationship' => 'calls_notes',
423 'vname'=>'LBL_CALLS',
429 'relationship' => 'tasks_notes',
431 'vname'=>'LBL_TASKS',
435 'name' => 'description',
436 'vname' => 'LBL_DESCRIPTION',
438 'comment' => 'Full text of the note',
443 'relationships'=>array(
444 'notes_modified_user' =>
445 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
446 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'modified_user_id',
447 'relationship_type'=>'one-to-many')
449 ,'notes_created_by' =>
450 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
451 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'created_by',
452 'relationship_type'=>'one-to-many')
456 , 'indices' => array (
457 array('name' =>'notespk', 'type' =>'primary', 'fields'=>array('id')),
458 array('name' =>'idx_note_name', 'type'=>'index', 'fields'=>array('name')),
459 array('name' =>'idx_notes_parent', 'type'=>'index', 'fields'=>array('parent_id', 'parent_type')),
460 array('name' =>'idx_note_contact', 'type'=>'index', 'fields'=>array('contact_id')),
461 array('name' =>'idx_notes_assigned_del', 'type' =>'index', 'fields'=>array( 'deleted', 'assigned_user_id')),
465 //This enables optimistic locking for Saves From EditView
466 ,'optimistic_locking'=>true,
469 VardefManager::createVardef('Notes','Note', array('assignable',