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['Document'] = array('table' => 'documents',
39 'unified_search' => true,
40 'full_text_search' => true,
41 'unified_search_default_enabled' => true,
46 'name' => 'document_name',
47 'vname' => 'LBL_NAME',
51 'importable' => 'required',
52 'unified_search' => true,
53 'full_text_search' => array('boost' => 3),
57 'vname' => 'LBL_NAME',
64 'vname' => 'LBL_DOC_ID',
67 'comment' => 'Document ID from documents web server provider',
68 'importable' => false,
74 'vname' => 'LBL_DOC_TYPE',
76 'function' => 'getDocumentsExternalApiDropDown',
78 'comment' => 'Document type (ex: Google, box.net, LotusLive)',
79 'popupHelp' => 'LBL_DOC_TYPE_POPUP',
80 'massupdate' => false,
81 'options' => 'eapm_list',
88 'vname' => 'LBL_DOC_URL',
91 'comment' => 'Document URL from documents web server provider',
92 'importable' => false,
93 'massupdate' => false,
99 'vname' => 'LBL_FILENAME',
101 'source' => 'non-db',
102 'comment' => 'The filename of the document attachment',
106 'fileId' => 'document_revision_id',
107 'docType' => 'doc_type',
108 'docUrl' => 'doc_url',
114 'name' => 'active_date',
115 'vname' => 'LBL_DOC_ACTIVE_DATE',
117 'importable' => 'required',
119 'display_default' => 'now',
124 'name' => 'exp_date',
125 'vname' => 'LBL_DOC_EXP_DATE',
131 'name' => 'category_id',
132 'vname' => 'LBL_SF_CATEGORY',
135 'options' => 'document_category_dom',
136 'reportable' => true,
141 'name' => 'subcategory_id',
142 'vname' => 'LBL_SF_SUBCATEGORY',
145 'options' => 'document_subcategory_dom',
146 'reportable' => true,
151 'name' => 'status_id',
152 'vname' => 'LBL_DOC_STATUS',
155 'options' => 'document_status_dom',
156 'reportable' => false,
162 'vname' => 'LBL_DOC_STATUS',
164 'source' => 'non-db',
165 'comment' => 'Document status for Meta-Data framework',
168 'document_revision_id' =>
170 'name' => 'document_revision_id',
171 'vname' => 'LBL_LATEST_REVISION',
174 'reportable' => false,
179 'name' => 'revisions',
181 'relationship' => 'document_revisions',
182 'source' => 'non-db',
183 'vname' => 'LBL_REVISIONS',
188 'name' => 'revision',
189 'vname' => 'LBL_DOC_VERSION',
191 'reportable' => false,
193 'source' => 'non-db',
194 'importable' => 'required',
199 'last_rev_created_name' =>
201 'name' => 'last_rev_created_name',
202 'vname' => 'LBL_LAST_REV_CREATOR',
204 'reportable' => false,
207 'last_rev_mime_type' =>
209 'name' => 'last_rev_mime_type',
210 'vname' => 'LBL_LAST_REV_MIME_TYPE',
212 'reportable' => false,
218 'name' => 'latest_revision',
219 'vname' => 'LBL_LATEST_REVISION',
221 'reportable' => false,
224 'last_rev_create_date' =>
226 'name' => 'last_rev_create_date',
228 'table' => 'document_revisions',
229 'link' => 'revisions',
230 'join_name' => 'document_revisions',
231 'vname' => 'LBL_LAST_REV_CREATE_DATE',
232 'rname' => 'date_entered',
233 'reportable' => false,
236 'contracts' => array(
237 'name' => 'contracts',
239 'relationship' => 'contracts_documents',
240 'source' => 'non-db',
241 'vname' => 'LBL_CONTRACTS',
247 'relationship' => 'leads_documents',
248 'source' => 'non-db',
249 'vname' => 'LBL_LEADS',
251 // Links around the world
254 'name' => 'accounts',
256 'relationship' => 'documents_accounts',
257 'source' => 'non-db',
258 'vname' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
262 'name' => 'contacts',
264 'relationship' => 'documents_contacts',
265 'source' => 'non-db',
266 'vname' => 'LBL_CONTACTS_SUBPANEL_TITLE',
270 'name' => 'opportunities',
272 'relationship' => 'documents_opportunities',
273 'source' => 'non-db',
274 'vname' => 'LBL_OPPORTUNITIES_SUBPANEL_TITLE',
280 'relationship' => 'documents_cases',
281 'source' => 'non-db',
282 'vname' => 'LBL_CASES_SUBPANEL_TITLE',
288 'relationship' => 'documents_bugs',
289 'source' => 'non-db',
290 'vname' => 'LBL_BUGS_SUBPANEL_TITLE',
294 'name' => 'related_doc_id',
295 'vname' => 'LBL_RELATED_DOCUMENT_ID',
296 'reportable' => false,
302 'related_doc_name' =>
304 'name' => 'related_doc_name',
305 'vname' => 'LBL_DET_RELATED_DOCUMENT',
307 'table' => 'documents',
308 'id_name' => 'related_doc_id',
309 'module' => 'Documents',
310 'source' => 'non-db',
311 'comment' => 'The related document name for Meta-Data framework',
314 'related_doc_rev_id' =>
316 'name' => 'related_doc_rev_id',
317 'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
318 'reportable' => false,
324 'related_doc_rev_number' =>
326 'name' => 'related_doc_rev_number',
327 'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
329 'source' => 'non-db',
330 'comment' => 'The related document version number for Meta-Data framework',
335 'name' => 'is_template',
336 'vname' => 'LBL_IS_TEMPLATE',
339 'reportable' => false,
343 'name' => 'template_type',
344 'vname' => 'LBL_TEMPLATE_TYPE',
347 'options' => 'document_template_type_dom',
348 'reportable' => false,
350 //BEGIN field used for contract document subpanel.
351 'latest_revision_name' =>
353 'name' => 'latest_revision_name',
354 'vname' => 'LBL_LASTEST_REVISION_NAME',
356 'reportable' => false,
360 'selected_revision_name' =>
362 'name' => 'selected_revision_name',
363 'vname' => 'LBL_SELECTED_REVISION_NAME',
365 'reportable' => false,
370 'name' => 'contract_status',
371 'vname' => 'LBL_CONTRACT_STATUS',
373 'reportable' => false,
378 'name' => 'contract_name',
379 'vname' => 'LBL_CONTRACT_NAME',
381 'reportable' => false,
386 'name' => 'linked_id',
387 'vname' => 'LBL_LINKED_ID',
389 'reportable' => false,
392 'selected_revision_id' =>
394 'name' => 'selected_revision_id',
395 'vname' => 'LBL_SELECTED_REVISION_ID',
397 'reportable' => false,
400 'latest_revision_id' =>
402 'name' => 'latest_revision_id',
403 'vname' => 'LBL_LATEST_REVISION_ID',
405 'reportable' => false,
408 'selected_revision_filename' =>
410 'name' => 'selected_revision_filename',
411 'vname' => 'LBL_SELECTED_REVISION_FILENAME',
413 'reportable' => false,
416 //END fields used for contract documents subpanel.
420 array('name' => 'idx_doc_cat', 'type' => 'index', 'fields' => array('category_id', 'subcategory_id')),
422 'relationships' => array(
423 'document_revisions' => array('lhs_module' => 'Documents', 'lhs_table' => 'documents', 'lhs_key' => 'id',
424 'rhs_module' => 'DocumentRevisions', 'rhs_table' => 'document_revisions', 'rhs_key' => 'document_id',
425 'relationship_type' => 'one-to-many')
427 , 'documents_modified_user' =>
428 array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id',
429 'rhs_module' => 'Documents', 'rhs_table' => 'documents', 'rhs_key' => 'modified_user_id',
430 'relationship_type' => 'one-to-many')
432 , 'documents_created_by' =>
433 array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id',
434 'rhs_module' => 'Documents', 'rhs_table' => 'documents', 'rhs_key' => 'created_by',
435 'relationship_type' => 'one-to-many')
439 VardefManager::createVardef('Documents', 'Document', array('default', 'assignable',