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 ********************************************************************************/
39 $dictionary['Document'] = array('table' => 'documents'
44 'name' => 'document_name',
45 'vname' => 'LBL_NAME',
49 'importable' => 'required',
52 array('name'=>'name', 'vname' => 'LBL_NAME', 'source'=>'non-db', 'type'=>'varchar'),
56 'vname' => 'LBL_FILENAME',
59 'comment' => 'The filename of the document attachment',
67 'vname' => 'LBL_FILENAME',
74 'name' => 'active_date',
75 'vname' => 'LBL_DOC_ACTIVE_DATE',
77 'importable' => 'required',
84 'vname' => 'LBL_DOC_EXP_DATE',
90 'name' => 'category_id',
91 'vname' => 'LBL_SF_CATEGORY',
94 'options' => 'document_category_dom',
100 'name' => 'subcategory_id',
101 'vname' => 'LBL_SF_SUBCATEGORY',
104 'options' => 'document_subcategory_dom',
110 'name' => 'status_id',
111 'vname' => 'LBL_DOC_STATUS',
114 'options' => 'document_status_dom',
121 'vname' => 'LBL_DOC_STATUS',
123 'source' => 'non-db',
124 'comment' => 'Document status for Meta-Data framework',
127 'document_revision_id'=>
129 'name' => 'document_revision_id',
130 'vname' => 'LBL_LATEST_REVISION',
138 'name' => 'revisions',
140 'relationship' => 'document_revisions',
142 'vname'=>'LBL_REVISIONS',
147 'name' => 'revision',
148 'vname' => 'LBL_DOC_VERSION',
153 'importable' => 'required',
157 'last_rev_created_name' =>
159 'name' => 'last_rev_created_name',
160 'vname' => 'LBL_LAST_REV_CREATOR',
165 'last_rev_mime_type' =>
167 'name' => 'last_rev_mime_type',
168 'vname' => 'LBL_LAST_REV_MIME_TYPE',
176 'name' => 'latest_revision',
177 'vname' => 'LBL_LATEST_REVISION',
182 'last_rev_create_date' =>
184 'name' => 'last_rev_create_date',
186 'table' => 'document_revisions',
187 'link' => 'revisions',
188 'join_name' => 'document_revisions',
189 'vname'=>'LBL_LAST_REV_CREATE_DATE',
190 'rname'=> 'date_entered',
194 'contracts' => array (
195 'name' => 'contracts',
197 'relationship' => 'contracts_documents',
198 'source' => 'non-db',
199 'vname' => 'LBL_CONTRACTS',
205 'relationship' => 'leads_documents',
206 'source' => 'non-db',
207 'vname' => 'LBL_LEADS',
212 'name' => 'related_doc_id',
213 'vname' => 'LBL_RELATED_DOCUMENT_ID',
220 'related_doc_name' =>
222 'name' => 'related_doc_name',
223 'vname' => 'LBL_DET_RELATED_DOCUMENT',
225 'table' => 'documents',
226 'id_name' => 'related_doc_id',
227 'module' => 'Documents',
228 'source' => 'non-db',
229 'comment' => 'The related document name for Meta-Data framework',
232 'related_doc_rev_id' =>
234 'name' => 'related_doc_rev_id',
235 'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
242 'related_doc_rev_number' =>
244 'name' => 'related_doc_rev_number',
245 'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
247 'source' => 'non-db',
248 'comment' => 'The related document version number for Meta-Data framework',
253 'name' => 'is_template',
254 'vname' => 'LBL_IS_TEMPLATE',
261 'name' => 'template_type',
262 'vname' => 'LBL_TEMPLATE_TYPE',
265 'options' => 'document_template_type_dom',
268 //BEGIN field used for contract document subpanel.
269 'latest_revision_name' =>
271 'name' => 'latest_revision_name',
272 'vname' => 'LBL_LASTEST_REVISION_NAME',
278 'selected_revision_name' =>
280 'name' => 'selected_revision_name',
281 'vname' => 'LBL_SELECTED_REVISION_NAME',
288 'name' => 'contract_status',
289 'vname' => 'LBL_CONTRACT_STATUS',
296 'name' => 'contract_name',
297 'vname' => 'LBL_CONTRACT_NAME',
304 'name' => 'linked_id',
305 'vname' => 'LBL_LINKED_ID',
310 'selected_revision_id'=>
312 'name' => 'selected_revision_id',
313 'vname' => 'LBL_SELECTED_REVISION_ID',
318 'latest_revision_id'=>
320 'name' => 'latest_revision_id',
321 'vname' => 'LBL_LATEST_REVISION_ID',
326 'selected_revision_filename'=>
328 'name' => 'selected_revision_filename',
329 'vname' => 'LBL_SELECTED_REVISION_FILENAME',
334 //END fields used for contract documents subpanel.
338 array('name' =>'idx_doc_cat', 'type' =>'index', 'fields'=>array('category_id', 'subcategory_id')),
340 'relationships' => array (
341 'document_revisions' => array('lhs_module'=> 'Documents', 'lhs_table'=> 'documents', 'lhs_key' => 'id',
342 'rhs_module'=> 'Documents', 'rhs_table'=> 'document_revisions', 'rhs_key' => 'document_id',
343 'relationship_type'=>'one-to-many')
345 ,'documents_modified_user' =>
346 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
347 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'modified_user_id',
348 'relationship_type'=>'one-to-many')
350 ,'documents_created_by' =>
351 array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
352 'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'created_by',
353 'relationship_type'=>'one-to-many')
357 VardefManager::createVardef('Documents','Document', array('default',