Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/upload_file.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $current_user;
global $gridline;
global $locale;
$focus = new DocumentRevision();
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
}
$old_id = '';
echo get_module_title('DocumentRevisions', $mod_strings['LBL_MODULE_NAME'].": ".$focus->document_name, true);
$GLOBALS['log']->info("Document revision detail view");
$xtpl=new XTemplate ('modules/DocumentRevisions/DetailView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$focus->fill_document_name_revision($focus->document_id);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("DOCUMENT_NAME",$focus->name);
$xtpl->assign("CURRENT_REVISION",$focus->latest_revision);
$xtpl->assign("CHANGE_LOG",$focus->change_log);
$created_user = new User();
$created_user->retrieve($focus->created_by);
$xtpl->assign("CREATED_BY",$locale->getLocaleFormattedName($created_user->first_name, $created_user->last_name));
$xtpl->assign("DATE_CREATED",$focus->date_entered);
$xtpl->assign("REVISION",$focus->revision);
$xtpl->assign("FILENAME",$focus->filename);
$xtpl->assign("FILE_NAME", $focus->filename);
$xtpl->assign("SAVE_FILE", $focus->id);
$xtpl->assign("FILE_URL", UploadFile::get_url($focus->filename,$focus->id));
$xtpl->assign("GRIDLINE", $gridline);
$xtpl->parse("main");
$xtpl->out("main");
?>

View File

@@ -0,0 +1,307 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/upload_file.php');
// User is used to store Forecast information.
class DocumentRevision extends SugarBean {
var $id;
var $document_id;
var $date_entered;
var $created_by;
var $filename;
var $file_mime_type;
var $revision;
var $change_log;
var $document_name;
var $latest_revision;
var $file_url;
var $file_ext;
var $created_by_name;
var $img_name;
var $img_name_bare;
var $table_name = "document_revisions";
var $object_name = "DocumentRevision";
var $module_dir = 'DocumentRevisions';
var $new_schema = true;
var $latest_revision_id;
/*var $column_fields = Array("id"
,"document_id"
,"date_entered"
,"created_by"
,"filename"
,"file_mime_type"
,"revision"
,"change_log"
,"file_ext"
);
*/
var $encodeFields = Array();
// This is used to retrieve related fields from form posts.
var $additional_column_fields = Array('');
// This is the list of fields that are in the lists.
var $list_fields = Array("id"
,"document_id"
,"date_entered"
,"created_by"
,"filename"
,"file_mime_type"
,"revision"
,"file_url"
,"change_log"
,"file_ext"
,"created_by_name"
);
var $required_fields = Array("revision");
function DocumentRevision() {
parent::SugarBean();
$this->setupCustomFields('DocumentRevisions'); //parameter is module name
$this->disable_row_level_security =true; //no direct access to this module.
}
function save($check_notify = false){
parent::save($check_notify);
//update documents table.
//$query = "UPDATE documents set document_version_id='$this->id' where id = '$this->document_id'";
//$this->db->query($query);
}
function get_summary_text()
{
return "$this->filename";
}
function retrieve($id, $encode=false){
$ret = parent::retrieve($id, $encode);
return $ret;
}
function is_authenticated()
{
return $this->authenticated;
}
function fill_in_additional_list_fields() {
$this->fill_in_additional_detail_fields();
}
function fill_in_additional_detail_fields()
{
global $theme;
global $current_language;
parent::fill_in_additional_detail_fields();
$mod_strings=return_module_language($current_language, 'Documents');
//find the document name and current version.
$query = "SELECT document_name, revision, document_revision_id FROM documents, document_revisions where documents.id = '$this->document_id' AND document_revisions.id = documents.document_revision_id";
$result = $this->db->query($query,true,"Error fetching document details...:");
$row = $this->db->fetchByAssoc($result);
if ($row != null) {
$this->document_name = $row['document_name'];
$this->latest_revision = $row['revision'];
$this->latest_revision_id = $row['document_revision_id'];
}
//populate the file url.
//image is selected based on the extension name <ext>_image_inline, extension is stored in document_revisions.
//if file is not found then default image file will be used.
global $img_name;
global $img_name_bare;
if (!empty($this->file_ext)) {
$img_name = SugarThemeRegistry::current()->getImageURL("{$this->file_ext}_image_inline.gif");
$img_name_bare = "{$this->file_ext}_image_inline";
}
//set default file name.
if (!empty($img_name) && file_exists($img_name)) {
$img_name = $img_name_bare;
}
else {
$img_name = "def_image_inline"; //todo change the default image.
}
if($this->ACLAccess('DetailView')){
$this->file_url = "<a href='".UploadFile::get_url($this->filename,$this->id)."' target='_blank'>".SugarThemeRegistry::current()->getImage($img_name,'alt="'.$mod_strings['LBL_LIST_VIEW_DOCUMENT'].'" border="0"')."</a>";
}else{
$this->file_url = "";
}
}
/**
* Returns a filename based off of the logical (Sugar-side) Document name and combined with the revision. Tailor
* this to needs created by email RFCs, filesystem name conventions, charset conventions etc.
* @param string revId Revision ID if not latest
* @return string formatted name
*/
function getDocumentRevisionNameForDisplay($revId='') {
global $sugar_config;
global $current_language;
$localLabels = return_module_language($current_language, 'DocumentRevisions');
// prep - get source Document
if(!class_exists('Documents')) {
}
$document = new Document();
// use passed revision ID
if(!empty($revId)) {
$tempDoc = new DocumentRevision();
$tempDoc->retrieve($revId);
} else {
$tempDoc = $this;
}
// get logical name
$document->retrieve($tempDoc->document_id);
$logicalName = $document->document_name;
// get revision string
$revString = '';
if(!empty($tempDoc->revision)) {
$revString = "-{$localLabels['LBL_REVISION']}_{$tempDoc->revision}";
}
// get extension
$realFilename = $tempDoc->filename;
$fileExtension_beg = strrpos($realFilename, ".");
$fileExtension = "";
if($fileExtension_beg > 0) {
$fileExtension = substr($realFilename, $fileExtension_beg + 1);
}
//check to see if this is a file with extension located in "badext"
foreach($sugar_config['upload_badext'] as $badExt) {
if(strtolower($fileExtension) == strtolower($badExt)) {
//if found, then append with .txt to filename and break out of lookup
//this will make sure that the file goes out with right extension, but is stored
//as a text in db.
$fileExtension .= ".txt";
break; // no need to look for more
}
}
$fileExtension = ".".$fileExtension;
$return = $logicalName.$revString.$fileExtension;
// apply RFC limitations here
if(mb_strlen($return) > 1024) {
// do something if we find a real RFC issue
}
return $return;
}
function fill_document_name_revision($doc_id) {
//find the document name and current version.
$query = "SELECT documents.document_name, revision FROM documents, document_revisions where documents.id = '$doc_id'";
$query .= " AND document_revisions.id = documents.document_revision_id";
$result = $this->db->query($query,true,"Error fetching document details...:");
$row = $this->db->fetchByAssoc($result);
if ($row != null) {
$this->name = $row['document_name'];
$this->latest_revision = $row['revision'];
}
}
function list_view_parse_additional_sections(&$list_form, $xTemplateSection){
return $list_form;
}
function get_list_view_data(){
$revision_fields = $this->get_list_view_array();
$forecast_fields['FILE_URL'] = $this->file_url;
return $revision_fields;
}
//static function..
function get_document_revision_name($doc_revision_id){
if (empty($doc_revision_id)) return null;
$db = DBManagerFactory::getInstance();
$query="select revision from document_revisions where id='$doc_revision_id'";
$result=$db->query($query);
if (!empty($result)) {
$row=$db->fetchByAssoc($result);
if (!empty($row)) {
return $row['revision'];
}
}
return null;
}
//static function.
function get_document_revisions($doc_id){
$return_array= Array();
if (empty($doc_id)) return $return_array;
$db = DBManagerFactory::getInstance();
$query="select id, revision from document_revisions where document_id='$doc_id' and deleted=0";
$result=$db->query($query);
if (!empty($result)) {
while (($row=$db->fetchByAssoc($result)) != null) {
$return_array[$row['id']]=$row['revision'];
}
}
return $return_array;
}
}
?>

View File

@@ -0,0 +1,108 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/upload_file.php');
require_once('modules/DocumentRevisions/Forms.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $current_user;
$focus = new DocumentRevision();
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
}
$old_id = '';
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true')
{
if (! empty($focus->filename) )
{
$old_id = $focus->id;
}
$focus->id = "";
}
echo get_module_title('DocumentRevisions', $mod_strings['LBL_MODULE_NAME'].": ".$focus->document_name, true);
$GLOBALS['log']->info("Document revision edit view");
$xtpl=new XTemplate ('modules/DocumentRevisions/EditView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_document_revision_js());
$focus->fill_document_name_revision($_REQUEST['return_id']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("DOCUMENT_NAME",$_REQUEST['document_name']);
$xtpl->assign("CURRENT_REVISION",$_REQUEST['document_revision']);
if($_REQUEST['document_revision'] == null) {
$xtpl->assign("CURRENT_REVISION",$focus->latest_revision);
}
$xtpl->assign("FILE_URL", UploadFile::get_url($_REQUEST['document_filename'],$_REQUEST['document_revision_id']));
$xtpl->parse("main");
$xtpl->out("main");
//implements required fields check based on the required fields list defined in the bean.
$javascript = new javascript();
$javascript->setFormName('DocumentRevisionEditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
echo $javascript->getScript();
?>

View File

@@ -0,0 +1,222 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains a variety of utility functions used to display UI
* components such as form headers and footers. Intended to be modified on a per
* theme basis.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
/**
* Create javascript to validate the data entered into a record.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
*/
function get_validate_record_document_revision_js () {
global $mod_strings;
global $app_strings;
$lbl_version = $mod_strings['LBL_DOC_VERSION'];
$lbl_filename = $mod_strings['LBL_FILENAME'];
$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
$the_script = <<<EOQ
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
function trim(s) {
while (s.substring(0,1) == " ") {
s = s.substring(1, s.length);
}
while (s.substring(s.length-1, s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
function verify_data(form) {
var isError = false;
var errorMessage = "";
if (trim(form.revision.value) == "") {
isError = true;
errorMessage += "\\n$lbl_version";
}
if (trim(form.uploadfile.value) == "") {
isError = true;
errorMessage += "\\n$lbl_filename";
}
if (isError == true) {
alert("$err_missing_required_fields" + errorMessage);
return false;
}
return true;
}
// end hiding contents from old browsers -->
</script>
EOQ;
return $the_script;
}
function get_chooser_js()
{
$the_script = <<<EOQ
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
function set_chooser()
{
var display_tabs_def = '';
for(i=0; i < object_refs['display_tabs'].options.length ;i++)
{
display_tabs_def += "display_tabs[]="+object_refs['display_tabs'].options[i].value+"&";
}
document.EditView.display_tabs_def.value = display_tabs_def;
}
// end hiding contents from old browsers -->
</script>
EOQ;
return $the_script;
}
function get_validate_record_js(){
global $mod_strings;
global $app_strings;
$lbl_name = $mod_strings['ERR_DOC_NAME'];
$lbl_start_date = $mod_strings['ERR_DOC_ACTIVE_DATE'];
$lbl_file_name = $mod_strings['ERR_FILENAME'];
$lbl_file_version=$mod_strings['ERR_DOC_VERSION'];
$sqs_no_match = $app_strings['ERR_SQS_NO_MATCH'];
$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
if(isset($_REQUEST['record'])) {
//do not validate upload file
$the_upload_script="";
} else
{
$the_upload_script = <<<EOQ
if (trim(form.uploadfile.value) == "") {
isError = true;
errorMessage += "\\n$lbl_file_name";
}
EOQ;
}
$the_script = <<<EOQ
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
function trim(s) {
while (s.substring(0,1) == " ") {
s = s.substring(1, s.length);
}
while (s.substring(s.length-1, s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
function verify_data(form) {
var isError = false;
var errorMessage = "";
if (trim(form.document_name.value) == "") {
isError = true;
errorMessage += "\\n$lbl_name";
}
$the_upload_script
if (trim(form.active_date.value) == "") {
isError = true;
errorMessage += "\\n$lbl_start_date";
}
if (trim(form.revision.value) == "") {
isError = true;
errorMessage += "\\n$lbl_file_version";
}
if (isError == true) {
alert("$err_missing_required_fields" + errorMessage);
return false;
}
//make sure start date is <= end_date
return true;
}
// end hiding contents from old browsers -->
</script>
EOQ;
return $the_script;
}
?>

View File

@@ -0,0 +1,60 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings;
global $current_user;
if(ACLController::checkAccess('Documents', 'edit', true))$module_menu[]=Array("index.php?module=Documents&action=EditView&return_module=Documents&return_action=DetailView", $mod_strings['LNK_NEW_DOCUMENT'],"CreateDocuments");
if(ACLController::checkAccess('Documents', 'list', true))$module_menu[]=Array("index.php?module=Documents&action=index", $mod_strings['LNK_DOCUMENT_LIST'],"Documents");
if(ACLController::checkAccess('Documents', 'detail', true)){
$admin = new Administration();
$admin->retrieveSettings();
$user_merge = $current_user->getPreference('mailmerge_on');
if ($user_merge == 'on' && isset($admin->settings['system_mailmerge_on']) && $admin->settings['system_mailmerge_on']){
$module_menu[]=Array("index.php?module=MailMerge&action=index&reset=true", $mod_strings['LNK_NEW_MAIL_MERGE'],"Documents");
}
}
?>

View File

@@ -0,0 +1,109 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Base Form For Notes
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/formbase.php');
require_once('include/upload_file.php');
global $mod_strings;
$mod_strings = return_module_language($current_language, 'DocumentRevisions');
$prefix='';
$do_final_move = 0;
$Revision = new DocumentRevision();
$Document = new Document();
if (isset($_REQUEST['record'])) {
$Document->retrieve($_REQUEST['record']);
}
if(!$Document->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if (isset($_REQUEST['SaveRevision'])) {
//fetch the document record.
$Document->retrieve($_REQUEST['return_id']);
if($useRequired && !checkRequired($prefix, array_keys($Revision->required_fields))){
return null;
}
$Revision = populateFromPost($prefix, $Revision);
$upload_file = new UploadFile('uploadfile');
if (isset($_FILES['uploadfile']) && $upload_file->confirm_upload())
{
$Revision->filename = $upload_file->get_stored_file_name();
$Revision->file_mime_type = $upload_file->mime_type;
$Revision->file_ext = $upload_file->file_ext;
$do_final_move = 1;
}
//save revision
$Revision->document_id = $_REQUEST['return_id'];
$Revision->id = null; // 17767: Security fix, make sure no id is passed in via form.
$Revision->save();
//revsion is the document.
$Document->document_revision_id = $Revision->id;
$Document->save();
$return_id = $Document->id;
}
if ($do_final_move)
{
$upload_file->final_move($Revision->id);
}
else if ( ! empty($_REQUEST['old_id']))
{
$upload_file->duplicate_file($_REQUEST['old_id'], $Revision->id, $Revision->filename);
}
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
handleRedirect($return_id, "Documents");
?>

View File

@@ -0,0 +1,71 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['DocumentRevision'] = array ('column_fields' => Array("id"
,"change_log"
,"document_id"
,"date_entered"
,"created_by"
,"filename"
,"file_ext"
,"file_mime_type"
,"revision"
,"date_modified"
,"deleted"
),
'list_fields' => Array("id"
,"change_log"
,"document_id"
,"date_entered"
,"created_by"
,"filename"
,"file_ext"
,"file_mime_type"
,"revision"
,"date_modified"
,"deleted"
,"latest_revision_id"
),
'required_fields' => Array("revision"=>1),
);
?>

View File

@@ -0,0 +1,88 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
//module
'LBL_MODULE_NAME' => 'Document Revision',
'LNK_NEW_DOCUMENT' => 'Create Document',
'LNK_DOCUMENT_LIST'=> 'View Documents',
//vardef labels
'LBL_REVISION_NAME' => 'Revision Number',
'LBL_FILENAME' => 'Filename',
'LBL_MIME' => 'Mime Type',
'LBL_REVISION' => 'Revision',
'LBL_DOCUMENT' => 'Related Document',
'LBL_LATEST_REVISION' => 'Latest Revision',
'LBL_CHANGE_LOG'=> 'Change Log',
'LBL_ACTIVE_DATE'=> 'Publish Date',
'LBL_EXPIRATION_DATE' => 'Expiration Date',
'LBL_FILE_EXTENSION' => 'File Extension',
'LBL_DET_CREATED_BY' => 'Created By:',
'LBL_DET_DATE_CREATED' => 'Date Created:',
'LBL_DOC_NAME' => 'Document Name:',
'LBL_DOC_VERSION' => 'Revision:',
//document revisions.
'LBL_REV_LIST_REVISION' => 'Revision',
'LBL_REV_LIST_ENTERED' => 'Date Created',
'LBL_REV_LIST_CREATED' => 'Created by',
'LBL_REV_LIST_LOG'=> 'Change Log',
'LBL_REV_LIST_FILENAME' => 'Filename',
'LBL_CURRENT_DOC_VERSION'=> 'Latest Revision:',
'LBL_SEARCH_FORM_TITLE'=> 'Document Search',
//error messages
'ERR_FILENAME'=> 'File Name',
'ERR_DOC_VERSION'=> 'Document Version',
'ERR_DELETE_CONFIRM'=> 'Do you want to delete this document revision?',
'ERR_DELETE_LATEST_VERSION'=> 'You are not allowed to delete the latest revision of a document.',
'LNK_NEW_MAIL_MERGE' => 'Mail Merge',
);
?>

View File

@@ -0,0 +1,75 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
//module
'LBL_MODULE_NAME' => 'Wersja dokumentu',
'LNK_NEW_DOCUMENT' => 'Utwórz dokument',
'LNK_DOCUMENT_LIST'=> 'Lista dokumentów',
//vardef labels
'LBL_REVISION_NAME' => 'Numer wersji',
'LBL_FILENAME' => 'Nazwa pliku',
'LBL_MIME' => 'Typ mime',
'LBL_REVISION' => 'Wersja',
'LBL_DOCUMENT' => 'Połączone dokumenty',
'LBL_LATEST_REVISION' => 'Najnowsza wersja',
'LBL_CHANGE_LOG'=> 'Dziennik zmian',
'LBL_ACTIVE_DATE'=> 'Data publikacji',
'LBL_EXPIRATION_DATE' => 'Data wygaśnięcia',
'LBL_FILE_EXTENSION' => 'Rozszerzenie pliku',
'LBL_DET_CREATED_BY' => 'Utworzone przez:',
'LBL_DET_DATE_CREATED' => 'Data utworzenia:',
'LBL_DOC_NAME' => 'Nazwa dokumentu:',
'LBL_DOC_VERSION' => 'Wersja:',
//document revisions.
'LBL_REV_LIST_REVISION' => 'Wersja',
'LBL_REV_LIST_ENTERED' => 'Data utworzenia',
'LBL_REV_LIST_CREATED' => 'Utworzone przez',
'LBL_REV_LIST_LOG'=> 'Dziennik zmian',
'LBL_REV_LIST_FILENAME' => 'Nazwa pliku',
'LBL_CURRENT_DOC_VERSION'=> 'Najnowsza wersja:',
'LBL_SEARCH_FORM_TITLE'=> 'Szukanie dokumentu',
//error messages
'ERR_FILENAME'=> 'Nazwa pliku',
'ERR_DOC_VERSION'=> 'Wersja dokumentu',
'ERR_DELETE_CONFIRM'=> 'Czy napewno chcesz usunąć te wersje dokumentu?',
'ERR_DELETE_LATEST_VERSION'=> 'Nie jesteś upoważniony do usunięcia najnowszej wersji tego dokumentu.',
'LNK_NEW_MAIL_MERGE' => 'Scalanie poczty',
);
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateRevisionButton'),
),
'where' => '',
'list_fields' => array(
'filename'=>array (
'vname'=>'LBL_REV_LIST_FILENAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '15%',
),
'revision'=>array(
'vname' => 'LBL_REV_LIST_REVISION',
'width' => '5%',
),
'date_entered'=>array(
'vname' => 'LBL_REV_LIST_ENTERED',
'width' => '10%',
),
'created_by_name'=>array(
'vname' => 'LBL_REV_LIST_CREATED',
'width' => '25%',
),
'change_log'=>array(
'vname' => 'LBL_REV_LIST_LOG',
'width' => '35%',
),
'del_button'=>array(
'vname' => 'LBL_DELETE_BUTTON',
'widget_class' => 'SubPanelRemoveButton',
'width' => '5%',
),
'document_id'=>array(
'usage' =>'query_only',
)
),
);
?>

View File

@@ -0,0 +1,92 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateRevisionButton'),
),
'where' => '',
'list_fields' => array(
'filename' =>
array (
'vname' => 'LBL_REV_LIST_FILENAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '15%',
'default' => true,
),
'revision' =>
array (
'vname' => 'LBL_REV_LIST_REVISION',
'width' => '5%',
'default' => true,
),
'created_by_name' =>
array (
'vname' => 'LBL_REV_LIST_CREATED',
'width' => '25%',
'default' => true,
),
'date_entered' =>
array (
'vname' => 'LBL_REV_LIST_ENTERED',
'width' => '10%',
'default' => true,
),
'change_log' =>
array (
'vname' => 'LBL_REV_LIST_LOG',
'width' => '35%',
'default' => true,
),
'del_button' =>
array (
'vname' => 'LBL_DELETE_BUTTON',
'widget_class' => 'SubPanelRemoveButton',
'width' => '5%',
'default' => true,
),
'document_id' =>
array (
'usage' => 'query_only',
),
),
);
?>

View File

@@ -0,0 +1,188 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$dictionary['DocumentRevision'] = array('table' => 'document_revisions'
,'fields' => array (
'id' =>
array (
'name' => 'id',
'vname' => 'LBL_REVISION_NAME',
'type' => 'varchar',
'len' => '36',
'required'=>true,
'reportable'=>false,
),
'change_log' =>
array (
'name' => 'change_log',
'vname' => 'LBL_CHANGE_LOG',
'type' => 'varchar',
'len' => '255',
),
'document_id' =>
array (
'name' => 'document_id',
'vname' => 'LBL_DOCUMENT',
'type' => 'varchar',
'len' => '36',
'required'=>false,
'reportable'=>false,
),
'date_entered' =>
array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
),
'created_by' =>
array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_CREATED',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'id',
'source'=>'db',
),
'filename' =>
array (
'name' => 'filename',
'vname' => 'LBL_FILENAME',
'type' => 'varchar',
'required'=>true,
'len' => '255',
),
'file_ext' =>
array (
'name' => 'file_ext',
'vname' => 'LBL_FILE_EXTENSION',
'type' => 'varchar',
'len' => '25',
),
'file_mime_type' =>
array (
'name' => 'file_mime_type',
'vname' => 'LBL_MIME',
'type' => 'varchar',
'len' => '100',
),
'revision'=>
array (
'name' => 'revision',
'vname' => 'LBL_REVISION',
'type' => 'varchar',
'len' => '25',
'importable' => 'required',
),
'deleted' =>
array (
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'default' => 0,
'reportable'=>false,
),
'date_modified' =>
array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
),
'documents' =>
array (
'name' => 'documents',
'type' => 'link',
'relationship' => 'document_revisions',
'source'=>'non-db',
'vname'=>'LBL_REVISIONS',
),
'created_by_link' =>
array (
'name' => 'created_by_link',
'type' => 'link',
'relationship' => 'revisions_created_by',
'vname' => 'LBL_CREATED_BY_USER',
'link_type' => 'one',
'module'=>'Users',
'bean_name'=>'User',
'source'=>'non-db',
),
'created_by_name' =>
array (
'name' => 'created_by_name',
'rname' => 'user_name',
'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
'id_name' => 'created_by',
'vname' => 'LBL_CREATED_BY_NAME',
'type' => 'relate',
'table' => 'users',
'isnull' => 'true',
'module' => 'Users',
'dbType' => 'varchar',
'link'=>'created_by_link',
'len' => '255',
'source'=>'non-db',
),
'latest_revision_id'=>
array (
'name' => 'latest_revision_id',
'vname' => 'LBL_REVISION',
'type' => 'varchar',
'len' => '36',
'source'=>'non-db',
),
),
'relationships'=>array(
'revisions_created_by' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'DocumentRevisions', 'rhs_table'=> 'document_revisions', 'rhs_key' => 'created_by',
'relationship_type'=>'one-to-many'),
),
'indices' => array (
array('name' =>'documentrevisionspk', 'type' =>'primary', 'fields'=>array('id'))
)
);
?>