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 ********************************************************************************/
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_class'=>'UploadFile',
160 'function_name'=>'get_upload_url',
161 'function_params'=> array('$this'),
162 'source'=>'function',
164 'comment' => 'Path to file (can be URL)',
165 'importable' => false,
169 'name'=>'parent_type',
170 'vname'=>'LBL_PARENT_TYPE',
171 'type' =>'parent_type',
172 'dbType' => 'varchar',
173 'group'=>'parent_name',
175 'comment' => 'Sugar module the Note is associated with'
180 'vname'=>'LBL_PARENT_ID',
184 'comment' => 'The ID of the Sugar item specified in parent_type'
188 'name'=>'contact_id',
189 'vname'=>'LBL_CONTACT_ID',
193 'comment' => 'Contact ID note is associated with'
197 'name' => 'portal_flag',
198 'vname' => 'LBL_PORTAL_FLAG',
201 'comment' => 'Portal flag indicator determines if note created via portal'
205 'name' => 'embed_flag',
206 'vname' => 'LBL_EMBED_FLAG',
209 'comment' => 'Embed flag indicator determines if note embedded in email'
213 'name' => 'description',
214 'vname' => 'LBL_NOTE_STATUS',
216 'comment' => 'Full text of the note'
221 'vname' => 'LBL_DELETED',
226 'comment' => 'Record deletion indicator'
233 'name'=> 'parent_name',
234 'parent_type'=>'record_type_display' ,
235 'type_name'=>'parent_type',
236 'id_name'=>'parent_id', 'vname'=>'LBL_RELATED_TO',
239 'options'=> 'record_type_display_notes',
244 'name'=>'contact_name',
245 'rname'=>'last_name',
246 'id_name'=>'contact_id',
247 'vname'=>'LBL_CONTACT_NAME',
251 'join_name'=>'contacts',
252 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
254 'module'=>'Contacts',
260 'name'=>'contact_phone',
261 'vname' => 'LBL_PHONE',
263 'vname' => 'LBL_PHONE',
269 'name'=>'contact_email',
271 'vname' => 'LBL_EMAIL_ADDRESS',
277 'name' => 'account_id',
278 'vname' => 'LBL_ACCOUNT_ID',
285 'name' => 'opportunity_id',
286 'vname' => 'LBL_OPPORTUNITY_ID',
293 'name' => 'acase_id',
294 'vname' => 'LBL_CASE_ID',
302 'vname' => 'LBL_LEAD_ID',
309 'name' => 'product_id',
310 'vname' => 'LBL_PRODUCT_ID',
317 'name' => 'quote_id',
318 'vname' => 'LBL_QUOTE_ID',
326 'name' => 'created_by_link',
328 'relationship' => 'notes_created_by',
329 'vname' => 'LBL_CREATED_BY_USER',
330 'link_type' => 'one',
335 'modified_user_link' =>
337 'name' => 'modified_user_link',
339 'relationship' => 'notes_modified_user',
340 'vname' => 'LBL_MODIFIED_BY_USER',
341 'link_type' => 'one',
351 'relationship' => 'contact_notes',
352 'vname' => 'LBL_LIST_CONTACT_NAME',
359 'relationship' => 'case_notes',
360 'vname' => 'LBL_CASES',
365 'name' => 'accounts',
367 'relationship' => 'account_notes',
369 'vname'=>'LBL_ACCOUNTS',
373 'name' => 'opportunities',
375 'relationship' => 'opportunity_notes',
377 'vname'=>'LBL_OPPORTUNITIES',
383 'relationship' => 'lead_notes',
385 'vname'=>'LBL_LEADS',
389 'name' => 'products',
391 'relationship' => 'product_notes',
393 'vname'=>'LBL_PRODUCTS',
399 'relationship' => 'quote_notes',
400 'vname' => 'LBL_QUOTES',
405 'name' => 'contracts',
407 'relationship' => 'contract_notes',
408 'source' => 'non-db',
409 'vname' => 'LBL_CONTRACTS',
415 'relationship' => 'bug_notes',
422 'vname'=> 'LBL_EMAILS',
424 'relationship'=> 'emails_notes_rel',
429 'name' => 'projects',
431 'relationship' => 'projects_notes',
433 'vname'=>'LBL_PROJECTS',
437 'name' => 'project_tasks',
439 'relationship' => 'project_tasks_notes',
441 'vname'=>'LBL_PROJECT_TASKS',
445 'name' => 'meetings',
447 'relationship' => 'meetings_notes',
449 'vname'=>'LBL_MEETINGS',
455 'relationship' => 'calls_notes',
457 'vname'=>'LBL_CALLS',
461 'name' => 'description',
462 'vname' => 'LBL_DESCRIPTION',
464 'comment' => 'Full text of the note',
469 'relationships'=>array(
470 'notes_modified_user' =>
471 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
472 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'modified_user_id',
473 'relationship_type'=>'one-to-many')
475 ,'notes_created_by' =>
476 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
477 'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'created_by',
478 'relationship_type'=>'one-to-many')
482 , 'indices' => array (
483 array('name' =>'notespk', 'type' =>'primary', 'fields'=>array('id')),
484 array('name' =>'idx_note_name', 'type'=>'index', 'fields'=>array('name')),
485 array('name' =>'idx_notes_parent', 'type'=>'index', 'fields'=>array('parent_id', 'parent_type')),
486 array('name' =>'idx_note_contact', 'type'=>'index', 'fields'=>array('contact_id')),
490 //This enables optimistic locking for Saves From EditView
491 ,'optimistic_locking'=>true,
494 VardefManager::createVardef('Notes','Note', array('assignable',