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 ********************************************************************************/
38 $dictionary['Document'] = array('table' => 'documents',
39 'unified_search' => true,
40 'unified_search_default_enabled' => true,
45 'name' => 'document_name',
46 'vname' => 'LBL_NAME',
50 'importable' => 'required',
51 'unified_search' => true,
54 array('name'=>'name', 'vname' => 'LBL_NAME', 'source'=>'non-db', 'type'=>'varchar'),
58 'vname' => 'LBL_DOC_ID',
61 'comment' => 'Document ID from documents web server provider',
62 'importable' => false,
68 'vname' => 'LBL_DOC_TYPE',
70 'function' => 'getDocumentsExternalApiDropDown',
72 'comment' => 'Document type (ex: Google, box.net, LotusLive)',
73 'popupHelp' => 'LBL_DOC_TYPE_POPUP',
74 'massupdate' => false,
75 'options' => 'eapm_list',
82 'vname' => 'LBL_DOC_URL',
85 'comment' => 'Document URL from documents web server provider',
86 'importable' => false,
87 'massupdate' => false,
93 'vname' => 'LBL_FILENAME',
96 'comment' => 'The filename of the document attachment',
100 'fileId' => 'document_revision_id',
101 'docType' => 'doc_type',
106 'name' => 'active_date',
107 'vname' => 'LBL_DOC_ACTIVE_DATE',
109 'importable' => 'required',
111 'display_default' => 'now',
116 'name' => 'exp_date',
117 'vname' => 'LBL_DOC_EXP_DATE',
123 'name' => 'category_id',
124 'vname' => 'LBL_SF_CATEGORY',
127 'options' => 'document_category_dom',
133 'name' => 'subcategory_id',
134 'vname' => 'LBL_SF_SUBCATEGORY',
137 'options' => 'document_subcategory_dom',
143 'name' => 'status_id',
144 'vname' => 'LBL_DOC_STATUS',
147 'options' => 'document_status_dom',
154 'vname' => 'LBL_DOC_STATUS',
156 'source' => 'non-db',
157 'comment' => 'Document status for Meta-Data framework',
160 'document_revision_id'=>
162 'name' => 'document_revision_id',
163 'vname' => 'LBL_LATEST_REVISION',
171 'name' => 'revisions',
173 'relationship' => 'document_revisions',
175 'vname'=>'LBL_REVISIONS',
180 'name' => 'revision',
181 'vname' => 'LBL_DOC_VERSION',
186 'importable' => 'required',
191 'last_rev_created_name' =>
193 'name' => 'last_rev_created_name',
194 'vname' => 'LBL_LAST_REV_CREATOR',
199 'last_rev_mime_type' =>
201 'name' => 'last_rev_mime_type',
202 'vname' => 'LBL_LAST_REV_MIME_TYPE',
210 'name' => 'latest_revision',
211 'vname' => 'LBL_LATEST_REVISION',
216 'last_rev_create_date' =>
218 'name' => 'last_rev_create_date',
220 'table' => 'document_revisions',
221 'link' => 'revisions',
222 'join_name' => 'document_revisions',
223 'vname'=>'LBL_LAST_REV_CREATE_DATE',
224 'rname'=> 'date_entered',
228 'contracts' => array (
229 'name' => 'contracts',
231 'relationship' => 'contracts_documents',
232 'source' => 'non-db',
233 'vname' => 'LBL_CONTRACTS',
239 'relationship' => 'leads_documents',
240 'source' => 'non-db',
241 'vname' => 'LBL_LEADS',
243 // Links around the world
246 'name' => 'accounts',
248 'relationship' => 'documents_accounts',
249 'source' => 'non-db',
250 'vname' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
254 'name' => 'contacts',
256 'relationship' => 'documents_contacts',
257 'source' => 'non-db',
258 'vname' => 'LBL_CONTACTS_SUBPANEL_TITLE',
262 'name' => 'opportunities',
264 'relationship' => 'documents_opportunities',
265 'source' => 'non-db',
266 'vname' => 'LBL_OPPORTUNITIES_SUBPANEL_TITLE',
272 'relationship' => 'documents_cases',
273 'source' => 'non-db',
274 'vname' => 'LBL_CASES_SUBPANEL_TITLE',
280 'relationship' => 'documents_bugs',
281 'source' => 'non-db',
282 'vname' => 'LBL_BUGS_SUBPANEL_TITLE',
286 'name' => 'related_doc_id',
287 'vname' => 'LBL_RELATED_DOCUMENT_ID',
294 'related_doc_name' =>
296 'name' => 'related_doc_name',
297 'vname' => 'LBL_DET_RELATED_DOCUMENT',
299 'table' => 'documents',
300 'id_name' => 'related_doc_id',
301 'module' => 'Documents',
302 'source' => 'non-db',
303 'comment' => 'The related document name for Meta-Data framework',
306 'related_doc_rev_id' =>
308 'name' => 'related_doc_rev_id',
309 'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
316 'related_doc_rev_number' =>
318 'name' => 'related_doc_rev_number',
319 'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
321 'source' => 'non-db',
322 'comment' => 'The related document version number for Meta-Data framework',
327 'name' => 'is_template',
328 'vname' => 'LBL_IS_TEMPLATE',
335 'name' => 'template_type',
336 'vname' => 'LBL_TEMPLATE_TYPE',
339 'options' => 'document_template_type_dom',
342 //BEGIN field used for contract document subpanel.
343 'latest_revision_name' =>
345 'name' => 'latest_revision_name',
346 'vname' => 'LBL_LASTEST_REVISION_NAME',
352 'selected_revision_name' =>
354 'name' => 'selected_revision_name',
355 'vname' => 'LBL_SELECTED_REVISION_NAME',
362 'name' => 'contract_status',
363 'vname' => 'LBL_CONTRACT_STATUS',
370 'name' => 'contract_name',
371 'vname' => 'LBL_CONTRACT_NAME',
378 'name' => 'linked_id',
379 'vname' => 'LBL_LINKED_ID',
384 'selected_revision_id'=>
386 'name' => 'selected_revision_id',
387 'vname' => 'LBL_SELECTED_REVISION_ID',
392 'latest_revision_id'=>
394 'name' => 'latest_revision_id',
395 'vname' => 'LBL_LATEST_REVISION_ID',
400 'selected_revision_filename'=>
402 'name' => 'selected_revision_filename',
403 'vname' => 'LBL_SELECTED_REVISION_FILENAME',
408 //END fields used for contract documents subpanel.
412 array('name' =>'idx_doc_cat', 'type' =>'index', 'fields'=>array('category_id', 'subcategory_id')),
414 'relationships' => array (
415 'document_revisions' => array('lhs_module'=> 'Documents', 'lhs_table'=> 'documents', 'lhs_key' => 'id',
416 'rhs_module'=> 'DocumentRevisions', 'rhs_table'=> 'document_revisions', 'rhs_key' => 'document_id',
417 'relationship_type'=>'one-to-many')
419 ,'documents_modified_user' =>
420 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
421 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'modified_user_id',
422 'relationship_type'=>'one-to-many')
424 ,'documents_created_by' =>
425 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
426 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'created_by',
427 'relationship_type'=>'one-to-many')
431 VardefManager::createVardef('Documents','Document', array('default','assignable',