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 ********************************************************************************/
39 $dictionary['Note'] = array(
42 'unified_search' => true,
43 'comment' => 'Notes and Attachments'
52 'comment' => 'Unique identifier'
56 'name' => 'date_entered',
57 'vname' => 'LBL_DATE_ENTERED',
59 'comment' => 'Date record created'
63 'name' => 'date_modified',
64 'vname' => 'LBL_DATE_MODIFIED',
66 'comment' => 'Date record last modified'
70 'name' => 'modified_user_id',
71 'rname' => 'user_name',
72 'id_name' => 'modified_user_id',
73 'vname' => 'LBL_MODIFIED',
74 'type' => 'assigned_user_name',
77 'group'=>'modified_by_name',
80 'comment' => 'User who last modified record',
84 'name' => 'modified_by_name',
85 'vname' => 'LBL_MODIFIED_BY',
91 'id_name' => 'modified_user_id',
93 'link'=>'modified_user_link',
94 'duplicate_merge'=>'disabled'
98 'name' => 'created_by',
99 'rname' => 'user_name',
100 'id_name' => 'modified_user_id',
101 'vname' => 'LBL_CREATED_BY',
102 'type' => 'assigned_user_name',
106 'comment' => 'User who created record'
110 'name' => 'created_by_name',
111 'vname' => 'LBL_CREATED_BY',
114 'link' => 'created_by_link',
115 'rname' => 'user_name',
118 'id_name' => 'created_by',
120 'duplicate_merge'=>'disabled',
121 'importable' => 'false',
126 'vname' => 'LBL_NOTE_SUBJECT',
127 'dbType' => 'varchar',
130 'unified_search' => true,
131 'comment' => 'Name of the note',
132 'importable' => 'required',
137 'name' => 'filename',
138 'vname' => 'LBL_FILENAME',
142 'comment' => 'File name associated with the note (attachment)',
143 'importable' => false,
147 'name' => 'file_mime_type',
148 'vname' => 'LBL_FILE_MIME_TYPE',
151 'comment' => 'Attachment MIME type',
152 'importable' => false,
157 'vname' => 'LBL_FILE_URL',
159 'function_require'=>'include/upload_file.php',
160 'function_class'=>'UploadFile',
161 'function_name'=>'get_url',
162 'function_params'=> array('filename', 'id'),
163 'source'=>'function',
165 'comment' => 'Path to file (can be URL)',
166 'importable' => false,
170 'name'=>'parent_type',
171 'vname'=>'LBL_PARENT_TYPE',
172 'type' =>'parent_type',
173 'dbType' => 'varchar',
174 'group'=>'parent_name',
176 'comment' => 'Sugar module the Note is associated with'
181 'vname'=>'LBL_PARENT_ID',
185 'comment' => 'The ID of the Sugar item specified in parent_type'
189 'name'=>'contact_id',
190 'vname'=>'LBL_CONTACT_ID',
194 'comment' => 'Contact ID note is associated with'
198 'name' => 'portal_flag',
199 'vname' => 'LBL_PORTAL_FLAG',
202 'comment' => 'Portal flag indicator determines if note created via portal'
206 'name' => 'embed_flag',
207 'vname' => 'LBL_EMBED_FLAG',
210 'comment' => 'Embed flag indicator determines if note embedded in email'
214 'name' => 'description',
215 'vname' => 'LBL_NOTE_STATUS',
217 'comment' => 'Full text of the note'
222 'vname' => 'LBL_DELETED',
227 'comment' => 'Record deletion indicator'
234 'name'=> 'parent_name',
235 'parent_type'=>'record_type_display' ,
236 'type_name'=>'parent_type',
237 'id_name'=>'parent_id', 'vname'=>'LBL_RELATED_TO',
240 'options'=> 'record_type_display_notes',
245 'name'=>'contact_name',
246 'rname'=>'last_name',
247 'id_name'=>'contact_id',
248 'vname'=>'LBL_CONTACT_NAME',
252 'join_name'=>'contacts',
253 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
255 'module'=>'Contacts',
261 'name'=>'contact_phone',
262 'vname' => 'LBL_PHONE',
264 'vname' => 'LBL_PHONE',
270 'name'=>'contact_email',
272 'vname' => 'LBL_EMAIL_ADDRESS',
278 'name' => 'account_id',
279 'vname' => 'LBL_ACCOUNT_ID',
286 'name' => 'opportunity_id',
287 'vname' => 'LBL_OPPORTUNITY_ID',
294 'name' => 'acase_id',
295 'vname' => 'LBL_CASE_ID',
303 'vname' => 'LBL_LEAD_ID',
310 'name' => 'product_id',
311 'vname' => 'LBL_PRODUCT_ID',
318 'name' => 'quote_id',
319 'vname' => 'LBL_QUOTE_ID',
327 'name' => 'created_by_link',
329 'relationship' => 'notes_created_by',
330 'vname' => 'LBL_CREATED_BY_USER',
331 'link_type' => 'one',
336 'modified_user_link' =>
338 'name' => 'modified_user_link',
340 'relationship' => 'notes_modified_user',
341 'vname' => 'LBL_MODIFIED_BY_USER',
342 'link_type' => 'one',
352 'relationship' => 'contact_notes',
353 'vname' => 'LBL_LIST_CONTACT_NAME',
360 'relationship' => 'case_notes',
361 'vname' => 'LBL_CASES',
366 'name' => 'accounts',
368 'relationship' => 'account_notes',
370 'vname'=>'LBL_ACCOUNTS',
374 'name' => 'opportunities',
376 'relationship' => 'opportunity_notes',
378 'vname'=>'LBL_OPPORTUNITIES',
384 'relationship' => 'lead_notes',
386 'vname'=>'LBL_LEADS',
390 'name' => 'products',
392 'relationship' => 'product_notes',
394 'vname'=>'LBL_PRODUCTS',
400 'relationship' => 'quote_notes',
401 'vname' => 'LBL_QUOTES',
406 'name' => 'contracts',
408 'relationship' => 'contract_notes',
409 'source' => 'non-db',
410 'vname' => 'LBL_CONTRACTS',
416 'relationship' => 'bug_notes',
423 'vname'=> 'LBL_EMAILS',
425 'relationship'=> 'emails_notes_rel',
430 'name' => 'projects',
432 'relationship' => 'projects_notes',
434 'vname'=>'LBL_PROJECTS',
438 'name' => 'project_tasks',
440 'relationship' => 'project_tasks_notes',
442 'vname'=>'LBL_PROJECT_TASKS',
446 'name' => 'meetings',
448 'relationship' => 'meetings_notes',
450 'vname'=>'LBL_MEETINGS',
456 'relationship' => 'calls_notes',
458 'vname'=>'LBL_CALLS',
462 'name' => 'description',
463 'vname' => 'LBL_DESCRIPTION',
465 'comment' => 'Full text of the note',
470 'relationships'=>array(
471 'notes_modified_user' =>
472 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
473 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'modified_user_id',
474 'relationship_type'=>'one-to-many')
476 ,'notes_created_by' =>
477 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
478 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'created_by',
479 'relationship_type'=>'one-to-many')
483 , 'indices' => array (
484 array('name' =>'notespk', 'type' =>'primary', 'fields'=>array('id')),
485 array('name' =>'idx_note_name', 'type'=>'index', 'fields'=>array('name')),
486 array('name' =>'idx_notes_parent', 'type'=>'index', 'fields'=>array('parent_id', 'parent_type')),
487 array('name' =>'idx_note_contact', 'type'=>'index', 'fields'=>array('contact_id')),
491 //This enables optimistic locking for Saves From EditView
492 ,'optimistic_locking'=>true,
495 VardefManager::createVardef('Notes','Note', array('assignable',