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',
112 'name' => 'active_date',
113 'vname' => 'LBL_DOC_ACTIVE_DATE',
115 'importable' => 'required',
117 'display_default' => 'now',
122 'name' => 'exp_date',
123 'vname' => 'LBL_DOC_EXP_DATE',
129 'name' => 'category_id',
130 'vname' => 'LBL_SF_CATEGORY',
133 'options' => 'document_category_dom',
134 'reportable' => true,
139 'name' => 'subcategory_id',
140 'vname' => 'LBL_SF_SUBCATEGORY',
143 'options' => 'document_subcategory_dom',
144 'reportable' => true,
149 'name' => 'status_id',
150 'vname' => 'LBL_DOC_STATUS',
153 'options' => 'document_status_dom',
154 'reportable' => false,
160 'vname' => 'LBL_DOC_STATUS',
162 'source' => 'non-db',
163 'comment' => 'Document status for Meta-Data framework',
166 'document_revision_id' =>
168 'name' => 'document_revision_id',
169 'vname' => 'LBL_LATEST_REVISION',
172 'reportable' => false,
177 'name' => 'revisions',
179 'relationship' => 'document_revisions',
180 'source' => 'non-db',
181 'vname' => 'LBL_REVISIONS',
186 'name' => 'revision',
187 'vname' => 'LBL_DOC_VERSION',
189 'reportable' => false,
191 'source' => 'non-db',
192 'importable' => 'required',
197 'last_rev_created_name' =>
199 'name' => 'last_rev_created_name',
200 'vname' => 'LBL_LAST_REV_CREATOR',
202 'reportable' => false,
205 'last_rev_mime_type' =>
207 'name' => 'last_rev_mime_type',
208 'vname' => 'LBL_LAST_REV_MIME_TYPE',
210 'reportable' => false,
216 'name' => 'latest_revision',
217 'vname' => 'LBL_LATEST_REVISION',
219 'reportable' => false,
222 'last_rev_create_date' =>
224 'name' => 'last_rev_create_date',
226 'table' => 'document_revisions',
227 'link' => 'revisions',
228 'join_name' => 'document_revisions',
229 'vname' => 'LBL_LAST_REV_CREATE_DATE',
230 'rname' => 'date_entered',
231 'reportable' => false,
234 'contracts' => array(
235 'name' => 'contracts',
237 'relationship' => 'contracts_documents',
238 'source' => 'non-db',
239 'vname' => 'LBL_CONTRACTS',
245 'relationship' => 'leads_documents',
246 'source' => 'non-db',
247 'vname' => 'LBL_LEADS',
249 // Links around the world
252 'name' => 'accounts',
254 'relationship' => 'documents_accounts',
255 'source' => 'non-db',
256 'vname' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
260 'name' => 'contacts',
262 'relationship' => 'documents_contacts',
263 'source' => 'non-db',
264 'vname' => 'LBL_CONTACTS_SUBPANEL_TITLE',
268 'name' => 'opportunities',
270 'relationship' => 'documents_opportunities',
271 'source' => 'non-db',
272 'vname' => 'LBL_OPPORTUNITIES_SUBPANEL_TITLE',
278 'relationship' => 'documents_cases',
279 'source' => 'non-db',
280 'vname' => 'LBL_CASES_SUBPANEL_TITLE',
286 'relationship' => 'documents_bugs',
287 'source' => 'non-db',
288 'vname' => 'LBL_BUGS_SUBPANEL_TITLE',
292 'name' => 'related_doc_id',
293 'vname' => 'LBL_RELATED_DOCUMENT_ID',
294 'reportable' => false,
300 'related_doc_name' =>
302 'name' => 'related_doc_name',
303 'vname' => 'LBL_DET_RELATED_DOCUMENT',
305 'table' => 'documents',
306 'id_name' => 'related_doc_id',
307 'module' => 'Documents',
308 'source' => 'non-db',
309 'comment' => 'The related document name for Meta-Data framework',
312 'related_doc_rev_id' =>
314 'name' => 'related_doc_rev_id',
315 'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
316 'reportable' => false,
322 'related_doc_rev_number' =>
324 'name' => 'related_doc_rev_number',
325 'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
327 'source' => 'non-db',
328 'comment' => 'The related document version number for Meta-Data framework',
333 'name' => 'is_template',
334 'vname' => 'LBL_IS_TEMPLATE',
337 'reportable' => false,
341 'name' => 'template_type',
342 'vname' => 'LBL_TEMPLATE_TYPE',
345 'options' => 'document_template_type_dom',
346 'reportable' => false,
348 //BEGIN field used for contract document subpanel.
349 'latest_revision_name' =>
351 'name' => 'latest_revision_name',
352 'vname' => 'LBL_LASTEST_REVISION_NAME',
354 'reportable' => false,
358 'selected_revision_name' =>
360 'name' => 'selected_revision_name',
361 'vname' => 'LBL_SELECTED_REVISION_NAME',
363 'reportable' => false,
368 'name' => 'contract_status',
369 'vname' => 'LBL_CONTRACT_STATUS',
371 'reportable' => false,
376 'name' => 'contract_name',
377 'vname' => 'LBL_CONTRACT_NAME',
379 'reportable' => false,
384 'name' => 'linked_id',
385 'vname' => 'LBL_LINKED_ID',
387 'reportable' => false,
390 'selected_revision_id' =>
392 'name' => 'selected_revision_id',
393 'vname' => 'LBL_SELECTED_REVISION_ID',
395 'reportable' => false,
398 'latest_revision_id' =>
400 'name' => 'latest_revision_id',
401 'vname' => 'LBL_LATEST_REVISION_ID',
403 'reportable' => false,
406 'selected_revision_filename' =>
408 'name' => 'selected_revision_filename',
409 'vname' => 'LBL_SELECTED_REVISION_FILENAME',
411 'reportable' => false,
414 //END fields used for contract documents subpanel.
418 array('name' => 'idx_doc_cat', 'type' => 'index', 'fields' => array('category_id', 'subcategory_id')),
420 'relationships' => array(
421 'document_revisions' => array('lhs_module' => 'Documents', 'lhs_table' => 'documents', 'lhs_key' => 'id',
422 'rhs_module' => 'DocumentRevisions', 'rhs_table' => 'document_revisions', 'rhs_key' => 'document_id',
423 'relationship_type' => 'one-to-many')
425 , 'documents_modified_user' =>
426 array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id',
427 'rhs_module' => 'Documents', 'rhs_table' => 'documents', 'rhs_key' => 'modified_user_id',
428 'relationship_type' => 'one-to-many')
430 , 'documents_created_by' =>
431 array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id',
432 'rhs_module' => 'Documents', 'rhs_table' => 'documents', 'rhs_key' => 'created_by',
433 'relationship_type' => 'one-to-many')
437 VardefManager::createVardef('Documents', 'Document', array('default', 'assignable',