2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM 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'
43 'name' => 'document_name',
44 'vname' => 'LBL_NAME',
48 'importable' => 'required',
51 array('name'=>'name', 'vname' => 'LBL_NAME', 'source'=>'non-db', 'type'=>'varchar'),
55 'vname' => 'LBL_FILENAME',
58 'comment' => 'The filename of the document attachment',
66 'vname' => 'LBL_FILENAME',
73 'name' => 'active_date',
74 'vname' => 'LBL_DOC_ACTIVE_DATE',
76 'importable' => 'required',
83 'vname' => 'LBL_DOC_EXP_DATE',
89 'name' => 'category_id',
90 'vname' => 'LBL_SF_CATEGORY',
93 'options' => 'document_category_dom',
99 'name' => 'subcategory_id',
100 'vname' => 'LBL_SF_SUBCATEGORY',
103 'options' => 'document_subcategory_dom',
109 'name' => 'status_id',
110 'vname' => 'LBL_DOC_STATUS',
113 'options' => 'document_status_dom',
120 'vname' => 'LBL_DOC_STATUS',
122 'source' => 'non-db',
123 'comment' => 'Document status for Meta-Data framework',
126 'document_revision_id'=>
128 'name' => 'document_revision_id',
129 'vname' => 'LBL_LATEST_REVISION',
137 'name' => 'revisions',
139 'relationship' => 'document_revisions',
141 'vname'=>'LBL_REVISIONS',
146 'name' => 'revision',
147 'vname' => 'LBL_DOC_VERSION',
152 'importable' => 'required',
156 'last_rev_created_name' =>
158 'name' => 'last_rev_created_name',
159 'vname' => 'LBL_LAST_REV_CREATOR',
164 'last_rev_mime_type' =>
166 'name' => 'last_rev_mime_type',
167 'vname' => 'LBL_LAST_REV_MIME_TYPE',
175 'name' => 'latest_revision',
176 'vname' => 'LBL_LATEST_REVISION',
181 'last_rev_create_date' =>
183 'name' => 'last_rev_create_date',
185 'table' => 'document_revisions',
186 'link' => 'revisions',
187 'join_name' => 'document_revisions',
188 'vname'=>'LBL_LAST_REV_CREATE_DATE',
189 'rname'=> 'date_entered',
193 'contracts' => array (
194 'name' => 'contracts',
196 'relationship' => 'contracts_documents',
197 'source' => 'non-db',
198 'vname' => 'LBL_CONTRACTS',
204 'relationship' => 'leads_documents',
205 'source' => 'non-db',
206 'vname' => 'LBL_LEADS',
211 'name' => 'related_doc_id',
212 'vname' => 'LBL_RELATED_DOCUMENT_ID',
219 'related_doc_name' =>
221 'name' => 'related_doc_name',
222 'vname' => 'LBL_DET_RELATED_DOCUMENT',
224 'table' => 'documents',
225 'id_name' => 'related_doc_id',
226 'module' => 'Documents',
227 'source' => 'non-db',
228 'comment' => 'The related document name for Meta-Data framework',
231 'related_doc_rev_id' =>
233 'name' => 'related_doc_rev_id',
234 'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
241 'related_doc_rev_number' =>
243 'name' => 'related_doc_rev_number',
244 'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
246 'source' => 'non-db',
247 'comment' => 'The related document version number for Meta-Data framework',
252 'name' => 'is_template',
253 'vname' => 'LBL_IS_TEMPLATE',
260 'name' => 'template_type',
261 'vname' => 'LBL_TEMPLATE_TYPE',
264 'options' => 'document_template_type_dom',
267 //BEGIN field used for contract document subpanel.
268 'latest_revision_name' =>
270 'name' => 'latest_revision_name',
271 'vname' => 'LBL_LASTEST_REVISION_NAME',
277 'selected_revision_name' =>
279 'name' => 'selected_revision_name',
280 'vname' => 'LBL_SELECTED_REVISION_NAME',
287 'name' => 'contract_status',
288 'vname' => 'LBL_CONTRACT_STATUS',
295 'name' => 'contract_name',
296 'vname' => 'LBL_CONTRACT_NAME',
303 'name' => 'linked_id',
304 'vname' => 'LBL_LINKED_ID',
309 'selected_revision_id'=>
311 'name' => 'selected_revision_id',
312 'vname' => 'LBL_SELECTED_REVISION_ID',
317 'latest_revision_id'=>
319 'name' => 'latest_revision_id',
320 'vname' => 'LBL_LATEST_REVISION_ID',
325 'selected_revision_filename'=>
327 'name' => 'selected_revision_filename',
328 'vname' => 'LBL_SELECTED_REVISION_FILENAME',
333 //END fields used for contract documents subpanel.
337 array('name' =>'idx_doc_cat', 'type' =>'index', 'fields'=>array('category_id', 'subcategory_id')),
339 'relationships' => array (
340 'document_revisions' => array('lhs_module'=> 'Documents', 'lhs_table'=> 'documents', 'lhs_key' => 'id',
341 'rhs_module'=> 'Documents', 'rhs_table'=> 'document_revisions', 'rhs_key' => 'document_id',
342 'relationship_type'=>'one-to-many')
344 ,'documents_modified_user' =>
345 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
346 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'modified_user_id',
347 'relationship_type'=>'one-to-many')
349 ,'documents_created_by' =>
350 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
351 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'created_by',
352 'relationship_type'=>'one-to-many')
356 VardefManager::createVardef('Documents','Document', array('default',